selftests/sgx: Ensure expected location of test enclave buffer
authorJo Van Bulck <jo.vanbulck@cs.kuleuven.be>
Thu, 5 Oct 2023 15:38:52 +0000 (17:38 +0200)
committerDave Hansen <dave.hansen@linux.intel.com>
Fri, 8 Dec 2023 18:05:27 +0000 (10:05 -0800)
commit022416496008bd51cb7b33975cc0008749329a86
tree02de7c49db9bca4ab1334aee5d2b686ca9c175a9
parenta4c39ef4ed43103caef80029cd30427a9ff342d8
selftests/sgx: Ensure expected location of test enclave buffer

The external tests manipulating page permissions expect encl_buffer to be
placed at the start of the test enclave's .data section. As this is not
guaranteed per the C standard, explicitly place encl_buffer in a separate
section that is explicitly placed at the start of the .data segment in the
linker script to avoid the compiler placing it somewhere else in .data.

Signed-off-by: Jo Van Bulck <jo.vanbulck@cs.kuleuven.be>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Acked-by: Kai Huang <kai.huang@intel.com>
Link: https://lore.kernel.org/all/20231005153854.25566-12-jo.vanbulck%40cs.kuleuven.be
tools/testing/selftests/sgx/defines.h
tools/testing/selftests/sgx/test_encl.c
tools/testing/selftests/sgx/test_encl.lds