Re: [PATCH v7 00/13] selftests/sgx: Fix compilation errors

2023-11-09 Thread Jo Van Bulck
On 08.11.23 21:46, Dave Hansen wrote: Yes, you've missed something. For your reading pleasure: https://www.kernel.org/doc/html/latest/process/2.Process.html?highlight=merge%20window https://www.kernel.org/doc/html/latest/process/maintainer-tip.html My bad, thank you for pointing out the links

Re: [PATCH v7 00/13] selftests/sgx: Fix compilation errors

2023-11-08 Thread Jo Van Bulck
On 23.10.23 23:32, Jarkko Sakkinen wrote: On Fri Oct 13, 2023 at 2:45 PM EEST, Jo Van Bulck wrote: On 10.10.23 11:44, Jarkko Sakkinen wrote: Folks (sorry for top posting): I've now taken my old NUC7 out of the dust and tested the series :-) Tested-by: Jarkko Sakkinen Thanks for te

Re: [PATCH v7 00/13] selftests/sgx: Fix compilation errors

2023-10-13 Thread Jo Van Bulck
On 10.10.23 14:11, Jarkko Sakkinen wrote: Dave, since there was already sort of talk about detaching this code from kernel tree so that Jo could work on "pure C" runtime would it make sense to dual-license this first in the kernel tree? E.g. Jo could send a patch once this is merged with a new S

Re: [PATCH v7 00/13] selftests/sgx: Fix compilation errors

2023-10-13 Thread Jo Van Bulck
On 10.10.23 11:44, Jarkko Sakkinen wrote: Folks (sorry for top posting): I've now taken my old NUC7 out of the dust and tested the series :-) Tested-by: Jarkko Sakkinen Thanks for testing this Jarkko! Not sure on next steps, do you want me to re-post the series with the Tested-by tag for all

Re: [PATCH v7 00/13] selftests/sgx: Fix compilation errors

2023-10-06 Thread Jo Van Bulck
7;t review the rest patches in this series. One of the reasons is I am not that familiar with the rest. Jarkko has reviewed anyway :-). On Thu, 2023-10-05 at 17:38 +0200, Jo Van Bulck wrote: Hi, This patch series ensures that all SGX selftests succeed when compiling with optimizations (as test

[PATCH v7 13/13] selftests/sgx: Remove incomplete ABI sanitization code in test enclave

2023-10-05 Thread Jo Van Bulck
/ Signed-off-by: Jo Van Bulck Reviewed-by: Jarkko Sakkinen --- .../testing/selftests/sgx/test_encl_bootstrap.S | 16 +++- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/tools/testing/selftests/sgx/test_encl_bootstrap.S b/tools/testing/selftests/sgx

[PATCH v7 10/13] selftests/sgx: Ensure test enclave buffer is entirely preserved

2023-10-05 Thread Jo Van Bulck
-a18060f66...@cs.kuleuven.be/ Signed-off-by: Jo Van Bulck Reviewed-by: Jarkko Sakkinen Acked-by: Kai Huang --- tools/testing/selftests/sgx/defines.h | 1 + tools/testing/selftests/sgx/test_encl.c | 9 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/testing/sel

[PATCH v7 09/13] selftests/sgx: Fix linker script asserts

2023-10-05 Thread Jo Van Bulck
DEFINED only considers symbols, not section names. Hence, replace the check for .got.plt with the _GLOBAL_OFFSET_TABLE_ symbol and remove other (non-essential) asserts. Signed-off-by: Jo Van Bulck Reviewed-by: Jarkko Sakkinen --- tools/testing/selftests/sgx/test_encl.lds | 6 +- 1 file

[PATCH v7 07/13] selftests/sgx: Produce static-pie executable for test enclave

2023-10-05 Thread Jo Van Bulck
enclave assembly entry code. Link: https://lore.kernel.org/all/f9c24d89-ed72-7d9e-c650-050d722c6...@cs.kuleuven.be/ Signed-off-by: Jo Van Bulck Reviewed-by: Jarkko Sakkinen Acked-by: Kai Huang --- tools/testing/selftests/sgx/Makefile | 2 +- tools/testing/selftests/sgx/test_en

[PATCH v7 06/13] selftests/sgx: Remove redundant enclave base address save/restore

2023-10-05 Thread Jo Van Bulck
Remove redundant push/pop pair that stores and restores the enclave base address in the test enclave, as it is never used after the pop and can anyway be easily retrieved via the __encl_base symbol. Signed-off-by: Jo Van Bulck Reviewed-by: Jarkko Sakkinen Acked-by: Kai Huang --- tools/testing

[PATCH v7 02/13] selftests/sgx: Fix uninitialized pointer dereferences in encl_get_entry

2023-10-05 Thread Jo Van Bulck
Test complete changing of page type flow") Signed-off-by: Jo Van Bulck Reviewed-by: Jarkko Sakkinen --- tools/testing/selftests/sgx/load.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/sgx/load.c b/tools/testing/selftests/sgx/load.c index 94

[PATCH v7 08/13] selftests/sgx: Handle relocations in test enclave

2023-10-05 Thread Jo Van Bulck
ca8-2c66-60d1-f9fc-8e6279824...@cs.kuleuven.be/ Link: https://lore.kernel.org/all/5c22de5a-4b3b-1f38-9771-409b4ec7f...@cs.kuleuven.be/#r Signed-off-by: Jo Van Bulck Reviewed-by: Jarkko Sakkinen Acked-by: Kai Huang --- tools/testing/selftests/sgx/test_encl.c | 50 + 1 file ch

[PATCH v7 03/13] selftests/sgx: Include memory clobber for inline asm in test enclave

2023-10-05 Thread Jo Van Bulck
s/sgx: Add test for EPCM permission changes") Signed-off-by: Jo Van Bulck Reviewed-by: Kai Huang Reviewed-by: Jarkko Sakkinen --- tools/testing/selftests/sgx/test_encl.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/sgx/test_encl.c b/too

[PATCH v7 04/13] selftests/sgx: Separate linker options

2023-10-05 Thread Jo Van Bulck
Fixes "'linker' input unused [-Wunused-command-line-argument]" errors when compiling with clang. Signed-off-by: Jo Van Bulck Reviewed-by: Jarkko Sakkinen --- tools/testing/selftests/sgx/Makefile | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff -

[PATCH v7 12/13] selftests/sgx: Discard unsupported ELF sections

2023-10-05 Thread Jo Van Bulck
loader cannot handle. Signed-off-by: Jo Van Bulck Reviewed-by: Jarkko Sakkinen --- tools/testing/selftests/sgx/test_encl.lds | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/sgx/test_encl.lds b/tools/testing/selftests/sgx/test_encl.lds index 333a3e78fdc9..ffe851a1c

[PATCH v7 00/13] selftests/sgx: Fix compilation errors

2023-10-05 Thread Jo Van Bulck
dditional check for NULL pointer (Kai) - Refine to produce proper static-pie executable - Fix linker script assertions - Specify memory clobber for inline asm instead of volatile (Kai) - Clarify why encl_buffer non-static (Jarkko, Kai) - Clarify -ffreestanding (Jarkko) Best, Jo J

[PATCH v7 01/13] selftests/sgx: Fix uninitialized pointer dereference in error path

2023-10-05 Thread Jo Van Bulck
Ensure ctx is zero-initialized, such that the encl_measure function will not call EVP_MD_CTX_destroy with an uninitialized ctx pointer in case of an early error during key generation. Fixes: 2adcba79e69d ("selftests/x86: Add a selftest for SGX") Signed-off-by: Jo Van Bulck Reviewed-

[PATCH v7 05/13] selftests/sgx: Specify freestanding environment for enclave compilation

2023-10-05 Thread Jo Van Bulck
. Still need to instruct the linker from using standard system startup functions, but drop -nostartfiles as it is implied by -nostdlib. Signed-off-by: Jo Van Bulck Reviewed-by: Jarkko Sakkinen Acked-by: Kai Huang --- tools/testing/selftests/sgx/Makefile | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v7 11/13] selftests/sgx: Ensure expected location of test enclave buffer

2023-10-05 Thread Jo Van Bulck
n the linker script to avoid the compiler placing it somewhere else in .data. Signed-off-by: Jo Van Bulck Reviewed-by: Jarkko Sakkinen Acked-by: Kai Huang --- tools/testing/selftests/sgx/defines.h | 1 + tools/testing/selftests/sgx/test_encl.c | 8 tools/testing/selftest

[PATCH v6 00/13] selftests/sgx: Fix compilation errors

2023-09-21 Thread Jo Van Bulck
cutable - Fix linker script assertions - Specify memory clobber for inline asm instead of volatile (Kai) - Clarify why encl_buffer non-static (Jarkko, Kai) - Clarify -ffreestanding (Jarkko) Best, Jo Jo Van Bulck (13): selftests/sgx: Fix uninitialized pointer dereference in error path sel

[PATCH v6 12/13] selftests/sgx: Discard unsupported ELF sections

2023-09-21 Thread Jo Van Bulck
loader cannot handle. Signed-off-by: Jo Van Bulck Reviewed-by: Jarkko Sakkinen --- tools/testing/selftests/sgx/test_encl.lds | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/sgx/test_encl.lds b/tools/testing/selftests/sgx/test_encl.lds index 333a3e78fdc9..ffe851a1c

[PATCH v6 10/13] selftests/sgx: Ensure test enclave buffer is entirely preserved

2023-09-21 Thread Jo Van Bulck
-a18060f66...@cs.kuleuven.be/ Signed-off-by: Jo Van Bulck Reviewed-by: Jarkko Sakkinen Acked-by: Kai Huang --- tools/testing/selftests/sgx/defines.h | 1 + tools/testing/selftests/sgx/test_encl.c | 9 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/testing/sel

[PATCH v6 11/13] selftests/sgx: Ensure expected location of test enclave buffer

2023-09-21 Thread Jo Van Bulck
n the linker script to avoid the compiler placing it somewhere else in .data. Signed-off-by: Jo Van Bulck Reviewed-by: Jarkko Sakkinen Acked-by: Kai Huang --- tools/testing/selftests/sgx/defines.h | 1 + tools/testing/selftests/sgx/test_encl.c | 8 tools/testing/selftest

[PATCH v6 08/13] selftests/sgx: Handle relocations in test enclave

2023-09-21 Thread Jo Van Bulck
ca8-2c66-60d1-f9fc-8e6279824...@cs.kuleuven.be/ Link: https://lore.kernel.org/all/5c22de5a-4b3b-1f38-9771-409b4ec7f...@cs.kuleuven.be/#r Signed-off-by: Jo Van Bulck Reviewed-by: Jarkko Sakkinen Acked-by: Kai Huang --- tools/testing/selftests/sgx/test_encl.c | 50 + 1 file ch

[PATCH v6 05/13] selftests/sgx: Specify freestanding environment for enclave compilation

2023-09-21 Thread Jo Van Bulck
. Still need to instruct the linker from using standard system startup functions, but drop -nostartfiles as it is implied by -nostdlib. Signed-off-by: Jo Van Bulck Reviewed-by: Jarkko Sakkinen Acked-by: Kai Huang --- tools/testing/selftests/sgx/Makefile | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v6 01/13] selftests/sgx: Fix uninitialized pointer dereference in error path

2023-09-21 Thread Jo Van Bulck
Ensure ctx is zero-initialized, such that the encl_measure function will not call EVP_MD_CTX_destroy with an uninitialized ctx pointer in case of an early error during key generation. Fixes: 2adcba79e69d ("selftests/x86: Add a selftest for SGX") Signed-off-by: Jo Van Bulck Reviewed-

[PATCH v6 06/13] selftests/sgx: Remove redundant enclave base address save/restore

2023-09-21 Thread Jo Van Bulck
Remove redundant push/pop pair that stores and restores the enclave base address in the test enclave, as it is never used after the pop and can anyway be easily retrieved via the __encl_base symbol. Signed-off-by: Jo Van Bulck Acked-by: Kai Huang --- tools/testing/selftests/sgx

[PATCH v6 04/13] selftests/sgx: Separate linker options

2023-09-21 Thread Jo Van Bulck
Fixes "'linker' input unused [-Wunused-command-line-argument]" errors when compiling with clang. Signed-off-by: Jo Van Bulck Reviewed-by: Jarkko Sakkinen --- tools/testing/selftests/sgx/Makefile | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff -

[PATCH v6 13/13] selftests/sgx: Remove incomplete ABI sanitization code in test enclave

2023-09-21 Thread Jo Van Bulck
/ Signed-off-by: Jo Van Bulck Reviewed-by: Jarkko Sakkinen --- .../testing/selftests/sgx/test_encl_bootstrap.S | 16 +++- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/tools/testing/selftests/sgx/test_encl_bootstrap.S b/tools/testing/selftests/sgx

[PATCH v6 03/13] selftests/sgx: Include memory clobber for inline asm in test enclave

2023-09-21 Thread Jo Van Bulck
s/sgx: Add test for EPCM permission changes") Signed-off-by: Jo Van Bulck Reviewed-by: Kai Huang Reviewed-by: Jarkko Sakkinen --- tools/testing/selftests/sgx/test_encl.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/sgx/test_encl.c b/too

[PATCH v6 09/13] selftests/sgx: Fix linker script asserts

2023-09-21 Thread Jo Van Bulck
DEFINED only considers symbols, not section names. Hence, replace the check for .got.plt with the _GLOBAL_OFFSET_TABLE_ symbol and remove other (non-essential) asserts. Signed-off-by: Jo Van Bulck Reviewed-by: Jarkko Sakkinen --- tools/testing/selftests/sgx/test_encl.lds | 6 +- 1 file

[PATCH v6 02/13] selftests/sgx: Fix uninitialized pointer dereferences in encl_get_entry

2023-09-21 Thread Jo Van Bulck
Test complete changing of page type flow") Signed-off-by: Jo Van Bulck Reviewed-by: Jarkko Sakkinen --- tools/testing/selftests/sgx/load.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/sgx/load.c b/tools/testing/selftests/sgx/load.c index 94

[PATCH v6 07/13] selftests/sgx: Produce static-pie executable for test enclave

2023-09-21 Thread Jo Van Bulck
enclave assembly entry code. Link: https://lore.kernel.org/all/f9c24d89-ed72-7d9e-c650-050d722c6...@cs.kuleuven.be/ Signed-off-by: Jo Van Bulck Reviewed-by: Jarkko Sakkinen Acked-by: Kai Huang --- tools/testing/selftests/sgx/Makefile | 2 +- tools/testing/selftests/sgx/test_en