Intel SGX development
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Haitao Huang <haitao.huang@linux.intel.com>,
	Dmitrii Kuvaiskii <dmitrii.kuvaiskii@intel.com>,
	dave.hansen@linux.intel.com, jarkko@kernel.org,
	kai.huang@intel.com, reinette.chatre@intel.com,
	linux-sgx@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: mona.vij@intel.com, kailun.qin@intel.com, stable@vger.kernel.org
Subject: Re: [PATCH v3 2/2] x86/sgx: Resolve EREMOVE page vs EAUG page data race
Date: Fri, 7 Jun 2024 10:43:15 -0700	[thread overview]
Message-ID: <1d405428-3847-4862-b146-dd57711c881e@intel.com> (raw)
In-Reply-To: <op.2oszlnlowjvjmi@hhuan26-mobl.amr.corp.intel.com>

On 6/3/24 11:42, Haitao Huang wrote:
>> Second, convince me that this _needs_ a new bit.  Why can't we just have
>> a bit that effectively means "return EBUSY if you see this bit when
>> handling a fault".
> 
> IIUC, reclaimer_writing_to_pcmd() also uses
> SGX_ENCL_PAGE_BEING_RECLAIMED to check if a page is about being
> reclaimed in order to prevent its VA slot fro being freed. So I think we
> do need separate bit for EREMOVE which does not write to VA slot?

I think the bits should be centered around what action the code needs to
take and not what is being done to the page.

Right now, SGX_ENCL_PAGE_BEING_RECLAIMED has two logical meanings:

 1. Don't load the page
 2. The page is in the backing store

But now folks are suggesting that a new bit is added which means "do #1,
but not #2".

Let's take a step back and look at what logical outcomes we want in the
code and then create the bits based on _that_.

  reply	other threads:[~2024-06-07 17:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-17 11:06 [PATCH v3 0/2] x86/sgx: Fix two data races in EAUG/EREMOVE flows Dmitrii Kuvaiskii
2024-05-17 11:06 ` [PATCH v3 1/2] x86/sgx: Resolve EAUG race where losing thread returns SIGBUS Dmitrii Kuvaiskii
2024-05-17 11:06 ` [PATCH v3 2/2] x86/sgx: Resolve EREMOVE page vs EAUG page data race Dmitrii Kuvaiskii
2024-05-28 16:23   ` Dave Hansen
2024-06-03 18:42     ` Haitao Huang
2024-06-07 17:43       ` Dave Hansen [this message]
2024-06-07 17:21     ` Dmitrii Kuvaiskii
2024-05-28 16:01 ` [PATCH v3 0/2] x86/sgx: Fix two data races in EAUG/EREMOVE flows Dave Hansen
2024-06-07 17:47   ` Dmitrii Kuvaiskii

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=1d405428-3847-4862-b146-dd57711c881e@intel.com \
    --to=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=dmitrii.kuvaiskii@intel.com \
    --cc=haitao.huang@linux.intel.com \
    --cc=jarkko@kernel.org \
    --cc=kai.huang@intel.com \
    --cc=kailun.qin@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sgx@vger.kernel.org \
    --cc=mona.vij@intel.com \
    --cc=reinette.chatre@intel.com \
    --cc=stable@vger.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