[Devel] [PATCH vz7, vz8 1/1] kvm: fix AMD IBRS/IBPB/STIBP/SSBD reporting #PSBM-120787

Denis V. Lunev den at openvz.org
Fri Oct 23 01:23:40 MSK 2020


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 fe8b92723990..05898112a306 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -641,13 +641,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);
-- 
2.17.1



More information about the Devel mailing list