linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Shuah Khan <shuah@kernel.org>
Cc: linux-kselftest@vger.kernel.org, linux-sgx@vger.kernel.org,
	Reinette Chatre <reinette.chatre@intel.com>,
	Borislav Petkov <bp@alien8.de>,
	Jarkko Sakkinen <jarkko@kernel.org>,
	Dave Hansen <dave.hansen@linux.intel.com>
Subject: [PATCH 0/4] selftests/sgx: Trigger the page reclaimer and #PF handler
Date: Mon,  5 Jul 2021 17:36:48 +0300	[thread overview]
Message-ID: <20210705143652.116125-1-jarkko@kernel.org> (raw)

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

-- 
2.32.0


             reply	other threads:[~2021-07-05 14:36 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-05 14:36 Jarkko Sakkinen [this message]
2021-07-05 14:36 ` [PATCH 1/4] x86/sgx: Add sgx_nr_all_pages to the debugfs Jarkko Sakkinen
2021-07-06 14:56   ` Dave Hansen
2021-07-06 15:39     ` Greg KH
2021-07-06 22:08     ` Jarkko Sakkinen
2021-07-05 14:36 ` [PATCH 2/4] selftests/sgx: Fix Q1 and Q2 calculation in sigstruct.c Jarkko Sakkinen
2021-07-06 20:53   ` Dave Hansen
2021-07-06 23:52     ` Jarkko Sakkinen
2021-07-05 14:36 ` [PATCH 3/4] selftests/sgx: Assign source for each segment Jarkko Sakkinen
2021-07-05 14:36 ` [PATCH 4/4] selftests/sgx: Trigger the reclaimer and #PF handler Jarkko Sakkinen
2021-07-06 18:34   ` Reinette Chatre
2021-07-06 23:50     ` Jarkko Sakkinen
2021-07-07  0:10       ` Reinette Chatre
2021-07-07  9:17         ` Jarkko Sakkinen
2021-07-07 15:02           ` Reinette Chatre
2021-07-07 20:50             ` Jarkko Sakkinen
2021-07-07 21:20               ` Reinette Chatre
2021-07-09 16:22                 ` Jarkko Sakkinen
2021-07-07 21:20               ` Dave Hansen
2021-07-09 16:25                 ` Jarkko Sakkinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210705143652.116125-1-jarkko@kernel.org \
    --to=jarkko@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-sgx@vger.kernel.org \
    --cc=reinette.chatre@intel.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).