a7517427cc
Fix example qemu-ifup script and eliminate bogus use of CPUID_7_0_EDX_PRED_CMD OBS-URL: https://build.opensuse.org/request/show/582028 OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=396
37 lines
1.5 KiB
Diff
37 lines
1.5 KiB
Diff
From 5d4a265705e98952cc849c59ba3118f8a79515aa Mon Sep 17 00:00:00 2001
|
|
From: Bruce Rogers <brogers@suse.com>
|
|
Date: Thu, 22 Feb 2018 04:48:07 -0700
|
|
Subject: [PATCH] i386: Compensate for KVM SPEC_CTRL feature availability bug
|
|
|
|
As we move away from the quick and dirty qemu solution for
|
|
Spectre v2, it was found that KVM wasn't reporting the SPEC_CTRL
|
|
feature when it in fact was present due to microcode update.
|
|
This patch compensates for that bug by checking for the feature
|
|
in QEMU code (like the quick and dirty solution did), instead of
|
|
simply relying on KVM for that information.
|
|
[BR: BSC#1082276]
|
|
|
|
Signed-off-by: Bruce Rogers <brogers@suse.com>
|
|
---
|
|
target/i386/cpu.c | 7 +++++++
|
|
1 file changed, 7 insertions(+)
|
|
|
|
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
|
|
index a7e27f3bbf..27b40fc81f 100644
|
|
--- a/target/i386/cpu.c
|
|
+++ b/target/i386/cpu.c
|
|
@@ -2824,6 +2824,13 @@ static uint32_t x86_cpu_get_supported_feature_word(FeatureWord w,
|
|
r = kvm_arch_get_supported_cpuid(kvm_state, wi->cpuid_eax,
|
|
wi->cpuid_ecx,
|
|
wi->cpuid_reg);
|
|
+ // BUG!!! We need to compensate for a KVM bug where it doesn't
|
|
+ // correctly report support for IBRS (bsc#1082276)
|
|
+ if (w == FEAT_7_0_EDX) {
|
|
+ uint32_t edx;
|
|
+ host_cpuid(7, 0, NULL, NULL, NULL, &edx);
|
|
+ r |= edx & CPUID_7_0_EDX_SPEC_CTRL;
|
|
+ }
|
|
} else if (tcg_enabled()) {
|
|
r = wi->tcg_features;
|
|
} else {
|