Skip to content

Commit f3f9dec

Browse files
bp3tk0vgregkh
authored andcommitted
KVM: SVM: Set synthesized TSA CPUID flags
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f004f58 commit f3f9dec

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/x86/kvm/cpuid.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,7 @@ void kvm_set_cpu_caps(void)
822822
kvm_cpu_cap_check_and_set(X86_FEATURE_SBPB);
823823
kvm_cpu_cap_check_and_set(X86_FEATURE_IBPB_BRTYPE);
824824
kvm_cpu_cap_check_and_set(X86_FEATURE_SRSO_NO);
825+
kvm_cpu_cap_check_and_set(X86_FEATURE_VERW_CLEAR);
825826

826827
kvm_cpu_cap_init_kvm_defined(CPUID_8000_0022_EAX,
827828
F(PERFMON_V2)
@@ -831,6 +832,9 @@ void kvm_set_cpu_caps(void)
831832
F(TSA_SQ_NO) | F(TSA_L1_NO)
832833
);
833834

835+
kvm_cpu_cap_check_and_set(X86_FEATURE_TSA_SQ_NO);
836+
kvm_cpu_cap_check_and_set(X86_FEATURE_TSA_L1_NO);
837+
834838
/*
835839
* Synthesize "LFENCE is serializing" into the AMD-defined entry in
836840
* KVM's supported CPUID if the feature is reported as supported by the

0 commit comments

Comments
 (0)