Skip to content

Commit 2089d8a

Browse files
bp3tk0vgregkh
authored andcommitted
KVM: SVM: Set synthesized TSA CPUID flags
commit f3f9dec upstream. VERW_CLEAR is supposed to be set only by the hypervisor to denote TSA mitigation support to a guest. SQ_NO and L1_NO are both synthesizable, and are going to be set by hw CPUID on future machines. So keep the kvm_cpu_cap_init_kvm_defined() invocation *and* set them when synthesized. This fix is stable-only. Co-developed-by: Jinpu Wang <jinpu.wang@ionos.com> Signed-off-by: Jinpu Wang <jinpu.wang@ionos.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 2b8a196 commit 2089d8a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

arch/x86/kvm/cpuid.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,10 +791,15 @@ void kvm_set_cpu_caps(void)
791791
F(PERFMON_V2)
792792
);
793793

794+
kvm_cpu_cap_check_and_set(X86_FEATURE_VERW_CLEAR);
795+
794796
kvm_cpu_cap_init_kvm_defined(CPUID_8000_0021_ECX,
795797
F(TSA_SQ_NO) | F(TSA_L1_NO)
796798
);
797799

800+
kvm_cpu_cap_check_and_set(X86_FEATURE_TSA_SQ_NO);
801+
kvm_cpu_cap_check_and_set(X86_FEATURE_TSA_L1_NO);
802+
798803
/*
799804
* Synthesize "LFENCE is serializing" into the AMD-defined entry in
800805
* KVM's supported CPUID if the feature is reported as supported by the

0 commit comments

Comments
 (0)