[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210318174032.GI19570@zn.tnic>
Date: Thu, 18 Mar 2021 18:40:32 +0100
From: Borislav Petkov <bp@...en8.de>
To: Jarkko Sakkinen <jarkko.sakkinen@...el.com>
Cc: linux-sgx@...r.kernel.org, Jarkko Sakkinen <jarkko@...nel.org>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] x86/sgx: Replace section->init_laundry_list with
sgx_dirty_page_list
On Thu, Mar 18, 2021 at 01:53:30AM +0200, Jarkko Sakkinen wrote:
> From: Jarkko Sakkinen <jarkko@...nel.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@...nel.org>
> Acked-by: Dave Hansen <dave.hansen@...ux.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
Powered by blists - more mailing lists