Skip to content

selftests/sgx: Trigger the page reclaimer and #PF handler

Jarkko Sakkinen linux-doc linux-kselftest linux-sgx lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 15 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4x86/sgx: Add sgx_nr_all_pages to the debugfsDocumentation/x86/sgx.rst arch/x86/kernel/cpu/sgx/main.c+18 -13 replies
2/4selftests/sgx: Fix Q1 and Q2 calculation in sigstruct.ctools/testing/selftests/sgx/sigstruct.c+21 -202 replies
3/4selftests/sgx: Assign source for each segmenttools/testing/selftests/sgx/load.c tools/testing/selftests/sgx/main.h tools/testing/selftests/sgx/sigstruct.c+8 -60 replies
4/4selftests/sgx: Trigger the reclaimer and #PF handlertools/testing/selftests/sgx/load.c tools/testing/selftests/sgx/main.c tools/testing/selftests/sgx/main.h +1 more+74 -1010 replies

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchDave Hansen
1/4
2/4R-b
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] selftests/sgx: Trigger the page reclaimer and #PF handler

Create a heap for the test enclave, which has the same size as all available Enclave Page Cache (EPC) pages in the system. This will guarantee that all test_encl.elf pages *and* SGX Enclave Control Structure (SECS) have been swapped out by the page reclaimer during the load time. Actually, this adds a bit more stress than that since part of the EPC gets reserved for the Version Array (VA) pages.

For each test, the page fault handler gets triggered in two occasions:

- When SGX_IOC_ENCLAVE_INIT is performed, SECS gets swapped in by the page fault handler.
- During the execution, each page that is referenced gets swapped in by the page fault handler.

Jarkko Sakkinen (3):
x86/sgx: Add sgx_nr_all_pages to the debugfs selftests/sgx: Assign source for each segment selftests/sgx: Trigger the reclaimer and #PF handler

Tianjia Zhang (1):
selftests/sgx: Fix Q1 and Q2 calculation in sigstruct.c

 Documentation/x86/sgx.rst               |  9 +++++
 arch/x86/kernel/cpu/sgx/main.c          | 10 ++++-
 tools/testing/selftests/sgx/load.c      | 38 ++++++++++++++----
 tools/testing/selftests/sgx/main.c      | 42 +++++++++++++++++++-
 tools/testing/selftests/sgx/main.h      |  4 +-
 tools/testing/selftests/sgx/sigstruct.c | 53 +++++++++++++------------
 6 files changed, 120 insertions(+), 36 deletions(-)
Signature · 1 line
2.32.0