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

Konstantin Khorenko khorenko at virtuozzo.com
Wed Oct 28 19:25:57 MSK 2020


The commit is pushed to "branch-rh8-4.18.0-193.6.3.vz8.4.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-193.6.3.vz8.4.14
------>
commit c601b45b1ce7ab444803cede470f185fb6317956
Author: Denis V. Lunev <den at openvz.org>
Date:   Wed Oct 28 19:25:57 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>
---
 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 2e69331b8580..e8feb3594bd5 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -758,13 +758,13 @@ static inline int __do_cpuid_func(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