public inbox for linux-sgx@vger.kernel.org
 help / color / mirror / Atom feed
From: "Huang, Kai" <kai.huang@intel.com>
To: Dmitrii Kuvaiskii <dmitrii.kuvaiskii@intel.com>,
	<dave.hansen@linux.intel.com>, <jarkko@kernel.org>,
	<haitao.huang@linux.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 v4 1/3] x86/sgx: Split SGX_ENCL_PAGE_BEING_RECLAIMED into two flags
Date: Thu, 25 Jul 2024 14:00:59 +1200	[thread overview]
Message-ID: <35441491-99cf-403b-9e64-9d7b0453e59e@intel.com> (raw)
In-Reply-To: <20240705074524.443713-2-dmitrii.kuvaiskii@intel.com>



On 5/07/2024 7:45 pm, Dmitrii Kuvaiskii wrote:
> SGX_ENCL_PAGE_BEING_RECLAIMED flag is set when the enclave page is being
> reclaimed (moved to the backing store). This flag however has two
> logical meanings:
> 
> 1. Don't attempt to load the enclave page (the page is busy).
> 2. Don't attempt to remove the PCMD page corresponding to this enclave
>     page (the PCMD page is busy).

Nit:

I think the SGX_ENCL_PAGE_PCMD_BUSY isn't that accurate, because 
obviously the actual backing page is busy (i.e., cannot be truncated) 
too.  So the current SGX_ENCL_PAGE_BEING_RECLAIMED is also fine to me.

But truncating the actual backing page can also be determined by 
SGX_ENCL_PAGE_PCMD_BUSY I suppose (if needed in the future), so this 
looks fine to me too.

> 
> To reflect these two meanings, split SGX_ENCL_PAGE_BEING_RECLAIMED into
> two flags: SGX_ENCL_PAGE_BUSY and SGX_ENCL_PAGE_PCMD_BUSY. Currently,
> both flags are set only when the enclave page is being reclaimed. A
> future commit will introduce a new case when the enclave page is being
> removed; this new case will set only the SGX_ENCL_PAGE_BUSY flag.

As replied to the last patch, IIUC EREMOVE ioctl doesn't seem to be the 
only case where the BUSY needs to be marked, so let's just say something 
general but not mention the removal case specifically.

Anyway, feel free to add:

Acked-by: Kai Huang <kai.huang@intel.com>

  parent reply	other threads:[~2024-07-25  2:01 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-05  7:45 [PATCH v4 0/3] x86/sgx: Fix two data races in EAUG/EREMOVE flows Dmitrii Kuvaiskii
2024-07-05  7:45 ` [PATCH v4 1/3] x86/sgx: Split SGX_ENCL_PAGE_BEING_RECLAIMED into two flags Dmitrii Kuvaiskii
2024-07-10 15:15   ` Haitao Huang
2024-07-17 10:36   ` Jarkko Sakkinen
2024-08-12  8:12     ` Dmitrii Kuvaiskii
2024-08-15 18:29       ` Jarkko Sakkinen
2024-07-17 10:37   ` Jarkko Sakkinen
2024-08-12  8:16     ` Dmitrii Kuvaiskii
2024-08-15 18:30       ` Jarkko Sakkinen
2024-07-25  2:00   ` Huang, Kai [this message]
2024-07-05  7:45 ` [PATCH v4 2/3] x86/sgx: Resolve EAUG race where losing thread returns SIGBUS Dmitrii Kuvaiskii
2024-07-17 10:38   ` Jarkko Sakkinen
2024-08-12  8:21     ` Dmitrii Kuvaiskii
2024-08-15 18:31       ` Jarkko Sakkinen
2024-07-25  0:52   ` Huang, Kai
2024-07-05  7:45 ` [PATCH v4 3/3] x86/sgx: Resolve EREMOVE page vs EAUG page data race Dmitrii Kuvaiskii
2024-07-10 15:16   ` Haitao Huang
2024-07-17 10:38   ` Jarkko Sakkinen
2024-08-12  8:25     ` Dmitrii Kuvaiskii
2024-08-15 18:34       ` Jarkko Sakkinen
2024-08-15 18:37         ` Jarkko Sakkinen
2024-07-25  1:21   ` Huang, Kai
2024-08-09  9:35     ` Dmitrii Kuvaiskii
2024-08-09 11:19       ` Huang, Kai
2024-08-12  8:32         ` Dmitrii Kuvaiskii
2024-08-12 10:34           ` Huang, Kai
2024-07-05  9:03 ` [PATCH v4 0/3] x86/sgx: Fix two data races in EAUG/EREMOVE flows 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=35441491-99cf-403b-9e64-9d7b0453e59e@intel.com \
    --to=kai.huang@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=dmitrii.kuvaiskii@intel.com \
    --cc=haitao.huang@linux.intel.com \
    --cc=jarkko@kernel.org \
    --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