selftests/sgx: Add "test_encl.elf" to TEST_FILES
PATCH RESEND 1/1 selftests/sgx: Add "test_encl.elf" to TEST_FILES
The "test_encl.elf" file used by test_sgx is not installed in INSTALL_PATH. Attempting to execute test_sgx causes false negative:
"
enclave executable open(): No such file or directory main.c:188:unclobbered_vdso:Failed to load the test enclave. "
Add "test_encl.elf" to TEST_FILES so that it will be installed.
--- tools/testing/selftests/sgx/Makefile | 1 + 1 file changed, 1 insertion(+)
tools/testing/selftests/sgx/Makefile +1 -0
@@ -17,6 +17,7 @@ ENCL_CFLAGS := -Wall -Werror -static -nostdlib -nostartfiles -fPIC \ -fno-stack-protector -mrdrnd $(INCLUDES) TEST_CUSTOM_PROGS := $(OUTPUT)/test_sgx +TEST_FILES := $(OUTPUT)/test_encl.elf ifeq ($(CAN_BUILD_X86_64), 1) all: $(TEST_CUSTOM_PROGS) $(OUTPUT)/test_encl.elf
Signature · 1 line
2.25.1
Quoted 30 lines · Yi Lai
The "test_encl.elf" file used by
test_sgxis not installed inINSTALL_PATH. Attempting to executetest_sgxcauses false negative:"
enclave executableopen(): No such file or directory main.c:188:unclobbered_vdso:Failed to load the test enclave. "Add "test_encl.elf" to
TEST_FILESso that it will be installed.Fixes 2adcba79e69d ("selftests/x86: Add a selftest for SGX")Signed-off-by Yi Lai <[email protected]>--- tools/testing/selftests/sgx/Makefile | 1 + 1 file changed, 1 insertion(+)tools/testing/selftests/sgx/Makefile +1
-0@@ -17,6 +17,7 @@ ENCL_CFLAGS := -Wall -Werror -static -nostdlib -nostartfiles -fPIC \ -fno-stack-protector -mrdrnd $(INCLUDES) TEST_CUSTOM_PROGS := $(OUTPUT)/test_sgx +TEST_FILES := $(OUTPUT)/test_encl.elf ifeq ($(CAN_BUILD_X86_64), 1) all: $(TEST_CUSTOM_PROGS) $(OUTPUT)/test_encl.elfSignature · 1 line
2.25.1
BR, Jarkko
Quoted 2 lines · Yi Lai
The "test_encl.elf" file used by
test_sgxis not installed inINSTALL_PATH. Attempting to executetest_sgxcauses false negative:
I've ran the following on next-20230427:
make -C tools/testing/selftests O=build2 -j nproc
find | grep test_encl.elf
./build2/kselftest/sgx/test_encl.elf
test_encl.elf is being copied already. Am i missing something?
Quoted 19 lines
"
enclave executableopen(): No such file or directory main.c:188:unclobbered_vdso:Failed to load the test enclave. "Add "test_encl.elf" to
TEST_FILESso that it will be installed.Fixes 2adcba79e69d ("selftests/x86: Add a selftest for SGX")Signed-off-by Yi Lai <[email protected]>--- tools/testing/selftests/sgx/Makefile | 1 + 1 file changed, 1 insertion(+)tools/testing/selftests/sgx/Makefile +0
-0
tools/testing/selftests/sgx/Makefile ENCL_CFLAGS := -Wall -Werror -static -nostdlib -nostartfiles -fPIC \ · line 20
Quoted 4 lines
tools/testing/selftests/sgx/Makefile +1
-0@@ -17,6 +17,7 @@ ENCL_CFLAGS := -Wall -Werror -static -nostdlib -nostartfiles -fPIC \ -fno-stack-protector -mrdrnd $(INCLUDES) TEST_CUSTOM_PROGS := $(OUTPUT)/test_sgx +TEST_FILES := $(OUTPUT)/test_encl.elf
I think this isn't needed just like sign_key.o is being copied already. test_encl.elf is being copied.
Quoted 3 lines
tools/testing/selftests/sgx/Makefile +0
-0ifeq ($(CAN_BUILD_X86_64), 1) all: $(TEST_CUSTOM_PROGS) $(OUTPUT)/test_encl.elf
Signature · 2 lines
BR, Muhammad Usama Anjum
Jarkko Sakkinen
maintainerQuoted 10 lines · Muhammad Usama Anjum
Quoted 2 lines · Yi Lai
The "test_encl.elf" file used by
test_sgxis not installed inINSTALL_PATH. Attempting to executetest_sgxcauses false negative:I've ran the following on next-20230427:
make -Ctools/testing/selftestsO=build2 -jnprocfind | grep test_encl.elf
./build2/kselftest/sgx/test_encl.elftest_encl.elf is being copied already. Am i missing something?
I don't have access right to apply this to tip/x86/sgx.
BR, Jarkko
Quoted 31 lines · Muhammad Usama Anjum
Quoted 2 lines · Yi Lai
The "test_encl.elf" file used by
test_sgxis not installed inINSTALL_PATH. Attempting to executetest_sgxcauses false negative:I've ran the following on next-20230427:
make -Ctools/testing/selftestsO=build2 -jnprocfind | grep test_encl.elf
./build2/kselftest/sgx/test_encl.elftest_encl.elf is being copied already. Am i missing something?
Quoted 21 lines
"
enclave executableopen(): No such file or directory main.c:188:unclobbered_vdso:Failed to load the test enclave. "Add "test_encl.elf" to
TEST_FILESso that it will be installed.Fixes 2adcba79e69d ("selftests/x86: Add a selftest for SGX")Signed-off-by Yi Lai <[email protected]>--- tools/testing/selftests/sgx/Makefile | 1 + 1 file changed, 1 insertion(+)tools/testing/selftests/sgx/Makefile +0
-0@@ -17,6 +17,7 @@ ENCL_CFLAGS := -Wall -Werror -static -nostdlib -nostartfiles -fPIC \ -fno-stack-protector -mrdrnd $(INCLUDES)
Quoted 5 lines
tools/testing/selftests/sgx/Makefile ENCL_CFLAGS := -Wall -Werror -static -nostdlib -nostartfiles -fPIC \ · line 20
Quoted 2 lines
tools/testing/selftests/sgx/Makefile +1
-0TEST_CUSTOM_PROGS := $(OUTPUT)/test_sgx +TEST_FILES := $(OUTPUT)/test_encl.elfI think this isn't needed just like sign_key.o is being copied already. test_encl.elf is being copied.
Quoted 1 line
Hi,
When using tools/testing/selftests/kselftest_install.sh
test_encl.elf can be built but not copied to tools/testing/selftests/kselftest_install/sgx/
Quoted 3 lines
Quoted 2 lines
ifeq ($(CAN_BUILD_X86_64), 1)
all: $(TEST_CUSTOM_PROGS) $(OUTPUT)/test_encl.elf
Regards,
Yi Lai
Shuah Khan
maintainerQuoted 8 lines · Yi Lai
The "test_encl.elf" file used by
test_sgxis not installed inINSTALL_PATH. Attempting to executetest_sgxcauses false negative:"
enclave executableopen(): No such file or directory main.c:188:unclobbered_vdso:Failed to load the test enclave. "
Quoted 4 lines
Add "test_encl.elf" to
TEST_FILESso that it will be installed.Fixes 2adcba79e69d ("selftests/x86: Add a selftest for SGX")Signed-off-by Yi Lai <[email protected]>
Applied now to linux-kselftest fixes for the next rc.
Thank for your the fix.
thanks,
-- Shuah