qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [qom-cpu PATCH 00/10] target-i386: Support check/enforce flags in TCG mode, too
@ 2014-02-28 20:21 Eduardo Habkost
  2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 01/10] target-i386: Simplify reporting of unavailable features Eduardo Habkost
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Eduardo Habkost @ 2014-02-28 20:21 UTC (permalink / raw)
  To: qemu-devel, Andreas Färber
  Cc: Igor Mammedov, Richard Henderson, Aurelien Jarno, Paolo Bonzini

This removes some duplication in the CPU feature checking and filtering code in
cpu.c, and as a nice side-effect, will make the "check" and "enforce" flags work
in TCG mode too.

Eduardo Habkost (10):
  target-i386: Simplify reporting of unavailable features
  target-i386: Merge feature filtering/checking functions
  target-i386: Pass FeatureWord argument to
    report_unavailable_features()
  target-i386: Isolate KVM-specific code on CPU feature filtering logic
  target-i386: Make TCG feature filtering more readable
  target-i386: Filter FEAT_7_0_EBX TCG features too
  target-i386: Filter KVM and 0xC0000001 features on TCG
  target-i386: Define TCG_*_FEATURES earlier on cpu.c
  target-i386: Loop-based feature word filtering in TCG mode
  target-i386: Support check/enforce flags in TCG mode, too

 target-i386/cpu.c | 215 +++++++++++++++++++++++++++---------------------------
 1 file changed, 107 insertions(+), 108 deletions(-)

-- 
1.8.5.3

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Qemu-devel] [qom-cpu PATCH 01/10] target-i386: Simplify reporting of unavailable features
  2014-02-28 20:21 [Qemu-devel] [qom-cpu PATCH 00/10] target-i386: Support check/enforce flags in TCG mode, too Eduardo Habkost
@ 2014-02-28 20:21 ` Eduardo Habkost
  2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 02/10] target-i386: Merge feature filtering/checking functions Eduardo Habkost
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Habkost @ 2014-02-28 20:21 UTC (permalink / raw)
  To: qemu-devel, Andreas Färber
  Cc: Igor Mammedov, Richard Henderson, Aurelien Jarno, Paolo Bonzini

Instead of checking and calling unavailable_host_feature() once for each
bit, simply call the function (now renamed to
report_unavailable_features()) once for each feature word.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target-i386/cpu.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 9ff1062..d62be53 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1172,11 +1172,11 @@ static void kvm_cpu_fill_host(X86CPUDefinition *x86_cpu_def)
     }
 }
 
-static int unavailable_host_feature(FeatureWordInfo *f, uint32_t mask)
+static int report_unavailable_features(FeatureWordInfo *f, uint32_t mask)
 {
     int i;
 
-    for (i = 0; i < 32; ++i)
+    for (i = 0; i < 32; ++i) {
         if (1 << i & mask) {
             const char *reg = get_register_name_32(f->cpuid_reg);
             assert(reg);
@@ -1185,8 +1185,8 @@ static int unavailable_host_feature(FeatureWordInfo *f, uint32_t mask)
                 f->cpuid_eax, reg,
                 f->feat_names[i] ? "." : "",
                 f->feat_names[i] ? f->feat_names[i] : "", i);
-            break;
         }
+    }
     return 0;
 }
 
@@ -1210,12 +1210,10 @@ static int kvm_check_features_against_host(KVMState *s, X86CPU *cpu)
         uint32_t host_feat = kvm_arch_get_supported_cpuid(s, wi->cpuid_eax,
                                                              wi->cpuid_ecx,
                                                              wi->cpuid_reg);
-        uint32_t mask;
-        for (mask = 1; mask; mask <<= 1) {
-            if (guest_feat & mask && !(host_feat & mask)) {
-                unavailable_host_feature(wi, mask);
-                rv = 1;
-            }
+        uint32_t unavailable_features = guest_feat & ~host_feat;
+        if (unavailable_features) {
+            report_unavailable_features(wi, unavailable_features);
+            rv = 1;
         }
     }
     return rv;
-- 
1.8.5.3

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [qom-cpu PATCH 02/10] target-i386: Merge feature filtering/checking functions
  2014-02-28 20:21 [Qemu-devel] [qom-cpu PATCH 00/10] target-i386: Support check/enforce flags in TCG mode, too Eduardo Habkost
  2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 01/10] target-i386: Simplify reporting of unavailable features Eduardo Habkost
@ 2014-02-28 20:21 ` Eduardo Habkost
  2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 03/10] target-i386: Pass FeatureWord argument to report_unavailable_features() Eduardo Habkost
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Habkost @ 2014-02-28 20:21 UTC (permalink / raw)
  To: qemu-devel, Andreas Färber
  Cc: Igor Mammedov, Richard Henderson, Aurelien Jarno, Paolo Bonzini

Merge filter_features_for_kvm() and kvm_check_features_against_host().

Both functions made exactly the same calculations, the only difference
was that filter_features_for_kvm() changed the bits on cpu->features[],
and kvm_check_features_against_host() did error reporting.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target-i386/cpu.c | 53 +++++++++++++++++++----------------------------------
 1 file changed, 19 insertions(+), 34 deletions(-)

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index d62be53..b46478b 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1190,35 +1190,6 @@ static int report_unavailable_features(FeatureWordInfo *f, uint32_t mask)
     return 0;
 }
 
-/* Check if all requested cpu flags are making their way to the guest
- *
- * Returns 0 if all flags are supported by the host, non-zero otherwise.
- *
- * This function may be called only if KVM is enabled.
- */
-static int kvm_check_features_against_host(KVMState *s, X86CPU *cpu)
-{
-    CPUX86State *env = &cpu->env;
-    int rv = 0;
-    FeatureWord w;
-
-    assert(kvm_enabled());
-
-    for (w = 0; w < FEATURE_WORDS; w++) {
-        FeatureWordInfo *wi = &feature_word_info[w];
-        uint32_t guest_feat = env->features[w];
-        uint32_t host_feat = kvm_arch_get_supported_cpuid(s, wi->cpuid_eax,
-                                                             wi->cpuid_ecx,
-                                                             wi->cpuid_reg);
-        uint32_t unavailable_features = guest_feat & ~host_feat;
-        if (unavailable_features) {
-            report_unavailable_features(wi, unavailable_features);
-            rv = 1;
-        }
-    }
-    return rv;
-}
-
 static void x86_cpuid_version_get_family(Object *obj, Visitor *v, void *opaque,
                                          const char *name, Error **errp)
 {
@@ -1798,11 +1769,20 @@ CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp)
     return cpu_list;
 }
 
-static void filter_features_for_kvm(X86CPU *cpu)
+/* Filters CPU feature words based on host availability of each feature
+ *
+ * Returns 0 if all flags are supported by the host, non-zero otherwise.
+ *
+ * This function may be called only if KVM is enabled.
+ */
+static int filter_features_for_kvm(X86CPU *cpu)
 {
     CPUX86State *env = &cpu->env;
     KVMState *s = kvm_state;
     FeatureWord w;
+    int rv = 0;
+
+    assert(kvm_enabled());
 
     for (w = 0; w < FEATURE_WORDS; w++) {
         FeatureWordInfo *wi = &feature_word_info[w];
@@ -1812,7 +1792,15 @@ static void filter_features_for_kvm(X86CPU *cpu)
         uint32_t requested_features = env->features[w];
         env->features[w] &= host_feat;
         cpu->filtered_features[w] = requested_features & ~env->features[w];
+        if (cpu->filtered_features[w]) {
+            if (cpu->check_cpuid || cpu->enforce_cpuid) {
+                report_unavailable_features(wi, cpu->filtered_features[w]);
+            }
+            rv = 1;
+        }
     }
+
+    return rv;
 }
 
 /* Load CPU definition for a given CPU model name
@@ -2539,14 +2527,11 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
         env->features[FEAT_8000_0001_ECX] &= TCG_EXT3_FEATURES;
         env->features[FEAT_SVM] &= TCG_SVM_FEATURES;
     } else {
-        KVMState *s = kvm_state;
-        if ((cpu->check_cpuid || cpu->enforce_cpuid)
-            && kvm_check_features_against_host(s, cpu) && cpu->enforce_cpuid) {
+        if (filter_features_for_kvm(cpu) && cpu->enforce_cpuid) {
             error_setg(&local_err,
                        "Host's CPU doesn't support requested features");
             goto out;
         }
-        filter_features_for_kvm(cpu);
     }
 
 #ifndef CONFIG_USER_ONLY
-- 
1.8.5.3

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [qom-cpu PATCH 03/10] target-i386: Pass FeatureWord argument to report_unavailable_features()
  2014-02-28 20:21 [Qemu-devel] [qom-cpu PATCH 00/10] target-i386: Support check/enforce flags in TCG mode, too Eduardo Habkost
  2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 01/10] target-i386: Simplify reporting of unavailable features Eduardo Habkost
  2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 02/10] target-i386: Merge feature filtering/checking functions Eduardo Habkost
@ 2014-02-28 20:21 ` Eduardo Habkost
  2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 04/10] target-i386: Isolate KVM-specific code on CPU feature filtering logic Eduardo Habkost
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Habkost @ 2014-02-28 20:21 UTC (permalink / raw)
  To: qemu-devel, Andreas Färber
  Cc: Igor Mammedov, Richard Henderson, Aurelien Jarno, Paolo Bonzini

This will help us simplify the code that calls
report_unavailable_features() later.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target-i386/cpu.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index b46478b..af82289 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1172,8 +1172,9 @@ static void kvm_cpu_fill_host(X86CPUDefinition *x86_cpu_def)
     }
 }
 
-static int report_unavailable_features(FeatureWordInfo *f, uint32_t mask)
+static int report_unavailable_features(FeatureWord w, uint32_t mask)
 {
+    FeatureWordInfo *f = &feature_word_info[w];
     int i;
 
     for (i = 0; i < 32; ++i) {
@@ -1794,7 +1795,7 @@ static int filter_features_for_kvm(X86CPU *cpu)
         cpu->filtered_features[w] = requested_features & ~env->features[w];
         if (cpu->filtered_features[w]) {
             if (cpu->check_cpuid || cpu->enforce_cpuid) {
-                report_unavailable_features(wi, cpu->filtered_features[w]);
+                report_unavailable_features(w, cpu->filtered_features[w]);
             }
             rv = 1;
         }
-- 
1.8.5.3

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [qom-cpu PATCH 04/10] target-i386: Isolate KVM-specific code on CPU feature filtering logic
  2014-02-28 20:21 [Qemu-devel] [qom-cpu PATCH 00/10] target-i386: Support check/enforce flags in TCG mode, too Eduardo Habkost
                   ` (2 preceding siblings ...)
  2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 03/10] target-i386: Pass FeatureWord argument to report_unavailable_features() Eduardo Habkost
@ 2014-02-28 20:21 ` Eduardo Habkost
  2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 05/10] target-i386: Make TCG feature filtering more readable Eduardo Habkost
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Habkost @ 2014-02-28 20:21 UTC (permalink / raw)
  To: qemu-devel, Andreas Färber
  Cc: Igor Mammedov, Richard Henderson, Aurelien Jarno, Paolo Bonzini

This will allow us to re-use the feature filtering logic (and the
check/enforce flag logic) for TCG.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target-i386/cpu.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index af82289..7fc0539 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1770,26 +1770,29 @@ CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp)
     return cpu_list;
 }
 
+static uint32_t x86_cpu_get_supported_feature_word(FeatureWord w)
+{
+    FeatureWordInfo *wi = &feature_word_info[w];
+    assert(kvm_enabled());
+    return kvm_arch_get_supported_cpuid(kvm_state, wi->cpuid_eax,
+                                                   wi->cpuid_ecx,
+                                                   wi->cpuid_reg);
+}
+
 /* Filters CPU feature words based on host availability of each feature
  *
  * Returns 0 if all flags are supported by the host, non-zero otherwise.
  *
  * This function may be called only if KVM is enabled.
  */
-static int filter_features_for_kvm(X86CPU *cpu)
+static int x86_cpu_filter_features(X86CPU *cpu)
 {
     CPUX86State *env = &cpu->env;
-    KVMState *s = kvm_state;
     FeatureWord w;
     int rv = 0;
 
-    assert(kvm_enabled());
-
     for (w = 0; w < FEATURE_WORDS; w++) {
-        FeatureWordInfo *wi = &feature_word_info[w];
-        uint32_t host_feat = kvm_arch_get_supported_cpuid(s, wi->cpuid_eax,
-                                                             wi->cpuid_ecx,
-                                                             wi->cpuid_reg);
+        uint32_t host_feat = x86_cpu_get_supported_feature_word(w);
         uint32_t requested_features = env->features[w];
         env->features[w] &= host_feat;
         cpu->filtered_features[w] = requested_features & ~env->features[w];
@@ -2528,7 +2531,7 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
         env->features[FEAT_8000_0001_ECX] &= TCG_EXT3_FEATURES;
         env->features[FEAT_SVM] &= TCG_SVM_FEATURES;
     } else {
-        if (filter_features_for_kvm(cpu) && cpu->enforce_cpuid) {
+        if (x86_cpu_filter_features(cpu) && cpu->enforce_cpuid) {
             error_setg(&local_err,
                        "Host's CPU doesn't support requested features");
             goto out;
-- 
1.8.5.3

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [qom-cpu PATCH 05/10] target-i386: Make TCG feature filtering more readable
  2014-02-28 20:21 [Qemu-devel] [qom-cpu PATCH 00/10] target-i386: Support check/enforce flags in TCG mode, too Eduardo Habkost
                   ` (3 preceding siblings ...)
  2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 04/10] target-i386: Isolate KVM-specific code on CPU feature filtering logic Eduardo Habkost
@ 2014-02-28 20:21 ` Eduardo Habkost
  2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 06/10] target-i386: Filter FEAT_7_0_EBX TCG features too Eduardo Habkost
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Habkost @ 2014-02-28 20:21 UTC (permalink / raw)
  To: qemu-devel, Andreas Färber
  Cc: Igor Mammedov, Richard Henderson, Aurelien Jarno, Paolo Bonzini

Instead of an #ifdef in the middle of the code, just set
TCG_EXT2_FEATURES to a different value depending on TARGET_X86_64.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target-i386/cpu.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 7fc0539..b8919c4 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -532,9 +532,17 @@ typedef struct X86CPUDefinition {
           CPUID_EXT_X2APIC, CPUID_EXT_TSC_DEADLINE_TIMER, CPUID_EXT_XSAVE,
           CPUID_EXT_OSXSAVE, CPUID_EXT_AVX, CPUID_EXT_F16C,
           CPUID_EXT_RDRAND */
+
+#ifdef TARGET_X86_64
+#define TCG_EXT2_X86_64_FEATURES (CPUID_EXT2_SYSCALL | CPUID_EXT2_LM)
+#else
+#define TCG_EXT2_X86_64_FEATURES 0
+#endif
+
 #define TCG_EXT2_FEATURES ((TCG_FEATURES & CPUID_EXT2_AMD_ALIASES) | \
           CPUID_EXT2_NX | CPUID_EXT2_MMXEXT | CPUID_EXT2_RDTSCP | \
-          CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT)
+          CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT | \
+          TCG_EXT2_X86_64_FEATURES)
           /* missing:
           CPUID_EXT2_PDPE1GB */
 #define TCG_EXT3_FEATURES (CPUID_EXT3_LAHF_LM | CPUID_EXT3_SVM | \
@@ -2523,11 +2531,7 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
     if (!kvm_enabled()) {
         env->features[FEAT_1_EDX] &= TCG_FEATURES;
         env->features[FEAT_1_ECX] &= TCG_EXT_FEATURES;
-        env->features[FEAT_8000_0001_EDX] &= (TCG_EXT2_FEATURES
-#ifdef TARGET_X86_64
-            | CPUID_EXT2_SYSCALL | CPUID_EXT2_LM
-#endif
-            );
+        env->features[FEAT_8000_0001_EDX] &= TCG_EXT2_FEATURES;
         env->features[FEAT_8000_0001_ECX] &= TCG_EXT3_FEATURES;
         env->features[FEAT_SVM] &= TCG_SVM_FEATURES;
     } else {
-- 
1.8.5.3

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [qom-cpu PATCH 06/10] target-i386: Filter FEAT_7_0_EBX TCG features too
  2014-02-28 20:21 [Qemu-devel] [qom-cpu PATCH 00/10] target-i386: Support check/enforce flags in TCG mode, too Eduardo Habkost
                   ` (4 preceding siblings ...)
  2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 05/10] target-i386: Make TCG feature filtering more readable Eduardo Habkost
@ 2014-02-28 20:21 ` Eduardo Habkost
  2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 07/10] target-i386: Filter KVM and 0xC0000001 features on TCG Eduardo Habkost
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Habkost @ 2014-02-28 20:21 UTC (permalink / raw)
  To: qemu-devel, Andreas Färber
  Cc: Igor Mammedov, Richard Henderson, Aurelien Jarno, Paolo Bonzini

The TCG_7_0_EBX_FEATURES macro was defined but never used (it even had a
typo that was never noticed). Make the existing TCG feature filtering
code use it.

Change the TCG feature flag filtering code to use it.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target-i386/cpu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index b8919c4..1d954d0 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -548,7 +548,7 @@ typedef struct X86CPUDefinition {
 #define TCG_EXT3_FEATURES (CPUID_EXT3_LAHF_LM | CPUID_EXT3_SVM | \
           CPUID_EXT3_CR8LEG | CPUID_EXT3_ABM | CPUID_EXT3_SSE4A)
 #define TCG_SVM_FEATURES 0
-#define TCG_7_0_EBX_FEATURES (CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_SMAP \
+#define TCG_7_0_EBX_FEATURES (CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_SMAP | \
           CPUID_7_0_EBX_BMI1 | CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ADX)
           /* missing:
           CPUID_7_0_EBX_FSGSBASE, CPUID_7_0_EBX_HLE, CPUID_7_0_EBX_AVX2,
@@ -2531,6 +2531,7 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
     if (!kvm_enabled()) {
         env->features[FEAT_1_EDX] &= TCG_FEATURES;
         env->features[FEAT_1_ECX] &= TCG_EXT_FEATURES;
+        env->features[FEAT_7_0_EBX] &= TCG_7_0_EBX_FEATURES;
         env->features[FEAT_8000_0001_EDX] &= TCG_EXT2_FEATURES;
         env->features[FEAT_8000_0001_ECX] &= TCG_EXT3_FEATURES;
         env->features[FEAT_SVM] &= TCG_SVM_FEATURES;
-- 
1.8.5.3

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [qom-cpu PATCH 07/10] target-i386: Filter KVM and 0xC0000001 features on TCG
  2014-02-28 20:21 [Qemu-devel] [qom-cpu PATCH 00/10] target-i386: Support check/enforce flags in TCG mode, too Eduardo Habkost
                   ` (5 preceding siblings ...)
  2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 06/10] target-i386: Filter FEAT_7_0_EBX TCG features too Eduardo Habkost
@ 2014-02-28 20:21 ` Eduardo Habkost
  2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 08/10] target-i386: Define TCG_*_FEATURES earlier on cpu.c Eduardo Habkost
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Habkost @ 2014-02-28 20:21 UTC (permalink / raw)
  To: qemu-devel, Andreas Färber
  Cc: Igor Mammedov, Richard Henderson, Aurelien Jarno, Paolo Bonzini

TCG doesn't support any of the feature flags on FEAT_KVM and
FEAT_C000_0001_EDX feature words, so clear all bits on those feature
words.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target-i386/cpu.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 1d954d0..997e947 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -547,7 +547,9 @@ typedef struct X86CPUDefinition {
           CPUID_EXT2_PDPE1GB */
 #define TCG_EXT3_FEATURES (CPUID_EXT3_LAHF_LM | CPUID_EXT3_SVM | \
           CPUID_EXT3_CR8LEG | CPUID_EXT3_ABM | CPUID_EXT3_SSE4A)
+#define TCG_EXT4_FEATURES 0
 #define TCG_SVM_FEATURES 0
+#define TCG_KVM_FEATURES 0
 #define TCG_7_0_EBX_FEATURES (CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_SMAP | \
           CPUID_7_0_EBX_BMI1 | CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ADX)
           /* missing:
@@ -2535,6 +2537,8 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
         env->features[FEAT_8000_0001_EDX] &= TCG_EXT2_FEATURES;
         env->features[FEAT_8000_0001_ECX] &= TCG_EXT3_FEATURES;
         env->features[FEAT_SVM] &= TCG_SVM_FEATURES;
+        env->features[FEAT_KVM] &= TCG_KVM_FEATURES;
+        env->features[FEAT_C000_0001_EDX] &= TCG_EXT4_FEATURES;
     } else {
         if (x86_cpu_filter_features(cpu) && cpu->enforce_cpuid) {
             error_setg(&local_err,
-- 
1.8.5.3

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [qom-cpu PATCH 08/10] target-i386: Define TCG_*_FEATURES earlier on cpu.c
  2014-02-28 20:21 [Qemu-devel] [qom-cpu PATCH 00/10] target-i386: Support check/enforce flags in TCG mode, too Eduardo Habkost
                   ` (6 preceding siblings ...)
  2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 07/10] target-i386: Filter KVM and 0xC0000001 features on TCG Eduardo Habkost
@ 2014-02-28 20:21 ` Eduardo Habkost
  2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 09/10] target-i386: Loop-based feature word filtering in TCG mode Eduardo Habkost
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Habkost @ 2014-02-28 20:21 UTC (permalink / raw)
  To: qemu-devel, Andreas Färber
  Cc: Igor Mammedov, Richard Henderson, Aurelien Jarno, Paolo Bonzini

Those macros will be used in the feature_word_info array data, so need
to be defined earlier.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target-i386/cpu.c | 116 +++++++++++++++++++++++++++---------------------------
 1 file changed, 58 insertions(+), 58 deletions(-)

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 997e947..b146d12 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -262,6 +262,64 @@ static const char *cpuid_7_0_ebx_feature_name[] = {
     NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 };
 
+#define I486_FEATURES (CPUID_FP87 | CPUID_VME | CPUID_PSE)
+#define PENTIUM_FEATURES (I486_FEATURES | CPUID_DE | CPUID_TSC | \
+          CPUID_MSR | CPUID_MCE | CPUID_CX8 | CPUID_MMX | CPUID_APIC)
+#define PENTIUM2_FEATURES (PENTIUM_FEATURES | CPUID_PAE | CPUID_SEP | \
+          CPUID_MTRR | CPUID_PGE | CPUID_MCA | CPUID_CMOV | CPUID_PAT | \
+          CPUID_PSE36 | CPUID_FXSR)
+#define PENTIUM3_FEATURES (PENTIUM2_FEATURES | CPUID_SSE)
+#define PPRO_FEATURES (CPUID_FP87 | CPUID_DE | CPUID_PSE | CPUID_TSC | \
+          CPUID_MSR | CPUID_MCE | CPUID_CX8 | CPUID_PGE | CPUID_CMOV | \
+          CPUID_PAT | CPUID_FXSR | CPUID_MMX | CPUID_SSE | CPUID_SSE2 | \
+          CPUID_PAE | CPUID_SEP | CPUID_APIC)
+
+#define TCG_FEATURES (CPUID_FP87 | CPUID_PSE | CPUID_TSC | CPUID_MSR | \
+          CPUID_PAE | CPUID_MCE | CPUID_CX8 | CPUID_APIC | CPUID_SEP | \
+          CPUID_MTRR | CPUID_PGE | CPUID_MCA | CPUID_CMOV | CPUID_PAT | \
+          CPUID_PSE36 | CPUID_CLFLUSH | CPUID_ACPI | CPUID_MMX | \
+          CPUID_FXSR | CPUID_SSE | CPUID_SSE2 | CPUID_SS)
+          /* partly implemented:
+          CPUID_MTRR, CPUID_MCA, CPUID_CLFLUSH (needed for Win64)
+          CPUID_PSE36 (needed for Solaris) */
+          /* missing:
+          CPUID_VME, CPUID_DTS, CPUID_SS, CPUID_HT, CPUID_TM, CPUID_PBE */
+#define TCG_EXT_FEATURES (CPUID_EXT_SSE3 | CPUID_EXT_PCLMULQDQ | \
+          CPUID_EXT_MONITOR | CPUID_EXT_SSSE3 | CPUID_EXT_CX16 | \
+          CPUID_EXT_SSE41 | CPUID_EXT_SSE42 | CPUID_EXT_POPCNT | \
+          CPUID_EXT_MOVBE | CPUID_EXT_AES | CPUID_EXT_HYPERVISOR)
+          /* missing:
+          CPUID_EXT_DTES64, CPUID_EXT_DSCPL, CPUID_EXT_VMX, CPUID_EXT_SMX,
+          CPUID_EXT_EST, CPUID_EXT_TM2, CPUID_EXT_CID, CPUID_EXT_FMA,
+          CPUID_EXT_XTPR, CPUID_EXT_PDCM, CPUID_EXT_PCID, CPUID_EXT_DCA,
+          CPUID_EXT_X2APIC, CPUID_EXT_TSC_DEADLINE_TIMER, CPUID_EXT_XSAVE,
+          CPUID_EXT_OSXSAVE, CPUID_EXT_AVX, CPUID_EXT_F16C,
+          CPUID_EXT_RDRAND */
+
+#ifdef TARGET_X86_64
+#define TCG_EXT2_X86_64_FEATURES (CPUID_EXT2_SYSCALL | CPUID_EXT2_LM)
+#else
+#define TCG_EXT2_X86_64_FEATURES 0
+#endif
+
+#define TCG_EXT2_FEATURES ((TCG_FEATURES & CPUID_EXT2_AMD_ALIASES) | \
+          CPUID_EXT2_NX | CPUID_EXT2_MMXEXT | CPUID_EXT2_RDTSCP | \
+          CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT | \
+          TCG_EXT2_X86_64_FEATURES)
+          /* missing:
+          CPUID_EXT2_PDPE1GB */
+#define TCG_EXT3_FEATURES (CPUID_EXT3_LAHF_LM | CPUID_EXT3_SVM | \
+          CPUID_EXT3_CR8LEG | CPUID_EXT3_ABM | CPUID_EXT3_SSE4A)
+#define TCG_EXT4_FEATURES 0
+#define TCG_SVM_FEATURES 0
+#define TCG_KVM_FEATURES 0
+#define TCG_7_0_EBX_FEATURES (CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_SMAP | \
+          CPUID_7_0_EBX_BMI1 | CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ADX)
+          /* missing:
+          CPUID_7_0_EBX_FSGSBASE, CPUID_7_0_EBX_HLE, CPUID_7_0_EBX_AVX2,
+          CPUID_7_0_EBX_ERMS, CPUID_7_0_EBX_INVPCID, CPUID_7_0_EBX_RTM,
+          CPUID_7_0_EBX_RDSEED */
+
 typedef struct FeatureWordInfo {
     const char **feat_names;
     uint32_t cpuid_eax;   /* Input EAX for CPUID */
@@ -499,64 +557,6 @@ typedef struct X86CPUDefinition {
     bool cache_info_passthrough;
 } X86CPUDefinition;
 
-#define I486_FEATURES (CPUID_FP87 | CPUID_VME | CPUID_PSE)
-#define PENTIUM_FEATURES (I486_FEATURES | CPUID_DE | CPUID_TSC | \
-          CPUID_MSR | CPUID_MCE | CPUID_CX8 | CPUID_MMX | CPUID_APIC)
-#define PENTIUM2_FEATURES (PENTIUM_FEATURES | CPUID_PAE | CPUID_SEP | \
-          CPUID_MTRR | CPUID_PGE | CPUID_MCA | CPUID_CMOV | CPUID_PAT | \
-          CPUID_PSE36 | CPUID_FXSR)
-#define PENTIUM3_FEATURES (PENTIUM2_FEATURES | CPUID_SSE)
-#define PPRO_FEATURES (CPUID_FP87 | CPUID_DE | CPUID_PSE | CPUID_TSC | \
-          CPUID_MSR | CPUID_MCE | CPUID_CX8 | CPUID_PGE | CPUID_CMOV | \
-          CPUID_PAT | CPUID_FXSR | CPUID_MMX | CPUID_SSE | CPUID_SSE2 | \
-          CPUID_PAE | CPUID_SEP | CPUID_APIC)
-
-#define TCG_FEATURES (CPUID_FP87 | CPUID_PSE | CPUID_TSC | CPUID_MSR | \
-          CPUID_PAE | CPUID_MCE | CPUID_CX8 | CPUID_APIC | CPUID_SEP | \
-          CPUID_MTRR | CPUID_PGE | CPUID_MCA | CPUID_CMOV | CPUID_PAT | \
-          CPUID_PSE36 | CPUID_CLFLUSH | CPUID_ACPI | CPUID_MMX | \
-          CPUID_FXSR | CPUID_SSE | CPUID_SSE2 | CPUID_SS)
-          /* partly implemented:
-          CPUID_MTRR, CPUID_MCA, CPUID_CLFLUSH (needed for Win64)
-          CPUID_PSE36 (needed for Solaris) */
-          /* missing:
-          CPUID_VME, CPUID_DTS, CPUID_SS, CPUID_HT, CPUID_TM, CPUID_PBE */
-#define TCG_EXT_FEATURES (CPUID_EXT_SSE3 | CPUID_EXT_PCLMULQDQ | \
-          CPUID_EXT_MONITOR | CPUID_EXT_SSSE3 | CPUID_EXT_CX16 | \
-          CPUID_EXT_SSE41 | CPUID_EXT_SSE42 | CPUID_EXT_POPCNT | \
-          CPUID_EXT_MOVBE | CPUID_EXT_AES | CPUID_EXT_HYPERVISOR)
-          /* missing:
-          CPUID_EXT_DTES64, CPUID_EXT_DSCPL, CPUID_EXT_VMX, CPUID_EXT_SMX,
-          CPUID_EXT_EST, CPUID_EXT_TM2, CPUID_EXT_CID, CPUID_EXT_FMA,
-          CPUID_EXT_XTPR, CPUID_EXT_PDCM, CPUID_EXT_PCID, CPUID_EXT_DCA,
-          CPUID_EXT_X2APIC, CPUID_EXT_TSC_DEADLINE_TIMER, CPUID_EXT_XSAVE,
-          CPUID_EXT_OSXSAVE, CPUID_EXT_AVX, CPUID_EXT_F16C,
-          CPUID_EXT_RDRAND */
-
-#ifdef TARGET_X86_64
-#define TCG_EXT2_X86_64_FEATURES (CPUID_EXT2_SYSCALL | CPUID_EXT2_LM)
-#else
-#define TCG_EXT2_X86_64_FEATURES 0
-#endif
-
-#define TCG_EXT2_FEATURES ((TCG_FEATURES & CPUID_EXT2_AMD_ALIASES) | \
-          CPUID_EXT2_NX | CPUID_EXT2_MMXEXT | CPUID_EXT2_RDTSCP | \
-          CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT | \
-          TCG_EXT2_X86_64_FEATURES)
-          /* missing:
-          CPUID_EXT2_PDPE1GB */
-#define TCG_EXT3_FEATURES (CPUID_EXT3_LAHF_LM | CPUID_EXT3_SVM | \
-          CPUID_EXT3_CR8LEG | CPUID_EXT3_ABM | CPUID_EXT3_SSE4A)
-#define TCG_EXT4_FEATURES 0
-#define TCG_SVM_FEATURES 0
-#define TCG_KVM_FEATURES 0
-#define TCG_7_0_EBX_FEATURES (CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_SMAP | \
-          CPUID_7_0_EBX_BMI1 | CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ADX)
-          /* missing:
-          CPUID_7_0_EBX_FSGSBASE, CPUID_7_0_EBX_HLE, CPUID_7_0_EBX_AVX2,
-          CPUID_7_0_EBX_ERMS, CPUID_7_0_EBX_INVPCID, CPUID_7_0_EBX_RTM,
-          CPUID_7_0_EBX_RDSEED */
-
 /* built-in CPU model definitions
  */
 static X86CPUDefinition builtin_x86_defs[] = {
-- 
1.8.5.3

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [qom-cpu PATCH 09/10] target-i386: Loop-based feature word filtering in TCG mode
  2014-02-28 20:21 [Qemu-devel] [qom-cpu PATCH 00/10] target-i386: Support check/enforce flags in TCG mode, too Eduardo Habkost
                   ` (7 preceding siblings ...)
  2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 08/10] target-i386: Define TCG_*_FEATURES earlier on cpu.c Eduardo Habkost
@ 2014-02-28 20:21 ` Eduardo Habkost
  2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 10/10] target-i386: Support check/enforce flags in TCG mode, too Eduardo Habkost
  2014-02-28 21:32 ` [Qemu-devel] [qom-cpu PATCH 00/10] " Richard Henderson
  10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Habkost @ 2014-02-28 20:21 UTC (permalink / raw)
  To: qemu-devel, Andreas Färber
  Cc: Igor Mammedov, Richard Henderson, Aurelien Jarno, Paolo Bonzini

Instead of manually filtering each feature word, add a tcg_features
field to FeatureWordInfo, and use that field to filter all feature words
in TCG mode.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target-i386/cpu.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index b146d12..f4b2674 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -326,42 +326,51 @@ typedef struct FeatureWordInfo {
     bool cpuid_needs_ecx; /* CPUID instruction uses ECX as input */
     uint32_t cpuid_ecx;   /* Input ECX value for CPUID */
     int cpuid_reg;        /* output register (R_* constant) */
+    uint32_t tcg_features; /* Feature flags supported by TCG */
 } FeatureWordInfo;
 
 static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
     [FEAT_1_EDX] = {
         .feat_names = feature_name,
         .cpuid_eax = 1, .cpuid_reg = R_EDX,
+        .tcg_features = TCG_FEATURES,
     },
     [FEAT_1_ECX] = {
         .feat_names = ext_feature_name,
         .cpuid_eax = 1, .cpuid_reg = R_ECX,
+        .tcg_features = TCG_EXT_FEATURES,
     },
     [FEAT_8000_0001_EDX] = {
         .feat_names = ext2_feature_name,
         .cpuid_eax = 0x80000001, .cpuid_reg = R_EDX,
+        .tcg_features = TCG_EXT2_FEATURES,
     },
     [FEAT_8000_0001_ECX] = {
         .feat_names = ext3_feature_name,
         .cpuid_eax = 0x80000001, .cpuid_reg = R_ECX,
+        .tcg_features = TCG_EXT3_FEATURES,
     },
     [FEAT_C000_0001_EDX] = {
         .feat_names = ext4_feature_name,
         .cpuid_eax = 0xC0000001, .cpuid_reg = R_EDX,
+        .tcg_features = TCG_EXT4_FEATURES,
     },
     [FEAT_KVM] = {
         .feat_names = kvm_feature_name,
         .cpuid_eax = KVM_CPUID_FEATURES, .cpuid_reg = R_EAX,
+        .tcg_features = TCG_KVM_FEATURES,
     },
     [FEAT_SVM] = {
         .feat_names = svm_feature_name,
         .cpuid_eax = 0x8000000A, .cpuid_reg = R_EDX,
+        .tcg_features = TCG_SVM_FEATURES,
     },
     [FEAT_7_0_EBX] = {
         .feat_names = cpuid_7_0_ebx_feature_name,
         .cpuid_eax = 7,
         .cpuid_needs_ecx = true, .cpuid_ecx = 0,
         .cpuid_reg = R_EBX,
+        .tcg_features = TCG_7_0_EBX_FEATURES,
     },
 };
 
@@ -2531,14 +2540,10 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
     }
 
     if (!kvm_enabled()) {
-        env->features[FEAT_1_EDX] &= TCG_FEATURES;
-        env->features[FEAT_1_ECX] &= TCG_EXT_FEATURES;
-        env->features[FEAT_7_0_EBX] &= TCG_7_0_EBX_FEATURES;
-        env->features[FEAT_8000_0001_EDX] &= TCG_EXT2_FEATURES;
-        env->features[FEAT_8000_0001_ECX] &= TCG_EXT3_FEATURES;
-        env->features[FEAT_SVM] &= TCG_SVM_FEATURES;
-        env->features[FEAT_KVM] &= TCG_KVM_FEATURES;
-        env->features[FEAT_C000_0001_EDX] &= TCG_EXT4_FEATURES;
+        FeatureWord w;
+        for (w = 0; w < FEATURE_WORDS; w++) {
+            env->features[w] &= feature_word_info[w].tcg_features;
+        }
     } else {
         if (x86_cpu_filter_features(cpu) && cpu->enforce_cpuid) {
             error_setg(&local_err,
-- 
1.8.5.3

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [qom-cpu PATCH 10/10] target-i386: Support check/enforce flags in TCG mode, too
  2014-02-28 20:21 [Qemu-devel] [qom-cpu PATCH 00/10] target-i386: Support check/enforce flags in TCG mode, too Eduardo Habkost
                   ` (8 preceding siblings ...)
  2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 09/10] target-i386: Loop-based feature word filtering in TCG mode Eduardo Habkost
@ 2014-02-28 20:21 ` Eduardo Habkost
  2014-02-28 21:32 ` [Qemu-devel] [qom-cpu PATCH 00/10] " Richard Henderson
  10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Habkost @ 2014-02-28 20:21 UTC (permalink / raw)
  To: qemu-devel, Andreas Färber
  Cc: Igor Mammedov, Richard Henderson, Aurelien Jarno, Paolo Bonzini

If enforce/check is specified in TCG mode, QEMU will ensure all CPU
features are supported by TCG, so no CPU feature is silently disabled.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target-i386/cpu.c | 34 ++++++++++++++++------------------
 1 file changed, 16 insertions(+), 18 deletions(-)

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index f4b2674..e229112 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1200,8 +1200,9 @@ static int report_unavailable_features(FeatureWord w, uint32_t mask)
         if (1 << i & mask) {
             const char *reg = get_register_name_32(f->cpuid_reg);
             assert(reg);
-            fprintf(stderr, "warning: host doesn't support requested feature: "
+            fprintf(stderr, "warning: %s doesn't support requested feature: "
                 "CPUID.%02XH:%s%s%s [bit %d]\n",
+                kvm_enabled() ? "host" : "TCG",
                 f->cpuid_eax, reg,
                 f->feat_names[i] ? "." : "",
                 f->feat_names[i] ? f->feat_names[i] : "", i);
@@ -1792,17 +1793,18 @@ CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp)
 static uint32_t x86_cpu_get_supported_feature_word(FeatureWord w)
 {
     FeatureWordInfo *wi = &feature_word_info[w];
-    assert(kvm_enabled());
-    return kvm_arch_get_supported_cpuid(kvm_state, wi->cpuid_eax,
-                                                   wi->cpuid_ecx,
-                                                   wi->cpuid_reg);
+    if (kvm_enabled()) {
+        return kvm_arch_get_supported_cpuid(kvm_state, wi->cpuid_eax,
+                                                       wi->cpuid_ecx,
+                                                       wi->cpuid_reg);
+    } else {
+        return wi->tcg_features;
+    }
 }
 
 /* Filters CPU feature words based on host availability of each feature
  *
  * Returns 0 if all flags are supported by the host, non-zero otherwise.
- *
- * This function may be called only if KVM is enabled.
  */
 static int x86_cpu_filter_features(X86CPU *cpu)
 {
@@ -2539,17 +2541,13 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
            & CPUID_EXT2_AMD_ALIASES);
     }
 
-    if (!kvm_enabled()) {
-        FeatureWord w;
-        for (w = 0; w < FEATURE_WORDS; w++) {
-            env->features[w] &= feature_word_info[w].tcg_features;
-        }
-    } else {
-        if (x86_cpu_filter_features(cpu) && cpu->enforce_cpuid) {
-            error_setg(&local_err,
-                       "Host's CPU doesn't support requested features");
-            goto out;
-        }
+
+    if (x86_cpu_filter_features(cpu) && cpu->enforce_cpuid) {
+        error_setg(&local_err,
+                   kvm_enabled() ?
+                       "Host doesn't support requested features" :
+                       "TCG doesn't support requested features");
+        goto out;
     }
 
 #ifndef CONFIG_USER_ONLY
-- 
1.8.5.3

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] [qom-cpu PATCH 00/10] target-i386: Support check/enforce flags in TCG mode, too
  2014-02-28 20:21 [Qemu-devel] [qom-cpu PATCH 00/10] target-i386: Support check/enforce flags in TCG mode, too Eduardo Habkost
                   ` (9 preceding siblings ...)
  2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 10/10] target-i386: Support check/enforce flags in TCG mode, too Eduardo Habkost
@ 2014-02-28 21:32 ` Richard Henderson
  10 siblings, 0 replies; 12+ messages in thread
From: Richard Henderson @ 2014-02-28 21:32 UTC (permalink / raw)
  To: Eduardo Habkost, qemu-devel, Andreas Färber
  Cc: Igor Mammedov, Aurelien Jarno, Paolo Bonzini

On 02/28/2014 12:21 PM, Eduardo Habkost wrote:
> This removes some duplication in the CPU feature checking and filtering code in
> cpu.c, and as a nice side-effect, will make the "check" and "enforce" flags work
> in TCG mode too.
> 
> Eduardo Habkost (10):
>   target-i386: Simplify reporting of unavailable features
>   target-i386: Merge feature filtering/checking functions
>   target-i386: Pass FeatureWord argument to
>     report_unavailable_features()
>   target-i386: Isolate KVM-specific code on CPU feature filtering logic
>   target-i386: Make TCG feature filtering more readable
>   target-i386: Filter FEAT_7_0_EBX TCG features too
>   target-i386: Filter KVM and 0xC0000001 features on TCG
>   target-i386: Define TCG_*_FEATURES earlier on cpu.c
>   target-i386: Loop-based feature word filtering in TCG mode
>   target-i386: Support check/enforce flags in TCG mode, too
> 
>  target-i386/cpu.c | 215 +++++++++++++++++++++++++++---------------------------
>  1 file changed, 107 insertions(+), 108 deletions(-)
> 

Reviewed-by: Richard Henderson <rth@twiddle.net>

r~

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-02-28 21:32 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-28 20:21 [Qemu-devel] [qom-cpu PATCH 00/10] target-i386: Support check/enforce flags in TCG mode, too Eduardo Habkost
2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 01/10] target-i386: Simplify reporting of unavailable features Eduardo Habkost
2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 02/10] target-i386: Merge feature filtering/checking functions Eduardo Habkost
2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 03/10] target-i386: Pass FeatureWord argument to report_unavailable_features() Eduardo Habkost
2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 04/10] target-i386: Isolate KVM-specific code on CPU feature filtering logic Eduardo Habkost
2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 05/10] target-i386: Make TCG feature filtering more readable Eduardo Habkost
2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 06/10] target-i386: Filter FEAT_7_0_EBX TCG features too Eduardo Habkost
2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 07/10] target-i386: Filter KVM and 0xC0000001 features on TCG Eduardo Habkost
2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 08/10] target-i386: Define TCG_*_FEATURES earlier on cpu.c Eduardo Habkost
2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 09/10] target-i386: Loop-based feature word filtering in TCG mode Eduardo Habkost
2014-02-28 20:21 ` [Qemu-devel] [qom-cpu PATCH 10/10] target-i386: Support check/enforce flags in TCG mode, too Eduardo Habkost
2014-02-28 21:32 ` [Qemu-devel] [qom-cpu PATCH 00/10] " Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).