]> git.baikalelectronics.ru Git - kernel.git/commit
nitro_enclaves: Merge contiguous physical memory regions
authorLongpeng <longpeng2@huawei.com>
Sun, 7 Nov 2021 14:09:14 +0000 (22:09 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Nov 2021 15:11:09 +0000 (16:11 +0100)
commita3831c86a7c1e2504b70329862febd7b3f9f06e8
tree74c4010abe5c7b84631311a34e1d0efa6cc36551
parentbda0b6fd16c44e4febaba700aacf50d462d917ab
nitro_enclaves: Merge contiguous physical memory regions

There can be cases when there are more memory regions that need to be
set for an enclave than the maximum supported number of memory regions
per enclave. One example can be when the memory regions are backed by 2
MiB hugepages (the minimum supported hugepage size).

Let's merge the adjacent regions if they are physically contiguous. This
way the final number of memory regions is less than before merging and
could potentially avoid reaching maximum.

Reviewed-by: Andra Paraschiv <andraprs@amazon.com>
Signed-off-by: Longpeng <longpeng2@huawei.com>
Link: https://lore.kernel.org/r/20211107140918.2106-2-longpeng2@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/virt/nitro_enclaves/ne_misc_dev.c