mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] KVM: VMX: Also clear SGX EDECCSSA in KVM CPU caps when SGX is disabled
@ 2024-09-05 12:08 Kai Huang
  2024-09-10  4:56 ` Sean Christopherson
  0 siblings, 1 reply; 2+ messages in thread
From: Kai Huang @ 2024-09-05 12:08 UTC (permalink / raw)
  To: pbonzini, seanjc, kvm; +Cc: linux-kernel, Kai Huang

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>
---
 arch/x86/kvm/vmx/vmx.c | 1 +
 1 file changed, 1 insertion(+)

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())

base-commit: 44518120c4ca569cfb9c6199e94c312458dc1c07
-- 
2.46.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] KVM: VMX: Also clear SGX EDECCSSA in KVM CPU caps when SGX is disabled
  2024-09-05 12:08 [PATCH] KVM: VMX: Also clear SGX EDECCSSA in KVM CPU caps when SGX is disabled Kai Huang
@ 2024-09-10  4:56 ` Sean Christopherson
  0 siblings, 0 replies; 2+ messages in thread
From: Sean Christopherson @ 2024-09-10  4:56 UTC (permalink / raw)
  To: Sean Christopherson, pbonzini, kvm, Kai Huang; +Cc: linux-kernel

On Fri, 06 Sep 2024 00:08:37 +1200, Kai Huang wrote:
> 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.

Applied to kvm-x86 vmx.  At some point, we should probably look at using the
kernel's cpufeatures dependency chains, but that's no reason to hold this fix.

Thanks!

[1/1] KVM: VMX: Also clear SGX EDECCSSA in KVM CPU caps when SGX is disabled
      https://github.com/kvm-x86/linux/commit/7efb4d8a392a

--
https://github.com/kvm-x86/linux/tree/next

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-09-10  4:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-05 12:08 [PATCH] KVM: VMX: Also clear SGX EDECCSSA in KVM CPU caps when SGX is disabled Kai Huang
2024-09-10  4:56 ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®