summary refs log tree commit diff
path: root/mm/mprotect.c
diff options
context:
space:
mode:
authorJarkko Sakkinen <jarkko@kernel.org>2020-11-13 00:01:20 +0200
committerBorislav Petkov <bp@suse.de>2020-11-17 14:36:13 +0100
commitd2285493bef310b66b56dfe4eb75c1e2f431ea5c (patch)
tree0e4dac4184a6086a496cb4cb77ab1b69d1b7f769 /mm/mprotect.c
parent38853a303982e3be3eccb1a1132399a5c5e2d806 (diff)
downloadlinux-d2285493bef310b66b56dfe4eb75c1e2f431ea5c.tar.gz
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