aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/sgx/test_encl.c
diff options
context:
space:
mode:
authorReinette Chatre <reinette.chatre@intel.com>2021-11-15 10:35:23 -0800
committerDave Hansen <dave.hansen@linux.intel.com>2021-11-15 11:34:11 -0800
commitc085dfc7685c8c36698b851b03990b75a3226e97 (patch)
treea06856aab1adf958a7d0500b19a63e67bf91279d /tools/testing/selftests/sgx/test_encl.c
parentselftests/sgx: Provide per-op parameter structs for the test enclave (diff)
downloadwireguard-linux-c085dfc7685c8c36698b851b03990b75a3226e97.tar.xz
wireguard-linux-c085dfc7685c8c36698b851b03990b75a3226e97.zip
selftests/sgx: Rename test properties in preparation for more enclave tests
SGX selftests prepares a data structure outside of the enclave with the type of and data for the operation that needs to be run within the enclave. At this time only two complementary operations are supported by the enclave: copying a value from outside the enclave into a default buffer within the enclave and reading a value from the enclave's default buffer into a variable accessible outside the enclave. In preparation for more operations supported by the enclave the names of the current enclave operations are changed to more accurately reflect the operations and more easily distinguish it from future operations: * The enums ENCL_OP_PUT and ENCL_OP_GET are renamed to ENCL_OP_PUT_TO_BUFFER and ENCL_OP_GET_FROM_BUFFER respectively. * The structs encl_op_put and encl_op_get are renamed to encl_op_put_to_buf and encl_op_get_from_buf respectively. * The enclave functions do_encl_op_put and do_encl_op_get are renamed to do_encl_op_put_to_buf and do_encl_op_get_from_buf respectively. No functional changes. Suggested-by: Jarkko Sakkinen <jarkko@kernel.org> 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> Acked-by: Dave Hansen <dave.hansen@linux.intel.com> Link: https://lkml.kernel.org/r/023fda047c787cf330b88ed9337705edae6a0078.1636997631.git.reinette.chatre@intel.com
Diffstat (limited to '')
-rw-r--r--tools/testing/selftests/sgx/test_encl.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/testing/selftests/sgx/test_encl.c b/tools/testing/selftests/sgx/test_encl.c
index f11eb8315704..4e8da738173f 100644
--- a/tools/testing/selftests/sgx/test_encl.c
+++ b/tools/testing/selftests/sgx/test_encl.c
@@ -16,16 +16,16 @@ static void *memcpy(void *dest, const void *src, size_t n)
return dest;
}
-static void do_encl_op_put(void *op)
+static void do_encl_op_put_to_buf(void *op)
{
- struct encl_op_put *op2 = op;
+ struct encl_op_put_to_buf *op2 = op;
memcpy(&encl_buffer[0], &op2->value, 8);
}
-static void do_encl_op_get(void *op)
+static void do_encl_op_get_from_buf(void *op)
{
- struct encl_op_get *op2 = op;
+ struct encl_op_get_from_buf *op2 = op;
memcpy(&op2->value, &encl_buffer[0], 8);
}
@@ -33,8 +33,8 @@ static void do_encl_op_get(void *op)
void encl_body(void *rdi, void *rsi)
{
const void (*encl_op_array[ENCL_OP_MAX])(void *) = {
- do_encl_op_put,
- do_encl_op_get,
+ do_encl_op_put_to_buf,
+ do_encl_op_get_from_buf,
};
struct encl_op_header *op = (struct encl_op_header *)rdi;