9ae3a8
From d037664335efca55df79abcde79f4f2733ca535b Mon Sep 17 00:00:00 2001
9ae3a8
From: Eduardo Habkost <ehabkost@redhat.com>
9ae3a8
Date: Thu, 23 Feb 2017 14:29:42 +0100
9ae3a8
Subject: [PATCH 12/17] target-i386: Filter KVM and 0xC0000001 features on TCG
9ae3a8
MIME-Version: 1.0
9ae3a8
Content-Type: text/plain; charset=UTF-8
9ae3a8
Content-Transfer-Encoding: 8bit
9ae3a8
9ae3a8
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
9ae3a8
Message-id: <20170223142945.17790-12-ehabkost@redhat.com>
9ae3a8
Patchwork-id: 74040
9ae3a8
O-Subject: [RHEL-7.4 qemu-kvm PATCH v2 11/14] target-i386: Filter KVM and 0xC0000001 features on TCG
9ae3a8
Bugzilla: 1382122
9ae3a8
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
9ae3a8
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
9ae3a8
TCG doesn't support any of the feature flags on FEAT_KVM and
9ae3a8
FEAT_C000_0001_EDX feature words, so clear all bits on those feature
9ae3a8
words.
9ae3a8
9ae3a8
Reviewed-by: Richard Henderson <rth@twiddle.net>
9ae3a8
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
9ae3a8
Signed-off-by: Andreas Färber <afaerber@suse.de>
9ae3a8
(cherry picked from commit 84a6c6cd40687598c7e85d7de8095e08b5e636d7)
9ae3a8
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 target-i386/cpu.c | 4 ++++
9ae3a8
 1 file changed, 4 insertions(+)
9ae3a8
9ae3a8
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
9ae3a8
index d424211..e6821b6 100644
9ae3a8
--- a/target-i386/cpu.c
9ae3a8
+++ b/target-i386/cpu.c
9ae3a8
@@ -501,7 +501,9 @@ typedef struct x86_def_t {
9ae3a8
           CPUID_EXT2_PDPE1GB */
9ae3a8
 #define TCG_EXT3_FEATURES (CPUID_EXT3_LAHF_LM | CPUID_EXT3_SVM | \
9ae3a8
           CPUID_EXT3_CR8LEG | CPUID_EXT3_ABM | CPUID_EXT3_SSE4A)
9ae3a8
+#define TCG_EXT4_FEATURES 0
9ae3a8
 #define TCG_SVM_FEATURES 0
9ae3a8
+#define TCG_KVM_FEATURES 0
9ae3a8
 #define TCG_7_0_EBX_FEATURES (CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_SMAP | \
9ae3a8
           CPUID_7_0_EBX_BMI1 | CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ADX)
9ae3a8
           /* missing:
9ae3a8
@@ -2644,6 +2646,8 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
9ae3a8
         env->features[FEAT_8000_0001_EDX] &= TCG_EXT2_FEATURES;
9ae3a8
         env->features[FEAT_8000_0001_ECX] &= TCG_EXT3_FEATURES;
9ae3a8
         env->features[FEAT_SVM] &= TCG_SVM_FEATURES;
9ae3a8
+        env->features[FEAT_KVM] &= TCG_KVM_FEATURES;
9ae3a8
+        env->features[FEAT_C000_0001_EDX] &= TCG_EXT4_FEATURES;
9ae3a8
         env->features[FEAT_XSAVE] = 0;
9ae3a8
         env->features[FEAT_7_0_ECX] &= TCG_7_0_ECX_FEATURES;
9ae3a8
         env->features[FEAT_7_0_EDX] &= TCG_7_0_EDX_FEATURES;
9ae3a8
-- 
9ae3a8
1.8.3.1
9ae3a8