[intel-sgx-kernel-dev,v8,07/10] intel_sgx: remove redundant code from sgx_vma_do_fault
diff mbox

Message ID 20161208123828.21834-8-jarkko.sakkinen@linux.intel.com
State New
Headers show

Commit Message

Jarkko Sakkinen Dec. 8, 2016, 12:38 p.m. UTC
sgx_free_page always check SGX_ENCL_SUSPEND flag and skips EREMOVE
if it is set.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
---
 drivers/platform/x86/intel_sgx_vma.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Sean Christopherson Dec. 13, 2016, 7:02 p.m. UTC | #1
On Thu, 2016-12-08 at 14:38 +0200, Jarkko Sakkinen wrote:
> sgx_free_page always check SGX_ENCL_SUSPEND flag and skips EREMOVE
> if it is set.
> 
> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

Reviewed-by: Sean Christopherson <sean.j.christopherson@intel.com>
Tested-by: Sean Christopherson <sean.j.christopherson@intel.com>

> ---
>  drivers/platform/x86/intel_sgx_vma.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/platform/x86/intel_sgx_vma.c b/drivers/platform/x86/intel_sgx_vma.c
> index f273282..22dfdc3 100644
> --- a/drivers/platform/x86/intel_sgx_vma.c
> +++ b/drivers/platform/x86/intel_sgx_vma.c
> @@ -263,8 +263,6 @@ static struct sgx_encl_page *sgx_vma_do_fault(struct vm_area_struct *vma,
>  	list_add_tail(&entry->load_list, &encl->load_list);
>  out:
>  	mutex_unlock(&encl->lock);
> -	if (encl->flags & SGX_ENCL_SUSPEND)
> -		free_flags |= SGX_FREE_SKIP_EREMOVE;
>  	if (epc_page)
>  		sgx_free_page(epc_page, encl, free_flags);
>  	if (secs_epc_page)

Patch
diff mbox

diff --git a/drivers/platform/x86/intel_sgx_vma.c b/drivers/platform/x86/intel_sgx_vma.c
index f273282..22dfdc3 100644
--- a/drivers/platform/x86/intel_sgx_vma.c
+++ b/drivers/platform/x86/intel_sgx_vma.c
@@ -263,8 +263,6 @@  static struct sgx_encl_page *sgx_vma_do_fault(struct vm_area_struct *vma,
 	list_add_tail(&entry->load_list, &encl->load_list);
 out:
 	mutex_unlock(&encl->lock);
-	if (encl->flags & SGX_ENCL_SUSPEND)
-		free_flags |= SGX_FREE_SKIP_EREMOVE;
 	if (epc_page)
 		sgx_free_page(epc_page, encl, free_flags);
 	if (secs_epc_page)