Skip to content

Commit

Permalink
KVM: VMX: Also clear SGX EDECCSSA in KVM CPU caps when SGX is disabled
Browse files Browse the repository at this point in the history
Upstream commit 7efb4d8a392a18e37fcdb5e77c111af6e9a9e2f2
Conflict: none

When SGX EDECCSSA support was added to KVM in commit 16a7fe3
("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.

Intel-SIG: commit 7efb4d8a392a KVM: VMX: Also clear SGX EDECCSSA in KVM
CPU caps when SGX is disabled
Backport a SGX bug fix from upstream.

Fixes: 16a7fe3 ("KVM/VMX: Allow exposing EDECCSSA user leaf function to KVM guest")
Signed-off-by: Kai Huang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sean Christopherson <[email protected]>
[ Zhiquan Li: amend commit log ]
Signed-off-by: Zhiquan Li <[email protected]>
  • Loading branch information
kaihuang authored and Avenger-285714 committed Feb 14, 2025
1 parent 4af8278 commit 0291c94
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/x86/kvm/vmx/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -7987,6 +7987,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())
Expand Down

0 comments on commit 0291c94

Please sign in to comment.