linux-stable/tools/testing/selftests/sgx
Reinette Chatre 67f1f70a23 selftests/sgx: Test two different SGX2 EAUG flows
Enclave pages can be added to an initialized enclave when an address
belonging to the enclave but without a backing page is accessed from
within the enclave.

Accessing memory without a backing enclave page from within an enclave
can be in different ways:
1) Pre-emptively run ENCLU[EACCEPT]. Since the addition of a page
   always needs to be accepted by the enclave via ENCLU[EACCEPT] this
   flow is efficient since the first execution of ENCLU[EACCEPT]
   triggers the addition of the page and when execution returns to the
   same instruction the second execution would be successful as an
   acceptance of the page.

2) A direct read or write. The flow where a direct read or write
   triggers the page addition execution cannot resume from the
   instruction (read/write) that triggered the fault but instead
   the enclave needs to be entered at a different entry point to
   run needed ENCLU[EACCEPT] before execution can return to the
   original entry point and the read/write instruction that faulted.

Add tests for both flows.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Jarkko Sakkinen <jarkko@kernel.org>
Link: https://lkml.kernel.org/r/0c321e0e32790ac1de742ce5017a331e6d902ac1.1652137848.git.reinette.chatre@intel.com
2022-07-07 10:13:04 -07:00
..
.gitignore
call.S selftests/sgx: Rename 'eenter' and 'sgx_call_vdso' 2021-06-15 16:21:23 -06:00
defines.h selftests/sgx: Add test for EPCM permission changes 2022-07-07 10:13:03 -07:00
load.c selftests/sgx: Fix NULL-pointer-dereference upon early test failure 2022-02-11 13:52:47 -08:00
main.c selftests/sgx: Test two different SGX2 EAUG flows 2022-07-07 10:13:04 -07:00
main.h selftests/sgx: Create a heap for the test enclave 2021-11-15 11:34:03 -08:00
Makefile selftests/sgx: Treat CC as one argument 2022-02-17 11:55:17 -08:00
sign_key.pem
sign_key.S
sigstruct.c selftests/sgx: Make data measurement for an enclave segment optional 2021-11-15 11:34:01 -08:00
test_encl.c selftests/sgx: Add test for EPCM permission changes 2022-07-07 10:13:03 -07:00
test_encl.lds selftests/sgx: Refine the test enclave to have storage 2021-06-15 16:27:23 -06:00
test_encl_bootstrap.S selftests/sgx: Enable multiple thread support 2021-11-15 11:34:14 -08:00