diff options
author | Reinette Chatre <reinette.chatre@intel.com> | 2022-05-10 11:09:03 -0700 |
---|---|---|
committer | Dave Hansen <dave.hansen@linux.intel.com> | 2022-07-07 10:13:04 -0700 |
commit | 33c5aac3bf32c3ef120ad6d2eb5c65ab64a5fec4 (patch) | |
tree | 2557e70d84919f12d5af5d6a98479f106673fc80 /tools/testing/selftests/sgx/main.h | |
parent | selftests/sgx: Introduce TCS initialization enclave operation (diff) | |
download | wireguard-linux-33c5aac3bf32c3ef120ad6d2eb5c65ab64a5fec4.tar.xz wireguard-linux-33c5aac3bf32c3ef120ad6d2eb5c65ab64a5fec4.zip |
selftests/sgx: Test complete changing of page type flow
Support for changing an enclave page's type enables an initialized
enclave to be expanded with support for more threads by changing the
type of a regular enclave page to that of a Thread Control Structure
(TCS). Additionally, being able to change a TCS or regular enclave
page's type to be trimmed (SGX_PAGE_TYPE_TRIM) initiates the removal
of the page from the enclave.
Test changing page type to TCS as well as page removal flows
in two phases: In the first phase support for a new thread is
dynamically added to an initialized enclave and in the second phase
the pages associated with the new thread are removed from the enclave.
As an additional sanity check after the second phase the page used as
a TCS page during the first phase is added back as a regular page and
ensured that it can be written to (which is not possible if it was a
TCS page).
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/d05b48b00338683a94dcaef9f478540fc3d6d5f9.1652137848.git.reinette.chatre@intel.com
Diffstat (limited to 'tools/testing/selftests/sgx/main.h')
-rw-r--r-- | tools/testing/selftests/sgx/main.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/sgx/main.h b/tools/testing/selftests/sgx/main.h index b45c52ec7ab3..fc585be97e2f 100644 --- a/tools/testing/selftests/sgx/main.h +++ b/tools/testing/selftests/sgx/main.h @@ -38,6 +38,7 @@ void encl_delete(struct encl *ctx); bool encl_load(const char *path, struct encl *encl, unsigned long heap_size); bool encl_measure(struct encl *encl); bool encl_build(struct encl *encl); +uint64_t encl_get_entry(struct encl *encl, const char *symbol); int sgx_enter_enclave(void *rdi, void *rsi, long rdx, u32 function, void *r8, void *r9, struct sgx_enclave_run *run); |