2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/arch/x86/kernel/cpu/sgx
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
..
driver.c mm: replace vma->vm_flags direct modifications with modifier calls 2023-02-09 16:51:39 -08:00
driver.h x86/sgx: Add SGX_IOC_ENCLAVE_PROVISION 2020-11-18 18:02:50 +01:00
encl.c x86/sgx: Avoid using iterator after loop in sgx_mmu_notifier_release() 2023-06-13 16:21:01 +02:00
encl.h x86/sgx: Improve comments for sgx_encl_lookup/alloc_backing() 2022-08-15 11:51:49 +02:00
encls.h x86/sgx: Add wrapper for SGX2 EAUG function 2022-07-07 10:13:01 -07:00
ioctl.c mm/gup: remove unused vmas parameter from get_user_pages() 2023-06-09 16:25:25 -07:00
main.c convert sgx_set_attribute() to fdget()/fdput() 2023-04-20 22:55:35 -04:00
Makefile x86/sgx: Introduce virtual EPC for use by KVM guests 2021-04-06 09:43:17 +02:00
sgx.h docs: move x86 documentation into Documentation/arch/ 2023-03-30 12:58:51 -06:00
virt.c x86/sgx: Break up long non-preemptible delays in sgx_vepc_release() 2023-09-06 23:55:09 +02:00