From: Borislav Petkov <bp@alien8.de>
To: Jarkko Sakkinen <jarkko.sakkinen@intel.com>
Cc: linux-sgx@vger.kernel.org, Jarkko Sakkinen <jarkko@kernel.org>,
Dave Hansen <dave.hansen@linux.intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] x86/sgx: Replace section->init_laundry_list with sgx_dirty_page_list
Date: Thu, 18 Mar 2021 18:40:32 +0100 [thread overview]
Message-ID: <20210318174032.GI19570@zn.tnic> (raw)
In-Reply-To: <20210317235332.362001-1-jarkko.sakkinen@intel.com>
On Thu, Mar 18, 2021 at 01:53:30AM +0200, Jarkko Sakkinen wrote:
> From: Jarkko Sakkinen <jarkko@kernel.org>
>
> During normal runtime, the "ksgxd" daemon behaves like a version of
> kswapd just for SGX. But, before it starts acting like kswapd, its
> first job is to initialize enclave memory.
>
> Currently, the SGX boot code places each enclave page on a
> epc_section->init_laundry_list. Once it starts up, the ksgxd code walks
> over that list and populates the actual SGX page allocator.
>
> However, the per-section structures are going away to make way for the SGX
> NUMA allocator. There's also little need to have a per-section structure;
> the enclave pages are all treated identically, and they can be placed on
> the correct allocator list from metadata stored in the enclave page
> (struct sgx_epc_page) itself.
>
> Modify sgx_sanitize_section() to take a single page list instead of taking
> a section and deriving the list from there.
>
> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
> Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
> ---
>
> v5
> * Refine the commit message.
> * Refine inline comments.
> * Encapsulate a sanitization pass into __sgx_sanitize_pages().
>
> v4:
> * Open coded sgx_santize_section() to ksgxd().
> * Rewrote the commit message.
>
> arch/x86/kernel/cpu/sgx/main.c | 54 ++++++++++++++++------------------
> arch/x86/kernel/cpu/sgx/sgx.h | 7 -----
> 2 files changed, 25 insertions(+), 36 deletions(-)
So both patches look ok to me but the sgx test case fails on -rc3 with and
without those patches on my box:
./test_sgx
0x0000000000000000 0x0000000000002000 0x03
0x0000000000002000 0x0000000000001000 0x05
0x0000000000003000 0x0000000000003000 0x03
mmap() failed, errno=1.
Box is:
[ 0.138402] smpboot: CPU0: Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz (family: 0x6, model: 0x9e, stepping: 0xc)
[ 0.693947] sgx: EPC section 0x80200000-0x85ffffff
And AFAIR that test used to pass there...
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
next prev parent reply other threads:[~2021-03-18 17:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-17 23:53 [PATCH 1/2] x86/sgx: Replace section->init_laundry_list with sgx_dirty_page_list Jarkko Sakkinen
2021-03-17 23:53 ` [PATCH 2/2] x86/sgx: Add a basic NUMA allocation scheme to sgx_alloc_epc_page() Jarkko Sakkinen
2021-03-18 19:05 ` [tip: x86/sgx] " tip-bot2 for Jarkko Sakkinen
2021-03-19 8:57 ` tip-bot2 for Jarkko Sakkinen
2021-03-18 17:40 ` Borislav Petkov [this message]
2021-03-18 18:34 ` [PATCH 1/2] x86/sgx: Replace section->init_laundry_list with sgx_dirty_page_list Dave Hansen
2021-03-18 19:01 ` Borislav Petkov
2021-03-18 19:28 ` Jarkko Sakkinen
2021-03-18 19:05 ` [tip: x86/sgx] " tip-bot2 for 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=20210318174032.GI19570@zn.tnic \
--to=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jarkko.sakkinen@intel.com \
--cc=jarkko@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sgx@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@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