linux-sgx.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Swap and fault all the pages of the test enclave binary
@ 2021-07-28 22:51 Jarkko Sakkinen
  2021-07-28 22:51 ` [PATCH v2 1/4] x86/sgx: Add /sys/kernel/debug/x86/sgx_total_mem Jarkko Sakkinen
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Jarkko Sakkinen @ 2021-07-28 22:51 UTC (permalink / raw)
  To: Shuah Khan
  Cc: linux-kselftest, linux-sgx, Reinette Chatre, Borislav Petkov,
	Jarkko Sakkinen, Dave Hansen

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 /sys/kernel/debug/x86/sgx_total_mem
  selftests/sgx: Assign source for each segment
  selftests/sgx: Trigger the reclaimer and #PF handler

Tianjia Zhang (1):
  selftests/sgx: Fix calculations for sub-maximum field sizes

 Documentation/x86/sgx.rst               |  6 +++
 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, 117 insertions(+), 36 deletions(-)

-- 
2.32.0


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

end of thread, other threads:[~2021-07-30  0:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-28 22:51 [PATCH v2 0/4] Swap and fault all the pages of the test enclave binary Jarkko Sakkinen
2021-07-28 22:51 ` [PATCH v2 1/4] x86/sgx: Add /sys/kernel/debug/x86/sgx_total_mem Jarkko Sakkinen
2021-07-29 16:27   ` Dave Hansen
2021-07-30  0:59     ` Jarkko Sakkinen
2021-07-28 22:51 ` [PATCH v2 2/4] selftests/sgx: Fix calculations for sub-maximum field sizes Jarkko Sakkinen
2021-07-28 22:51 ` [PATCH v2 3/4] selftests/sgx: Assign source for each segment Jarkko Sakkinen
2021-07-28 22:51 ` [PATCH v2 4/4] selftests/sgx: Trigger the reclaimer and #PF handler Jarkko Sakkinen

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).