linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Reinette Chatre <reinette.chatre@intel.com>
To: Jarkko Sakkinen <jarkko@kernel.org>, <tony.luck@intel.com>,
	<dave.hansen@linux.intel.com>, <tglx@linutronix.de>,
	<bp@alien8.de>, <luto@kernel.org>, <mingo@redhat.com>,
	<linux-sgx@vger.kernel.org>, <x86@kernel.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86/sgx: Add poison handling to reclaimer
Date: Thu, 20 Jan 2022 07:28:56 -0800	[thread overview]
Message-ID: <38beed54-cd15-3178-8b73-1c029ba05f68@intel.com> (raw)
In-Reply-To: <80083e5ca3fd0a5bd2de43ebc803fc914d09ac3c.camel@kernel.org>

Hi Jarkko,

On 1/20/2022 4:57 AM, Jarkko Sakkinen wrote:
> On Tue, 2022-01-18 at 15:05 -0800, Reinette Chatre wrote:
>> The machine check recovery handling in SGX added the changes
>> listed below to the freeing of pages in sgx_free_epc_page().
>> The SGX reclaimer contains an open coded version of
>> sgx_free_epc_page() and thus did not obtain the changes in
>> support of poison handling.
>>
>> The changes made to EPC page freeing in support of poison handling
>> are:
>> 1) A new SGX_EPC_PAGE_IS_FREE flag is set when the EPC page is
>>    freed. Introduced in commit d6d261bded8a ("x86/sgx: Add new
>>    sgx_epc_page flag bit to mark free pages").
>> 2) A new "poison" field in struct sgx_epc_page is used to
>>    determine whether a newly freed EPC page should be placed
>>    on the list of poisoned or list of free pages. Introduced
>>    in commit 992801ae9243 ("x86/sgx: Initial poison handling
>>    for dirty and free pages").
>> 3) The owner field in struct sgx_epc_page is cleared when the EPC
>>    page is freed.  Introduced in commit 992801ae9243 ("x86/sgx:
>>    Initial poison handling for dirty and free pages").
>>
>> Replace the open coded enclave page freeing code in the reclaimer
>> with sgx_free_epc_page() to obtain support for poison page handling.
>>
>> Fixes: d6d261bded8a ("x86/sgx: Add new sgx_epc_page flag bit to mark
>> free pages")
> 
> AFAIK, this patch does not semantically break anything so it is not
> a legit fixes tag.
> 

The commit you refer to, commit d6d261bded8a ("x86/sgx: Add new
sgx_epc_page flag bit to mark free pages", introduced a new page flag bit
(SGX_EPC_PAGE_IS_FREE) that should be set when an EPC page is freed. The
commit also sets the bit in sgx_free_epc_page() when an EPC page is freed.
The commit should also have set that bit when the EPC page is freed in the
reclaimer, which contains an open coded version of sgx_free_epc_page(),
but it did not. This fix adds the snippet that was omitted from that
commit.

Reinette

      reply	other threads:[~2022-01-20 15:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-18 23:05 [PATCH] x86/sgx: Add poison handling to reclaimer Reinette Chatre
2022-01-19 19:51 ` Dave Hansen
2022-01-19 20:47   ` Reinette Chatre
2022-01-19 20:56     ` Dave Hansen
2022-01-20 12:57 ` Jarkko Sakkinen
2022-01-20 15:28   ` Reinette Chatre [this message]

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=38beed54-cd15-3178-8b73-1c029ba05f68@intel.com \
    --to=reinette.chatre@intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=jarkko@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sgx@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --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).