Accepting request 582028 from home:bfrogers:branches:Virtualization

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
This commit is contained in:
Bruce Rogers 2018-03-02 17:01:56 +00:00 committed by Git OBS Bridge
parent 06ba5dd4d1
commit b856b40027
7 changed files with 46 additions and 13 deletions

View File

@ -1,4 +1,4 @@
From 4e5e2c853977dc27ddab5937e55d181e7f1b5d2a Mon Sep 17 00:00:00 2001
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
@ -13,14 +13,14 @@ simply relying on KVM for that information.
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
target/i386/cpu.c | 8 ++++++++
1 file changed, 8 insertions(+)
target/i386/cpu.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index a7e27f3bbf..5c34175f3f 100644
index a7e27f3bbf..27b40fc81f 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -2824,6 +2824,14 @@ static uint32_t x86_cpu_get_supported_feature_word(FeatureWord w,
@@ -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);
@ -29,8 +29,7 @@ index a7e27f3bbf..5c34175f3f 100644
+ if (w == FEAT_7_0_EDX) {
+ uint32_t edx;
+ host_cpuid(7, 0, NULL, NULL, NULL, &edx);
+#define CPUID_7_0_EDX_PRED_CMD (1U << 27)
+ r |= edx & (CPUID_7_0_EDX_SPEC_CTRL | CPUID_7_0_EDX_PRED_CMD);
+ r |= edx & CPUID_7_0_EDX_SPEC_CTRL;
+ }
} else if (tcg_enabled()) {
r = wi->tcg_features;

View File

@ -7,7 +7,7 @@ echo 'configuring qemu network with bridge for' $*
# If bridge is not specified, try device with default route.
bridge=$2
if [ -z "$bridge" ]; then
bridge=$(/sbin/ip route list | /usr/bin/awk '/^default / { print $5 }')
bridge=$(/usr/sbin/ip route list | /usr/bin/awk '/^default / { print $5 }')
fi
# Exit if $bridge is not a bridge. Exit with 0 status
@ -19,5 +19,5 @@ then
exit 0
fi
/sbin/ip link set $1 up
/sbin/brctl addif $bridge $1 || true
/usr/sbin/ip link set $1 up
/usr/sbin/ip link set $1 master $bridge || true

View File

@ -19,7 +19,7 @@
Name: qemu-linux-user
Url: http://www.qemu.org/
Summary: CPU emulator for user space
License: BSD-3-Clause AND GPL-2.0 AND GPL-2.0+ AND LGPL-2.1+ AND MIT
License: BSD-3-Clause AND GPL-2.0-only AND GPL-2.0-or-later AND LGPL-2.1-or-later AND MIT
Group: System/Emulators/PC
Version: 2.11.1
Release: 0

View File

@ -1,3 +1,20 @@
-------------------------------------------------------------------
Fri Mar 2 16:31:15 UTC 2018 - brogers@suse.com
- Change example qemu-ifup script to not depend on bridge-utils.
Also update the paths used for ip binary.
-------------------------------------------------------------------
Wed Feb 28 16:13:08 UTC 2018 - brogers@suse.com
- Eliminate bogus use of CPUID_7_0_EDX_PRED_CMD which we've
carried since the initial Spectre v2 patch was added. EDX bit
27 of CPUID Leaf 07H, Sub-leaf 0 provides status on STIBP, and
not the PRED_CMD MSR. Exposing the STIBP CPUID feature bit to the
guest is wrong in general, since the VM doesn't directly control
the scheduling of physical hyperthreads. This is left strictly to
the L0 hypervisor.
-------------------------------------------------------------------
Thu Feb 22 12:01:21 UTC 2018 - brogers@suse.com

View File

@ -107,7 +107,7 @@
Name: qemu-testsuite
Url: http://www.qemu.org/
Summary: Machine emulator and virtualizer
License: BSD-3-Clause AND GPL-2.0 AND GPL-2.0+ AND LGPL-2.1+ AND MIT
License: BSD-3-Clause AND GPL-2.0-only AND GPL-2.0-or-later AND LGPL-2.1-or-later AND MIT
Group: System/Emulators/PC
Version: 2.11.1
Release: 0

View File

@ -1,3 +1,20 @@
-------------------------------------------------------------------
Fri Mar 2 16:31:15 UTC 2018 - brogers@suse.com
- Change example qemu-ifup script to not depend on bridge-utils.
Also update the paths used for ip binary.
-------------------------------------------------------------------
Wed Feb 28 16:13:08 UTC 2018 - brogers@suse.com
- Eliminate bogus use of CPUID_7_0_EDX_PRED_CMD which we've
carried since the initial Spectre v2 patch was added. EDX bit
27 of CPUID Leaf 07H, Sub-leaf 0 provides status on STIBP, and
not the PRED_CMD MSR. Exposing the STIBP CPUID feature bit to the
guest is wrong in general, since the VM doesn't directly control
the scheduling of physical hyperthreads. This is left strictly to
the L0 hypervisor.
-------------------------------------------------------------------
Thu Feb 22 12:01:21 UTC 2018 - brogers@suse.com

View File

@ -107,7 +107,7 @@
Name: qemu
Url: http://www.qemu.org/
Summary: Machine emulator and virtualizer
License: BSD-3-Clause AND GPL-2.0 AND GPL-2.0+ AND LGPL-2.1+ AND MIT
License: BSD-3-Clause AND GPL-2.0-only AND GPL-2.0-or-later AND LGPL-2.1-or-later AND MIT
Group: System/Emulators/PC
Version: 2.11.1
Release: 0