diff options
author | Jarkko Sakkinen <jarkko@kernel.org> | 2020-11-13 01:01:20 +0300 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2020-11-17 16:36:13 +0300 |
commit | d2285493bef310b66b56dfe4eb75c1e2f431ea5c (patch) | |
tree | 0e4dac4184a6086a496cb4cb77ab1b69d1b7f769 /mm/mprotect.c | |
parent | 38853a303982e3be3eccb1a1132399a5c5e2d806 (diff) | |
download | linux-d2285493bef310b66b56dfe4eb75c1e2f431ea5c.tar.xz |
x86/sgx: Add SGX page allocator functions
Add functions for runtime allocation and free.
This allocator and its algorithms are as simple as it gets. They do a
linear search across all EPC sections and find the first free page. They
are not NUMA-aware and only hand out individual pages. The SGX hardware
does not support large pages, so something more complicated like a buddy
allocator is unwarranted.
The free function (sgx_free_epc_page()) implicitly calls ENCLS[EREMOVE],
which returns the page to the uninitialized state. This ensures that the
page is ready for use at the next allocation.
Co-developed-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Jethro Beekman <jethro@fortanix.com>
Link: https://lkml.kernel.org/r/20201112220135.165028-10-jarkko@kernel.org
Diffstat (limited to 'mm/mprotect.c')
0 files changed, 0 insertions, 0 deletions