From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Sean Christopherson <sean.j.christopherson@intel.com>
Cc: linux-sgx@vger.kernel.org
Subject: Re: [PATCH for_v23 2/3] x86/sgx: Do not add in-use EPC page to the free page list
Date: Wed, 23 Oct 2019 15:43:40 +0300 [thread overview]
Message-ID: <20191023124340.GG23733@linux.intel.com> (raw)
In-Reply-To: <20191022224922.28144-3-sean.j.christopherson@intel.com>
On Tue, Oct 22, 2019 at 03:49:21PM -0700, Sean Christopherson wrote:
> Don't add an EPC page to the free page list of EREMOVE fails, as doing
> so will cause any future attempt to use the EPC page to fail, and likely
> WARN as well.
>
> Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
> ---
> arch/x86/kernel/cpu/sgx/main.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/cpu/sgx/main.c b/arch/x86/kernel/cpu/sgx/main.c
> index d45bf6fca0c8..8e7557d3ff03 100644
> --- a/arch/x86/kernel/cpu/sgx/main.c
> +++ b/arch/x86/kernel/cpu/sgx/main.c
> @@ -138,7 +138,8 @@ int sgx_free_page(struct sgx_epc_page *page)
> spin_unlock(&sgx_active_page_list_lock);
>
> ret = __eremove(sgx_epc_addr(page));
> - WARN_ONCE(ret, "EREMOVE returned %d (0x%x)", ret, ret);
> + if (WARN_ONCE(ret, "EREMOVE returned %d (0x%x)", ret, ret))
> + return -EIO;
How did you end up choosing -EIO? Don't immediately have any better
suggestion but neither sure if that is the best choice. That is why I'm
asking.
/Jarkko
next prev parent reply other threads:[~2019-10-23 12:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-22 22:49 [PATCH for_v23 0/3] x86/sgx: More cleanup for v23 Sean Christopherson
2019-10-22 22:49 ` [PATCH for_v23 1/3] x86/sgx: Update the free page count in a single operation Sean Christopherson
2019-10-23 12:44 ` Jarkko Sakkinen
2019-10-24 13:11 ` Jarkko Sakkinen
2019-10-22 22:49 ` [PATCH for_v23 2/3] x86/sgx: Do not add in-use EPC page to the free page list Sean Christopherson
2019-10-23 12:43 ` Jarkko Sakkinen [this message]
2019-10-23 15:23 ` Sean Christopherson
2019-10-22 22:49 ` [PATCH for_v23 3/3] x86/sgx: Move reclaim logic out of sgx_free_page() Sean Christopherson
2019-10-23 12:42 ` Jarkko Sakkinen
2019-10-23 15:19 ` Sean Christopherson
2019-10-24 18:35 ` [PATCH for_v23 0/3] x86/sgx: More cleanup for v23 Jarkko Sakkinen
2019-10-24 20:22 ` Sean Christopherson
2019-10-28 20:35 ` 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=20191023124340.GG23733@linux.intel.com \
--to=jarkko.sakkinen@linux.intel.com \
--cc=linux-sgx@vger.kernel.org \
--cc=sean.j.christopherson@intel.com \
/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).