linux-sgx.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Dave Hansen <dave.hansen@intel.com>
Cc: linux-sgx@vger.kernel.org,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 1/3] x86/sgx: Use sgx_free_epc_page() in sgx_reclaim_pages()
Date: Mon, 15 Mar 2021 21:06:26 +0200	[thread overview]
Message-ID: <YE+wMvw4YuDKu1xx@kernel.org> (raw)
In-Reply-To: <ab40db7a-234e-b28e-c235-0c720d2d6a5f@intel.com>

On Mon, Mar 15, 2021 at 08:32:13AM -0700, Dave Hansen wrote:
> On 3/13/21 8:01 AM, Jarkko Sakkinen wrote:
> > Replace the ad-hoc code with a sgx_free_epc_page(), in order to make sure
> > that all the relevant checks and book keeping is done, while freeing a
> > borrowed EPC page, and remove redundant code. EREMOVE inside
> > sgx_free_epc_page() does not change the semantics, as EREMOVE to an
> > uninitialize pages is a nop.
> 
>   ^ uninitialized
> 
> I know this is a short patch, but this changelog still falls a bit short
> for me.
> 
> Why is this patch a part of _this_ series?  What *problem* does it
> solve, related to this series?

I'm thinking of merging sgx_epc_section and sgx_numa_node. That's why I
kept it as part of the series. 

Also, in any case it's better to clean up duplicate functionality. The
code is essentially open coded implementation of sgx_free_epc_page()
without EREMOVE.

> It would also be nice to remind me why the EREMOVE is redundant.  Why
> didn't we need one before?  What put the page in the uninitialized
> state?  Is EREMOVE guaranteed to do nothing?  How expensive is it?

EREMOVE gets removed by KVM series from sgx_free_epc_page() anyway.

Maybe should re-send this patch, or series, after KVM series is merged.
Then there is no explaining with EREMOVE, as sgx_free_epc_page() won't
contain it.

/Jarkko

  reply	other threads:[~2021-03-15 19:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-13 16:01 [PATCH v4 0/3] x86/sgx: NUMA Jarkko Sakkinen
2021-03-13 16:01 ` [PATCH v4 1/3] x86/sgx: Use sgx_free_epc_page() in sgx_reclaim_pages() Jarkko Sakkinen
2021-03-15 15:32   ` Dave Hansen
2021-03-15 19:06     ` Jarkko Sakkinen [this message]
2021-03-15 19:27       ` Jarkko Sakkinen
2021-03-16 12:50         ` Jarkko Sakkinen
2021-03-13 16:01 ` [PATCH v4 2/3] x86/sgx: Replace section local dirty page lists with a global list Jarkko Sakkinen
2021-03-15 16:03   ` Dave Hansen
2021-03-15 19:14     ` Jarkko Sakkinen
2021-03-15 19:47       ` Dave Hansen
2021-03-13 16:01 ` [PATCH v4 3/3] x86/sgx: Add a basic NUMA allocation scheme to sgx_alloc_epc_page() Jarkko Sakkinen
2021-03-14 11:56   ` Jarkko Sakkinen
2021-03-15 16:35   ` Dave Hansen
2021-03-15 19:23     ` 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=YE+wMvw4YuDKu1xx@kernel.org \
    --to=jarkko@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --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;
as well as URLs for NNTP newsgroup(s).