Searched hist:d2285493bef310b66b56dfe4eb75c1e2f431ea5c (Results 1 – 2 of 2) sorted by relevance
/openbmc/linux/arch/x86/kernel/cpu/sgx/ |
H A D | sgx.h | diff d2285493bef310b66b56dfe4eb75c1e2f431ea5c Thu Nov 12 16:01:20 CST 2020 Jarkko Sakkinen <jarkko@kernel.org> 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
|
H A D | main.c | diff d2285493bef310b66b56dfe4eb75c1e2f431ea5c Thu Nov 12 16:01:20 CST 2020 Jarkko Sakkinen <jarkko@kernel.org> 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
|