[Devel] [PATCH RHEL7 COMMIT] kvm: fix AMD IBRS/IBPB/STIBP/SSBD reporting #PSBM-120787

Vasily Averin vvs at virtuozzo.com
Tue Nov 10 13:42:39 MSK 2020


The commit is pushed to "branch-rh7-3.10.0-1160.2.2.vz7.170.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1160.2.2.el7
------>
commit 7b92b48f1bde33ff94e9cfbf375bfa85af6fe5fd
Author: Denis V. Lunev <den at openvz.org>
Date:   Tue Nov 10 13:42:39 2020 +0300

    kvm: fix AMD IBRS/IBPB/STIBP/SSBD reporting #PSBM-120787
    
    We should report these bits in 80000008 EBX on AMD only, i.e. when AMD
    specific feature bits are enabled.
    
    Signed-off-by: Denis V. Lunev <den at openvz.org>
    CC: Vasily Averin <vvs at virtuozzo.com>
    CC: Konstantin Khorenko <khorenko at virtuozzo.com>
    
    Signed-off-by: "Denis V. Lunev" <den at openvz.org>
---
 arch/x86/kvm/cpuid.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index 96a6bac..d876f18 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -642,13 +642,13 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
 		 * arch/x86/kernel/cpu/bugs.c is kind enough to
 		 * record that in cpufeatures so use them.
 		 */
-		if (boot_cpu_has(X86_FEATURE_IBPB))
+		if (boot_cpu_has(X86_FEATURE_AMD_IBPB))
 			entry->ebx |= F(AMD_IBPB);
-		if (boot_cpu_has(X86_FEATURE_IBRS))
+		if (boot_cpu_has(X86_FEATURE_AMD_IBRS))
 			entry->ebx |= F(AMD_IBRS);
-		if (boot_cpu_has(X86_FEATURE_STIBP))
+		if (boot_cpu_has(X86_FEATURE_AMD_STIBP))
 			entry->ebx |= F(AMD_STIBP);
-		if (boot_cpu_has(X86_FEATURE_SSBD))
+		if (boot_cpu_has(X86_FEATURE_AMD_SSBD))
 			entry->ebx |= F(AMD_SSBD);
 		if (!boot_cpu_has_bug(X86_BUG_SPEC_STORE_BYPASS))
 			entry->ebx |= F(AMD_SSB_NO);


More information about the Devel mailing list