linux/arch
Jack Wang 3d7d72a34e x86/sgx: Break up long non-preemptible delays in sgx_vepc_release()
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
2023-09-06 23:55:09 +02:00
..
alpha Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
arc Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
arm Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
arm64 Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
csky Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
hexagon Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
ia64 Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
loongarch Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
m68k Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
microblaze Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
mips Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
nios2 Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
openrisc Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
parisc Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
powerpc Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
riscv Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
s390 Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
sh Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
sparc Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
um Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
x86 x86/sgx: Break up long non-preemptible delays in sgx_vepc_release() 2023-09-06 23:55:09 +02:00
xtensa Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
.gitignore
Kconfig Add x86 shadow stack support 2023-08-31 12:20:12 -07:00