diff options
author | Reinette Chatre <reinette.chatre@intel.com> | 2021-11-15 21:35:26 +0300 |
---|---|---|
committer | Dave Hansen <dave.hansen@linux.intel.com> | 2021-11-15 22:34:16 +0300 |
commit | 688542e29fae655a8be25832f6a9959bdd308dd8 (patch) | |
tree | ec600b5f486bac0ae297a0d2787657f34c2e668c /tools/testing/selftests/sgx/test_encl.c | |
parent | 26e688f1263a3c226f3bb5e3441c310ae11e8001 (diff) | |
download | linux-688542e29fae655a8be25832f6a9959bdd308dd8.tar.xz |
selftests/sgx: Add test for multiple TCS entry
Each thread executing in an enclave is associated with a Thread Control
Structure (TCS). The SGX test enclave contains two hardcoded TCS, thus
supporting two threads in the enclave.
Add a test to ensure it is possible to enter enclave at both entrypoints.
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
Link: https://lkml.kernel.org/r/7be151a57b4c7959a2364753b995e0006efa3da1.1636997631.git.reinette.chatre@intel.com
Diffstat (limited to 'tools/testing/selftests/sgx/test_encl.c')
-rw-r--r-- | tools/testing/selftests/sgx/test_encl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/testing/selftests/sgx/test_encl.c b/tools/testing/selftests/sgx/test_encl.c index 5d86e3e6456a..4fca01cfd898 100644 --- a/tools/testing/selftests/sgx/test_encl.c +++ b/tools/testing/selftests/sgx/test_encl.c @@ -49,6 +49,11 @@ static void do_encl_op_get_from_addr(void *_op) memcpy(&op->value, (void *)op->addr, 8); } +static void do_encl_op_nop(void *_op) +{ + +} + void encl_body(void *rdi, void *rsi) { const void (*encl_op_array[ENCL_OP_MAX])(void *) = { @@ -56,6 +61,7 @@ void encl_body(void *rdi, void *rsi) do_encl_op_get_from_buf, do_encl_op_put_to_addr, do_encl_op_get_from_addr, + do_encl_op_nop, }; struct encl_op_header *op = (struct encl_op_header *)rdi; |