Skip to content

Commit 0b8f642

Browse files
bp3tk0vgregkh
authored andcommitted
KVM: SVM: Set synthesized TSA CPUID flags
Commit f3f9dec in the LTS tree. 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> Cc: <stable@vger.kernel.org> # 6.1.y Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 0389b06 commit 0b8f642

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
@@ -770,10 +770,15 @@ void kvm_set_cpu_caps(void)
770770
if (cpu_feature_enabled(X86_FEATURE_SRSO_NO))
771771
kvm_cpu_cap_set(X86_FEATURE_SRSO_NO);
772772

773+
kvm_cpu_cap_check_and_set(X86_FEATURE_VERW_CLEAR);
774+
773775
kvm_cpu_cap_init_kvm_defined(CPUID_8000_0021_ECX,
774776
F(TSA_SQ_NO) | F(TSA_L1_NO)
775777
);
776778

779+
kvm_cpu_cap_check_and_set(X86_FEATURE_TSA_SQ_NO);
780+
kvm_cpu_cap_check_and_set(X86_FEATURE_TSA_L1_NO);
781+
777782
/*
778783
* Hide RDTSCP and RDPID if either feature is reported as supported but
779784
* probing MSR_TSC_AUX failed. This is purely a sanity check and

0 commit comments

Comments
 (0)