linux-stable/arch/x86/kernel/cpu
Reinette Chatre 8795359e35 x86/sgx: Silence softlockup detection when releasing large enclaves
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: 1728ab54b4 ("x86/sgx: Add a page reclaimer")
Reported-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Acked-by: Dave 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
2022-02-10 15:58:14 -08:00
..
mce x86/cpu: Add Xeon Icelake-D to list of CPUs that support PPIN 2022-01-25 18:40:30 +01:00
microcode x86/microcode: Use the firmware_loader built-in API 2021-10-22 14:13:50 +02:00
mtrr x86/mtrr: Replace deprecated CPU-hotplug functions. 2021-08-10 14:46:27 +02:00
resctrl x86/resctrl: Remove redundant assignment to variable chunks 2021-12-09 09:57:16 -08:00
sgx x86/sgx: Silence softlockup detection when releasing large enclaves 2022-02-10 15:58:14 -08:00
.gitignore
acrn.c x86/acrn: Introduce acrn_cpuid_base() and hypervisor feature bits 2021-02-09 10:58:18 +01:00
amd.c x86/cpu: Fix migration safety with X86_BUG_NULL_SEL 2021-10-21 20:49:16 +02:00
aperfmperf.c x86/cpu: Avoid cpuinfo-induced IPIing of idle CPUs 2020-11-06 16:59:11 -08:00
bugs.c seccomp updates for v5.16-rc1 2021-11-01 17:25:09 -07:00
cacheinfo.c sched: Add cluster scheduler level for x86 2021-10-15 11:25:16 +02:00
centaur.c x86/cpu/centaur: Add Centaur family >=7 CPUs initialization support 2020-09-11 10:53:19 +02:00
common.c - Enable the short string copies for CPUs which support them, in 2022-01-10 10:09:22 -08:00
cpu.h x86/cpu: Fix migration safety with X86_BUG_NULL_SEL 2021-10-21 20:49:16 +02:00
cpuid-deps.c x86/fpu: Optimize out sigframe xfeatures when in init state 2021-11-03 22:42:35 +01:00
cyrix.c x86: Fix various typos in comments 2021-03-18 15:31:53 +01:00
feat_ctl.c x86/cpu/intel: Allow SGX virtualization without Launch Control support 2021-04-06 09:43:41 +02:00
hygon.c x86/cpu: Fix migration safety with X86_BUG_NULL_SEL 2021-10-21 20:49:16 +02:00
hypervisor.c
intel.c Changes in this cycle were: 2021-06-28 13:30:02 -07:00
intel_epb.c x86: intel_epb: Allow model specific normal EPB value 2022-01-04 16:37:23 +01:00
intel_pconfig.c
Makefile x86/CPU: Add support for Vortex CPUs 2021-10-21 15:49:07 +02:00
match.c
mkcapflags.sh
mshyperv.c hyperv-next for 5.17 2022-01-16 15:53:00 +02:00
perfctr-watchdog.c x86/nmi_watchdog: Fix old-style NMI watchdog regression on old Intel CPUs 2021-06-10 10:04:40 +02:00
powerflags.c
proc.c
rdrand.c
scattered.c x86/cpufeatures: Add SGX1 and SGX2 sub-features 2021-03-25 17:33:11 +01:00
topology.c x86: Fix various typos in comments 2021-03-18 15:31:53 +01:00
transmeta.c
tsx.c x86/tsx: Clear CPUID bits when TSX always force aborts 2021-06-15 17:46:48 +02:00
umc.c
umwait.c KVM: VMX: Stop context switching MSR_IA32_UMWAIT_CONTROL 2020-06-22 20:54:57 -04:00
vmware.c Have vmware guests skip the refined TSC calibration when the TSC 2021-04-26 09:13:43 -07:00
vortex.c x86/CPU: Add support for Vortex CPUs 2021-10-21 15:49:07 +02:00
zhaoxin.c x86/cpu: Reinitialize IA32_FEAT_CTL MSR on BSP during wakeup 2020-06-15 14:18:37 +02:00