aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/kvm/x86/nested_exceptions_test.c
diff options
context:
space:
mode:
authorVladis Dronov <[email protected]>2025-03-09 17:22:16 +0000
committerIngo Molnar <[email protected]>2025-03-10 11:29:18 +0000
commit65be5c95d08eedda570a6c888a12384c77fe7614 (patch)
treefd34ae9a120e078a38e3d42642b92a860865ca0f /tools/testing/selftests/kvm/x86/nested_exceptions_test.c
parentLinux 6.14-rc6 (diff)
downloadkernel-65be5c95d08eedda570a6c888a12384c77fe7614.tar.gz
kernel-65be5c95d08eedda570a6c888a12384c77fe7614.zip
x86/sgx: Warn explicitly if X86_FEATURE_SGX_LC is not enabled
The kernel requires X86_FEATURE_SGX_LC to be able to create SGX enclaves, not just X86_FEATURE_SGX. There is quite a number of hardware which has X86_FEATURE_SGX but not X86_FEATURE_SGX_LC. A kernel running on such hardware does not create the /dev/sgx_enclave file and does so silently. Explicitly warn if X86_FEATURE_SGX_LC is not enabled to properly notify users that the kernel disabled the SGX driver. The X86_FEATURE_SGX_LC, a.k.a. SGX Launch Control, is a CPU feature that enables LE (Launch Enclave) hash MSRs to be writable (with additional opt-in required in the 'feature control' MSR) when running enclaves, i.e. using a custom root key rather than the Intel proprietary key for enclave signing. I've hit this issue myself and have spent some time researching where my /dev/sgx_enclave file went on SGX-enabled hardware. Related links: https://github.com/intel/linux-sgx/issues/837 https://patchwork.kernel.org/project/platform-driver-x86/patch/[email protected]/ [ mingo: Made the error message a bit more verbose, and added other cases where the kernel fails to create the /dev/sgx_enclave device node. ] Signed-off-by: Vladis Dronov <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Acked-by: Kai Huang <[email protected]> Cc: Jarkko Sakkinen <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Sean Christopherson <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'tools/testing/selftests/kvm/x86/nested_exceptions_test.c')
0 files changed, 0 insertions, 0 deletions