linux/arch/x86/kernel/cpu
Jack Wang e1eb041912 x86/sgx: Break up long non-preemptible delays in sgx_vepc_release()
commit 3d7d72a34e upstream.

On large enclaves we hit the softlockup warning with following call trace:

	xa_erase()
	sgx_vepc_release()
	__fput()
	task_work_run()
	do_exit()

The latency issue is similar to the one fixed in:

  8795359e35 ("x86/sgx: Silence softlockup detection when releasing large enclaves")

The test system has 64GB of enclave memory, and all is assigned to a single VM.
Release of 'vepc' takes a longer time and causes long latencies, which triggers
the softlockup warning.

Add cond_resched() to give other tasks a chance to run and reduce
latencies, which also avoids the softlockup detector.

[ mingo: Rewrote the changelog. ]

Fixes: 540745ddbc ("x86/sgx: Introduce virtual EPC for use by KVM guests")
Reported-by: Yu Zhang <yu.zhang@ionos.com>
Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Yu Zhang <yu.zhang@ionos.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Reviewed-by: Kai Huang <kai.huang@intel.com>
Acked-by: Haitao Huang <haitao.huang@linux.intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-09-13 09:43:04 +02:00
..
mce x86/MCE: Always save CS register on AMD Zen IF Poison errors 2023-09-13 09:43:03 +02:00
microcode x86/microcode/AMD: Load late on both threads too 2023-07-01 13:16:23 +02:00
mtrr
resctrl x86/resctrl: Only show tasks' pid in current pid namespace 2023-07-19 16:20:55 +02:00
sgx x86/sgx: Break up long non-preemptible delays in sgx_vepc_release() 2023-09-13 09:43:04 +02:00
.gitignore
acrn.c
amd.c x86/CPU/AMD: Fix the DIV(0) initial fix attempt 2023-08-26 13:27:00 +02:00
aperfmperf.c
bugs.c x86/srso: Correct the mitigation status when SMT is disabled 2023-08-26 13:27:01 +02:00
cacheinfo.c
centaur.c
common.c x86/speculation: Mark all Skylake CPUs as vulnerable to GDS 2023-09-13 09:42:57 +02:00
cpu.h x86/speculation: Add Gather Data Sampling mitigation 2023-08-08 20:03:48 +02:00
cpuid-deps.c
cyrix.c
feat_ctl.c
hygon.c
hypervisor.c
intel_epb.c
intel_pconfig.c
intel.c
Makefile
match.c
mkcapflags.sh
mshyperv.c
perfctr-watchdog.c
powerflags.c
proc.c
rdrand.c
scattered.c
topology.c x86/topology: Fix erroneous smp_num_siblings on Intel Hybrid platforms 2023-05-30 14:03:19 +01:00
transmeta.c
tsx.c
umc.c
umwait.c
vmware.c
vortex.c
zhaoxin.c