linux-sgx.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH] selftests/sgx: Add "test_encl.elf" to TEST_FILES
@ 2023-04-21  3:31 Yi Lai
  2023-04-23  2:33 ` Jarkko Sakkinen
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Yi Lai @ 2023-04-21  3:31 UTC (permalink / raw)
  To: jarkko, dave.hansen, shuah, jethro, bp
  Cc: linux-sgx, linux-kselftest, heng.su, pengfei.xu, Yi Lai

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.

Fixes: 2adcba79e69d ("selftests/x86: Add a selftest for SGX")
Signed-off-by: Yi Lai <yi1.lai@intel.com>
---
 tools/testing/selftests/sgx/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/sgx/Makefile b/tools/testing/selftests/sgx/Makefile
index 75af864e07b6..50aab6b57da3 100644
--- a/tools/testing/selftests/sgx/Makefile
+++ b/tools/testing/selftests/sgx/Makefile
@@ -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
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [RESEND PATCH] selftests/sgx: Add "test_encl.elf" to TEST_FILES
  2023-04-21  3:31 [RESEND PATCH] selftests/sgx: Add "test_encl.elf" to TEST_FILES Yi Lai
@ 2023-04-23  2:33 ` Jarkko Sakkinen
  2023-04-28 12:31 ` Muhammad Usama Anjum
  2023-05-08 17:01 ` Shuah Khan
  2 siblings, 0 replies; 6+ messages in thread
From: Jarkko Sakkinen @ 2023-04-23  2:33 UTC (permalink / raw)
  To: Yi Lai, dave.hansen, shuah, jethro, bp
  Cc: linux-sgx, linux-kselftest, heng.su, pengfei.xu

On Fri Apr 21, 2023 at 6:31 AM EEST, Yi Lai wrote:
> 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.
>
> Fixes: 2adcba79e69d ("selftests/x86: Add a selftest for SGX")
> Signed-off-by: Yi Lai <yi1.lai@intel.com>
> ---
>  tools/testing/selftests/sgx/Makefile | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tools/testing/selftests/sgx/Makefile b/tools/testing/selftests/sgx/Makefile
> index 75af864e07b6..50aab6b57da3 100644
> --- a/tools/testing/selftests/sgx/Makefile
> +++ b/tools/testing/selftests/sgx/Makefile
> @@ -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
> -- 
> 2.25.1

Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>

BR, Jarkko

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RESEND PATCH] selftests/sgx: Add "test_encl.elf" to TEST_FILES
  2023-04-21  3:31 [RESEND PATCH] selftests/sgx: Add "test_encl.elf" to TEST_FILES Yi Lai
  2023-04-23  2:33 ` Jarkko Sakkinen
@ 2023-04-28 12:31 ` Muhammad Usama Anjum
  2023-04-28 13:35   ` Jarkko Sakkinen
  2023-04-29  1:25   ` Lai, Yi1
  2023-05-08 17:01 ` Shuah Khan
  2 siblings, 2 replies; 6+ messages in thread
From: Muhammad Usama Anjum @ 2023-04-28 12:31 UTC (permalink / raw)
  To: Yi Lai, jarkko, dave.hansen, shuah, jethro, bp
  Cc: Muhammad Usama Anjum, linux-sgx, linux-kselftest, heng.su, pengfei.xu

On 4/21/23 8:31 AM, Yi Lai wrote:
> The "test_encl.elf" file used by test_sgx is not installed in
> INSTALL_PATH. Attempting to execute test_sgx causes 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?
> 
> "
> 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.
> 
> Fixes: 2adcba79e69d ("selftests/x86: Add a selftest for SGX")
> Signed-off-by: Yi Lai <yi1.lai@intel.com>
> ---
>  tools/testing/selftests/sgx/Makefile | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/testing/selftests/sgx/Makefile b/tools/testing/selftests/sgx/Makefile
> index 75af864e07b6..50aab6b57da3 100644
> --- a/tools/testing/selftests/sgx/Makefile
> +++ b/tools/testing/selftests/sgx/Makefile
> @@ -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.
>  
>  ifeq ($(CAN_BUILD_X86_64), 1)
>  all: $(TEST_CUSTOM_PROGS) $(OUTPUT)/test_encl.elf

-- 
BR,
Muhammad Usama Anjum

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RESEND PATCH] selftests/sgx: Add "test_encl.elf" to TEST_FILES
  2023-04-28 12:31 ` Muhammad Usama Anjum
@ 2023-04-28 13:35   ` Jarkko Sakkinen
  2023-04-29  1:25   ` Lai, Yi1
  1 sibling, 0 replies; 6+ messages in thread
From: Jarkko Sakkinen @ 2023-04-28 13:35 UTC (permalink / raw)
  To: Muhammad Usama Anjum, Yi Lai, dave.hansen, shuah, jethro, bp
  Cc: linux-sgx, linux-kselftest, heng.su, pengfei.xu

On Fri Apr 28, 2023 at 3:31 PM EEST, Muhammad Usama Anjum wrote:
> On 4/21/23 8:31 AM, Yi Lai wrote:
> > The "test_encl.elf" file used by test_sgx is not installed in
> > INSTALL_PATH. Attempting to execute test_sgx causes 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?

I don't have access right to apply this to tip/x86/sgx.

BR, Jarkko

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RESEND PATCH] selftests/sgx: Add "test_encl.elf" to TEST_FILES
  2023-04-28 12:31 ` Muhammad Usama Anjum
  2023-04-28 13:35   ` Jarkko Sakkinen
@ 2023-04-29  1:25   ` Lai, Yi1
  1 sibling, 0 replies; 6+ messages in thread
From: Lai, Yi1 @ 2023-04-29  1:25 UTC (permalink / raw)
  To: Muhammad Usama Anjum, Yi Lai, jarkko, dave.hansen, shuah, jethro, bp
  Cc: linux-sgx, linux-kselftest, heng.su, pengfei.xu

On 4/28/2023 8:31 PM, Muhammad Usama Anjum wrote:
> On 4/21/23 8:31 AM, Yi Lai wrote:
>> The "test_encl.elf" file used by test_sgx is not installed in
>> INSTALL_PATH. Attempting to execute test_sgx causes 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?
>>
>> "
>> 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.
>>
>> Fixes: 2adcba79e69d ("selftests/x86: Add a selftest for SGX")
>> Signed-off-by: Yi Lai <yi1.lai@intel.com>
>> ---
>>  tools/testing/selftests/sgx/Makefile | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/tools/testing/selftests/sgx/Makefile b/tools/testing/selftests/sgx/Makefile
>> index 75af864e07b6..50aab6b57da3 100644
>> --- a/tools/testing/selftests/sgx/Makefile
>> +++ b/tools/testing/selftests/sgx/Makefile
>> @@ -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.
>> 
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/

>>  ifeq ($(CAN_BUILD_X86_64), 1)
>>  all: $(TEST_CUSTOM_PROGS) $(OUTPUT)/test_encl.elf
> 

Regards,
Yi Lai

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RESEND PATCH] selftests/sgx: Add "test_encl.elf" to TEST_FILES
  2023-04-21  3:31 [RESEND PATCH] selftests/sgx: Add "test_encl.elf" to TEST_FILES Yi Lai
  2023-04-23  2:33 ` Jarkko Sakkinen
  2023-04-28 12:31 ` Muhammad Usama Anjum
@ 2023-05-08 17:01 ` Shuah Khan
  2 siblings, 0 replies; 6+ messages in thread
From: Shuah Khan @ 2023-05-08 17:01 UTC (permalink / raw)
  To: Yi Lai, jarkko, dave.hansen, shuah, jethro, bp
  Cc: linux-sgx, linux-kselftest, heng.su, pengfei.xu, Shuah Khan

On 4/20/23 21:31, Yi Lai wrote:
> 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.
> 
> Fixes: 2adcba79e69d ("selftests/x86: Add a selftest for SGX")
> Signed-off-by: Yi Lai <yi1.lai@intel.com>

Applied now to linux-kselftest fixes for the next rc.

Thank for your the fix.

thanks,
-- Shuah


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-05-08 17:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-21  3:31 [RESEND PATCH] selftests/sgx: Add "test_encl.elf" to TEST_FILES Yi Lai
2023-04-23  2:33 ` Jarkko Sakkinen
2023-04-28 12:31 ` Muhammad Usama Anjum
2023-04-28 13:35   ` Jarkko Sakkinen
2023-04-29  1:25   ` Lai, Yi1
2023-05-08 17:01 ` Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).