Skip to content

selftests/x86/sgx: Improve tests

Sean Christopherson linux-sgx 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest14 patches 9 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14selftests/x86/sgx: Fix a benign linker warningtools/testing/selftests/x86/sgx/Makefile+1 -10 replies
2/14selftests/x86/sgx: Use getauxval() to retrieve the vDSO base addresstools/testing/selftests/x86/sgx/main.c+5 -160 replies
3/14selftests/x86/sgx: Sanitize the types for sgx_vdso_call()'s input paramstools/testing/selftests/x86/sgx/main.c tools/testing/selftests/x86/sgx/sgx_call.h+3 -20 replies
4/14selftests/x86/sgx: Mark helper functions as statictools/testing/selftests/x86/sgx/main.c+3 -30 replies
5/14selftests/x86/sgx: Move vDSO setup to a helper functiontools/testing/selftests/x86/sgx/main.c+26 -150 replies
6/14selftests/x86/sgx: Move individual tests into helper functionstools/testing/selftests/x86/sgx/main.c+36 -230 replies
7/14selftests/x86/sgx: Use standard helper function to signal pass/failtools/testing/selftests/x86/sgx/main.c+12 -130 replies
8/14selftests/harness: Move operator macros to their own header fileDocumentation/dev-tools/kselftest.rst MAINTAINERS tools/testing/selftests/kselftest_harness.h +1 more+259 -2524 replies
9/14selftests/x86/sgx: Use kselftest operators to check test resultstools/testing/selftests/x86/sgx/main.c+40 -120 replies
10/14selftests/x86/sgx: Handle setup failures via kselftest assertionstools/testing/selftests/x86/sgx/main.c+58 -1160 replies
11/14selftests/x86/sgx: Add a check on the vDSO exception reporting mechanismtools/testing/selftests/x86/sgx/defines.h tools/testing/selftests/x86/sgx/main.c+10 -00 replies
12/14selftests/x86/sgx: Add test of vDSO with basic exit handlertools/testing/selftests/x86/sgx/main.c+27 -10 replies
13/14selftests/x86/sgx: Add check to verify exit handler stack alignmenttools/testing/selftests/x86/sgx/defines.h tools/testing/selftests/x86/sgx/main.c+18 -30 replies
14/14selftests/x86/sgx: Add test for exception behavior with exit handlertools/testing/selftests/x86/sgx/defines.h tools/testing/selftests/x86/sgx/main.c+93 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH for_v2? v2 00/14] selftests/x86/sgx: Improve tests

The bulk of this series is comprised of the selftest portion of the vDSO cleanup[*]. The big difference from the full vDSO series is to reuse as much of the existing selftest code as possible. There is still a bit of homebrew code in defining the low level assertion macro, but much less so than in the previous from-scratch version.

Cc'd Andy, who also happens to be a reviewer for the harness code, on the off chance he has bandwidth to weigh in.

Tagged for_v2? to make it clear that this doesn't need to be rushed into v23.

Passing case:

TAP version 13
1..4
ok 1 test_sgx_basic: Passed
ok 2 test_sgx_vdso: Passed
ok 3 test_sgx_vdso_exit_handler: Passed
ok 4 test_sgx_vdso_exception_handler: Passed
# Pass 4 Fail 0 Xfail 0 Xpass 0 Skip 0 Error 0

Failing case:

TAP version 13
1..4
not ok 1 Expected 'result (1234605616436508552) != MAGIC (1234605616436508552)' at main.c:324 ok 2 test_sgx_vdso: Passed
ok 3 test_sgx_vdso_exit_handler: Passed
ok 4 test_sgx_vdso_exception_handler: Passed
# Pass 3 Fail 1 Xfail 0 Xpass 0 Skip 0 Error 0

[*] https://patchwork.kernel.org/cover/11178771/

Sean Christopherson (14):
selftests/x86/sgx: Fix a benign linker warning selftests/x86/sgx: Use getauxval() to retrieve the vDSO base address selftests/x86/sgx: Sanitize the types for sgx_vdso_call()'s input
params
selftests/x86/sgx: Mark helper functions as static selftests/x86/sgx: Move vDSO setup to a helper function selftests/x86/sgx: Move individual tests into helper functions selftests/x86/sgx: Use standard helper function to signal pass/fail selftests/harness: Move operator macros to their own header file selftests/x86/sgx: Use kselftest operators to check test results selftests/x86/sgx: Handle setup failures via kselftest assertions selftests/x86/sgx: Add a check on the vDSO exception reporting
mechanism
selftests/x86/sgx: Add test of vDSO with basic exit handler selftests/x86/sgx: Add check to verify exit handler stack alignment selftests/x86/sgx: Add test for exception behavior with exit handler

 Documentation/dev-tools/kselftest.rst         |   9 +-
 MAINTAINERS                                   |   1 +
 tools/testing/selftests/kselftest_harness.h   | 246 +---------
 tools/testing/selftests/kselftest_operators.h | 255 +++++++++++
 tools/testing/selftests/x86/sgx/Makefile      |   2 +-
 tools/testing/selftests/x86/sgx/defines.h     |   7 +
 tools/testing/selftests/x86/sgx/main.c        | 426 +++++++++++-------
 tools/testing/selftests/x86/sgx/sgx_call.h    |   3 +-
 8 files changed, 541 insertions(+), 408 deletions(-)
 create mode 100644 tools/testing/selftests/kselftest_operators.h
Signature · 1 line
2.22.0