Commit 7e7b20e4 authored by Reinette Chatre's avatar Reinette Chatre Committed by Zhiquan Li
Browse files

x86/sgx: Silence softlockup detection when releasing large enclaves

mainline inclusion
from mainline-5.17
commit 8795359e
category: feature
bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I5EZEK


CVE: NA

Intel-SIG: commit 8795359e x86/sgx: Silence softlockup detection
when releasing large enclaves.
Backport for SGX virtualization support

--------------------------------

Vijay reported that the "unclobbered_vdso_oversubscribed" selftest
triggers the softlockup detector.

Actual SGX systems have 128GB of enclave memory or more.  The
"unclobbered_vdso_oversubscribed" selftest creates one enclave which
consumes all of the enclave memory on the system. Tearing down such a
large enclave takes around a minute, most of it in the loop where
the EREMOVE instruction is applied to each individual 4k enclave page.

Spending one minute in a loop triggers the softlockup detector.

Add a cond_resched() to give other tasks a chance to run and placate
the softlockup detector.

Cc: stable@vger.kernel.org
Fixes: 1728ab54 ("x86/sgx: Add a page reclaimer")
Reported-by: default avatarVijay Dhanraj <vijay.dhanraj@intel.com>
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
Acked-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
Tested-by: Jarkko Sakkinen <jarkko@kernel.org>  (kselftest as sanity check)
Link: https://lkml.kernel.org/r/ced01cac1e75f900251b0a4ae1150aa8ebd295ec.1644345232.git.reinette.chatre@intel.com


Signed-off-by: default avatarFan Du <fan.du@intel.com>
Signed-off-by: default avatarZhiquan Li <zhiquan1.li@intel.com>
parent e08294e4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment