Blame SOURCES/kvm-target-i386-Filter-FEAT_7_0_EBX-TCG-features-too.patch

619821
From 65c528e40cc9e6d3d887fd79284d465bb482bbe2 Mon Sep 17 00:00:00 2001
619821
From: Eduardo Habkost <ehabkost@redhat.com>
619821
Date: Thu, 23 Feb 2017 14:29:41 +0100
619821
Subject: [PATCH 11/17] target-i386: Filter FEAT_7_0_EBX TCG features too
619821
MIME-Version: 1.0
619821
Content-Type: text/plain; charset=UTF-8
619821
Content-Transfer-Encoding: 8bit
619821
619821
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
619821
Message-id: <20170223142945.17790-11-ehabkost@redhat.com>
619821
Patchwork-id: 74044
619821
O-Subject: [RHEL-7.4 qemu-kvm PATCH v2 10/14] target-i386: Filter FEAT_7_0_EBX TCG features too
619821
Bugzilla: 1382122
619821
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
619821
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
619821
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
619821
619821
The TCG_7_0_EBX_FEATURES macro was defined but never used (it even had a
619821
typo that was never noticed). Make the existing TCG feature filtering
619821
code use it.
619821
619821
Reviewed-by: Richard Henderson <rth@twiddle.net>
619821
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
619821
Cc: qemu-stable@nongnu.org
619821
Signed-off-by: Andreas Färber <afaerber@suse.de>
619821
(cherry picked from commit d0a70f46fa9a3257089a56f2f620b0eff868557f)
619821
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
619821
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
619821
---
619821
 target-i386/cpu.c | 3 ++-
619821
 1 file changed, 2 insertions(+), 1 deletion(-)
619821
619821
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
619821
index e32d4d7..d424211 100644
619821
--- a/target-i386/cpu.c
619821
+++ b/target-i386/cpu.c
619821
@@ -502,7 +502,7 @@ typedef struct x86_def_t {
619821
 #define TCG_EXT3_FEATURES (CPUID_EXT3_LAHF_LM | CPUID_EXT3_SVM | \
619821
           CPUID_EXT3_CR8LEG | CPUID_EXT3_ABM | CPUID_EXT3_SSE4A)
619821
 #define TCG_SVM_FEATURES 0
619821
-#define TCG_7_0_EBX_FEATURES (CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_SMAP \
619821
+#define TCG_7_0_EBX_FEATURES (CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_SMAP | \
619821
           CPUID_7_0_EBX_BMI1 | CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ADX)
619821
           /* missing:
619821
           CPUID_7_0_EBX_FSGSBASE, CPUID_7_0_EBX_HLE, CPUID_7_0_EBX_AVX2,
619821
@@ -2640,6 +2640,7 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
619821
     if (!kvm_enabled()) {
619821
         env->features[FEAT_1_EDX] &= TCG_FEATURES;
619821
         env->features[FEAT_1_ECX] &= TCG_EXT_FEATURES;
619821
+        env->features[FEAT_7_0_EBX] &= TCG_7_0_EBX_FEATURES;
619821
         env->features[FEAT_8000_0001_EDX] &= TCG_EXT2_FEATURES;
619821
         env->features[FEAT_8000_0001_ECX] &= TCG_EXT3_FEATURES;
619821
         env->features[FEAT_SVM] &= TCG_SVM_FEATURES;
619821
-- 
619821
1.8.3.1
619821