diff mbox series

[RFC,v2,02/26] x86/sgx: Remove a warn from sgx_free_epc_page()

Message ID 85da2c1ce068b77ee9f31f6de9f3a34c36c410eb.1610935432.git.kai.huang@intel.com (mailing list archive)
State New, archived
Headers show
Series KVM SGX virtualization support | expand

Commit Message

Huang, Kai Jan. 18, 2021, 3:26 a.m. UTC
From: "jarkko@kernel.org" <jarkko@kernel.org>

Remove SGX_EPC_PAGE_RECLAIMER_TRACKED check and warning.  This cannot
happen, as enclave pages are freed only at the time when encl->refcount
triggers, i.e. when both VFS and the page reclaimer have given up on
their references.

Signed-off-by: jarkko@kernel.org <jarkko@kernel.org>
Signed-off-by: Kai Huang <kai.huang@intel.com>
---
 arch/x86/kernel/cpu/sgx/main.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Jarkko Sakkinen Jan. 19, 2021, 8:32 a.m. UTC | #1
On Mon, Jan 18, 2021 at 04:26:50PM +1300, Kai Huang wrote:
> From: "jarkko@kernel.org" <jarkko@kernel.org>
        ~~~~~~~~~~~~~~~~~~~
        Jarkko Sakkinen

> Remove SGX_EPC_PAGE_RECLAIMER_TRACKED check and warning.  This cannot
> happen, as enclave pages are freed only at the time when encl->refcount
> triggers, i.e. when both VFS and the page reclaimer have given up on
> their references.
> 
> Signed-off-by: jarkko@kernel.org <jarkko@kernel.org>
                 ~~~~~~~~~~~~~~~~~
                 Jarkko Sakkinen

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

Sorry about this. I was reconfiguring my environment (or actually was
moving it to another machine), and forgot to set user.name. I'll send you
in private replacements with a legit name.

/Jarkko
Huang, Kai Jan. 20, 2021, 12:42 a.m. UTC | #2
On Tue, 2021-01-19 at 10:32 +0200, Jarkko Sakkinen wrote:
> On Mon, Jan 18, 2021 at 04:26:50PM +1300, Kai Huang wrote:
> > From: "jarkko@kernel.org" <jarkko@kernel.org>
>         ~~~~~~~~~~~~~~~~~~~
>         Jarkko Sakkinen
> 
> > Remove SGX_EPC_PAGE_RECLAIMER_TRACKED check and warning.  This cannot
> > happen, as enclave pages are freed only at the time when encl->refcount
> > triggers, i.e. when both VFS and the page reclaimer have given up on
> > their references.
> > 
> > Signed-off-by: jarkko@kernel.org <jarkko@kernel.org>
>                  ~~~~~~~~~~~~~~~~~
>                  Jarkko Sakkinen
> 
> > Signed-off-by: Kai Huang <kai.huang@intel.com>
> 
> Sorry about this. I was reconfiguring my environment (or actually was
> moving it to another machine), and forgot to set user.name. I'll send you
> in private replacements with a legit name.

Sure. No problem. Thanks.
diff mbox series

Patch

diff --git a/arch/x86/kernel/cpu/sgx/main.c b/arch/x86/kernel/cpu/sgx/main.c
index c519fc5f6948..ebbd3b97b3d0 100644
--- a/arch/x86/kernel/cpu/sgx/main.c
+++ b/arch/x86/kernel/cpu/sgx/main.c
@@ -605,8 +605,6 @@  void sgx_free_epc_page(struct sgx_epc_page *page)
 	struct sgx_epc_section *section = &sgx_epc_sections[page->section];
 	int ret;
 
-	WARN_ON_ONCE(page->flags & SGX_EPC_PAGE_RECLAIMER_TRACKED);
-
 	ret = __eremove(sgx_get_epc_virt_addr(page));
 	if (WARN_ONCE(ret, "EREMOVE returned %d (0x%x)", ret, ret))
 		return;