summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorKai Huang <kai.huang@intel.com>2024-09-05 14:08:37 +0200
committerSean Christopherson <seanjc@google.com>2024-09-10 05:13:55 +0200
commit7efb4d8a392a18e37fcdb5e77c111af6e9a9e2f2 (patch)
tree17f80aa0d345ab5f225e693876b7a97326d609d6 /arch
parentKVM: VMX: hyper-v: Prevent impossible NULL pointer dereference in evmcs_load() (diff)
downloadlinux-7efb4d8a392a18e37fcdb5e77c111af6e9a9e2f2.tar.xz
linux-7efb4d8a392a18e37fcdb5e77c111af6e9a9e2f2.zip
KVM: VMX: Also clear SGX EDECCSSA in KVM CPU caps when SGX is disabled
When SGX EDECCSSA support was added to KVM in commit 16a7fe3728a8 ("KVM/VMX: Allow exposing EDECCSSA user leaf function to KVM guest"), it forgot to clear the X86_FEATURE_SGX_EDECCSSA bit in KVM CPU caps when KVM SGX is disabled. Fix it. Fixes: 16a7fe3728a8 ("KVM/VMX: Allow exposing EDECCSSA user leaf function to KVM guest") Signed-off-by: Kai Huang <kai.huang@intel.com> Link: https://lore.kernel.org/r/20240905120837.579102-1-kai.huang@intel.com Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/vmx/vmx.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 594db9afbc0f..98d737e0d416 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -7963,6 +7963,7 @@ static __init void vmx_set_cpu_caps(void)
kvm_cpu_cap_clear(X86_FEATURE_SGX_LC);
kvm_cpu_cap_clear(X86_FEATURE_SGX1);
kvm_cpu_cap_clear(X86_FEATURE_SGX2);
+ kvm_cpu_cap_clear(X86_FEATURE_SGX_EDECCSSA);
}
if (vmx_umip_emulated())