[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH v2 3/7] cpu_x86: Use array of features in CPU map



There's no reason for keeping the features in a linked list. Especially
when we know upfront the total number of features we are loading.

Signed-off-by: Jiri Denemark <jdenemar redhat com>
---
 src/cpu/cpu_x86.c                                  | 121 ++++++++-------------
 tests/cputestdata/x86-baseline-3-expanded.xml      |  62 +++++------
 tests/cputestdata/x86-baseline-4-expanded.xml      |  80 +++++++-------
 tests/cputestdata/x86-baseline-4-result.xml        |  18 +--
 tests/cputestdata/x86-baseline-5-expanded.xml      |  80 +++++++-------
 tests/cputestdata/x86-baseline-5-result.xml        |   8 +-
 tests/cputestdata/x86-baseline-6-migratable.xml    |   8 +-
 tests/cputestdata/x86-baseline-6-result.xml        |  10 +-
 .../cputestdata/x86-host+guest,model486-result.xml |  62 +++++------
 .../x86-host+guest,models,Penryn-result.xml        |  14 +--
 .../x86-host+guest,models,qemu64-result.xml        |  14 +--
 tests/cputestdata/x86-host+guest,models-result.xml |  14 +--
 tests/cputestdata/x86-host+guest-result.xml        |  10 +-
 ...6-host+host+host-model,models,Penryn-result.xml |  28 ++---
 tests/cputestdata/x86-host+min.xml                 |  26 ++---
 tests/cputestdata/x86-host+pentium3.xml            |  46 ++++----
 .../x86-host+strict-force-extra-result.xml         |  28 ++---
 ...aswell-noTSX+Haswell,haswell,Haswell-result.xml |   2 +-
 ...+Haswell-noTSX,haswell,Haswell-noTSX-result.xml |   2 +-
 .../x86-host-better+pentium3,core2duo-result.xml   |  32 +++---
 .../x86-host-better+pentium3,pentium3-result.xml   |  50 ++++-----
 .../x86-host-better+pentium3-result.xml            |  26 ++---
 tests/cputestdata/x86-host-worse+guest-result.xml  |   6 +-
 .../qemuxml2argv-cpu-Haswell2.args                 |   2 +-
 .../qemuxml2argvdata/qemuxml2argv-cpu-exact1.args  |   2 +-
 .../qemuxml2argv-cpu-exact2-nofallback.args        |   2 +-
 .../qemuxml2argvdata/qemuxml2argv-cpu-exact2.args  |   2 +-
 .../qemuxml2argv-cpu-host-model-fallback.args      |   4 +-
 .../qemuxml2argv-cpu-host-model-vendor.args        |   4 +-
 .../qemuxml2argv-cpu-host-model.args               |   4 +-
 .../qemuxml2argv-cpu-minimum1.args                 |   4 +-
 .../qemuxml2argv-cpu-minimum2.args                 |   4 +-
 .../qemuxml2argvdata/qemuxml2argv-cpu-strict1.args |   2 +-
 .../qemuxml2argv-graphics-spice-timeout.args       |   4 +-
 34 files changed, 376 insertions(+), 405 deletions(-)

diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index ca0e9b7..81ff3be 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -56,8 +56,6 @@ typedef virCPUx86Feature *virCPUx86FeaturePtr;
 struct _virCPUx86Feature {
     char *name;
     virCPUx86Data *data;
-
-    virCPUx86FeaturePtr next;
 };
 
 typedef struct _virCPUx86KVMFeature virCPUx86KVMFeature;
@@ -102,10 +100,12 @@ typedef virCPUx86Map *virCPUx86MapPtr;
 struct _virCPUx86Map {
     size_t nvendors;
     virCPUx86VendorPtr *vendors;
-    virCPUx86FeaturePtr features;
+    size_t nfeatures;
+    virCPUx86FeaturePtr *features;
     size_t nmodels;
     virCPUx86ModelPtr *models;
-    virCPUx86FeaturePtr migrate_blockers;
+    size_t nblockers;
+    virCPUx86FeaturePtr *migrate_blockers;
 };
 
 static virCPUx86MapPtr cpuMap;
@@ -412,15 +412,15 @@ x86DataToCPUFeatures(virCPUDefPtr cpu,
                      virCPUx86Data *data,
                      virCPUx86MapPtr map)
 {
-    virCPUx86FeaturePtr feature = map->features;
+    size_t i;
 
-    while (feature) {
+    for (i = 0; i < map->nfeatures; i++) {
+        virCPUx86FeaturePtr feature = map->features[i];
         if (x86DataIsSubset(data, feature->data)) {
             x86DataSubtract(data, feature->data);
             if (virCPUDefAddFeature(cpu, feature->name, policy) < 0)
                 return -1;
         }
-        feature = feature->next;
     }
 
     return 0;
@@ -600,39 +600,14 @@ x86FeatureFree(virCPUx86FeaturePtr feature)
 
 
 static virCPUx86FeaturePtr
-x86FeatureCopy(virCPUx86FeaturePtr src)
-{
-    virCPUx86FeaturePtr feature;
-
-    if (VIR_ALLOC(feature) < 0)
-        return NULL;
-
-    if (VIR_STRDUP(feature->name, src->name) < 0)
-        goto error;
-
-    if (!(feature->data = x86DataCopy(src->data)))
-        goto error;
-
-    return feature;
-
- error:
-    x86FeatureFree(feature);
-    return NULL;
-}
-
-
-static virCPUx86FeaturePtr
 x86FeatureFind(virCPUx86MapPtr map,
                const char *name)
 {
-    virCPUx86FeaturePtr feature;
+    size_t i;
 
-    feature = map->features;
-    while (feature) {
-        if (STREQ(feature->name, name))
-            return feature;
-
-        feature = feature->next;
+    for (i = 0; i < map->nfeatures; i++) {
+        if (STREQ(map->features[i]->name, name))
+            return map->features[i];
     }
 
     return NULL;
@@ -646,21 +621,20 @@ x86FeatureNames(virCPUx86MapPtr map,
 {
     virBuffer ret = VIR_BUFFER_INITIALIZER;
     bool first = true;
-
-    virCPUx86FeaturePtr next_feature = map->features;
+    size_t i;
 
     virBufferAdd(&ret, "", 0);
 
-    while (next_feature) {
-        if (x86DataIsSubset(data, next_feature->data)) {
+    for (i = 0; i < map->nfeatures; i++) {
+        virCPUx86FeaturePtr feature = map->features[i];
+        if (x86DataIsSubset(data, feature->data)) {
             if (!first)
                 virBufferAdd(&ret, separator, -1);
             else
                 first = false;
 
-            virBufferAdd(&ret, next_feature->name, -1);
+            virBufferAdd(&ret, feature->name, -1);
         }
-        next_feature = next_feature->next;
     }
 
     return virBufferContentAndReset(&ret);
@@ -746,19 +720,13 @@ x86FeatureLoad(xmlXPathContextPtr ctxt,
             goto cleanup;
     }
 
-    if (!migratable) {
-        virCPUx86FeaturePtr blocker;
+    if (!migratable &&
+        VIR_APPEND_ELEMENT_COPY(map->migrate_blockers,
+                                map->nblockers, feature) < 0)
+        goto cleanup;
 
-        if (!(blocker = x86FeatureCopy(feature)))
-            goto cleanup;
-
-        blocker->next = map->migrate_blockers;
-        map->migrate_blockers = blocker;
-    }
-
-    feature->next = map->features;
-    map->features = feature;
-    feature = NULL;
+    if (VIR_APPEND_ELEMENT(map->features, map->nfeatures, feature) < 0)
+        goto cleanup;
 
     ret = 0;
 
@@ -1106,11 +1074,9 @@ x86MapFree(virCPUx86MapPtr map)
     if (!map)
         return;
 
-    while (map->features) {
-        virCPUx86FeaturePtr feature = map->features;
-        map->features = feature->next;
-        x86FeatureFree(feature);
-    }
+    for (i = 0; i < map->nfeatures; i++)
+        x86FeatureFree(map->features[i]);
+    VIR_FREE(map->features);
 
     for (i = 0; i < map->nmodels; i++)
         x86ModelFree(map->models[i]);
@@ -1120,11 +1086,10 @@ x86MapFree(virCPUx86MapPtr map)
         x86VendorFree(map->vendors[i]);
     VIR_FREE(map->vendors);
 
-    while (map->migrate_blockers) {
-        virCPUx86FeaturePtr migrate_blocker = map->migrate_blockers;
-        map->migrate_blockers = migrate_blocker->next;
-        x86FeatureFree(migrate_blocker);
-    }
+    /* migrate_blockers only points to the features from map->features list,
+     * which were already freed above
+     */
+    VIR_FREE(map->migrate_blockers);
 
     VIR_FREE(map);
 }
@@ -1157,14 +1122,19 @@ x86MapLoadInternalFeatures(virCPUx86MapPtr map)
 {
     size_t i;
     virCPUx86FeaturePtr feature = NULL;
+    size_t nfeatures = map->nfeatures;
+    size_t count = ARRAY_CARDINALITY(x86_kvm_features);
 
-    for (i = 0; i < ARRAY_CARDINALITY(x86_kvm_features); i++) {
+    if (VIR_EXPAND_N(map->features, nfeatures, count) < 0)
+        goto error;
+
+    for (i = 0; i < count; i++) {
         const char *name = x86_kvm_features[i].name;
 
         if (x86FeatureFind(map, name)) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("CPU feature %s already defined"), name);
-            return -1;
+            goto error;
         }
 
         if (!(feature = x86FeatureNew()))
@@ -1176,8 +1146,7 @@ x86MapLoadInternalFeatures(virCPUx86MapPtr map)
         if (virCPUx86DataAddCPUID(feature->data, &x86_kvm_features[i].cpuid))
             goto error;
 
-        feature->next = map->features;
-        map->features = feature;
+        map->features[map->nfeatures++] = feature;
         feature = NULL;
     }
 
@@ -1651,11 +1620,13 @@ x86Decode(virCPUDefPtr cpu,
      * features directly */
     if (flags & VIR_CONNECT_BASELINE_CPU_MIGRATABLE) {
         for (i = 0; i < cpuModel->nfeatures; i++) {
-            virCPUx86FeaturePtr feat;
-            for (feat = map->migrate_blockers; feat; feat = feat->next) {
-                if (STREQ(feat->name, cpuModel->features[i].name)) {
+            size_t j;
+            for (j = 0; j < map->nblockers; j++) {
+                if (STREQ(map->migrate_blockers[j]->name,
+                          cpuModel->features[i].name)) {
                     VIR_FREE(cpuModel->features[i].name);
-                    VIR_DELETE_ELEMENT_INPLACE(cpuModel->features, i, cpuModel->nfeatures);
+                    VIR_DELETE_ELEMENT_INPLACE(cpuModel->features, i,
+                                               cpuModel->nfeatures);
                 }
             }
         }
@@ -2106,7 +2077,6 @@ x86UpdateHostModel(virCPUDefPtr guest,
 {
     virCPUDefPtr oldguest = NULL;
     virCPUx86MapPtr map;
-    virCPUx86FeaturePtr feat;
     size_t i;
     int ret = -1;
 
@@ -2131,8 +2101,9 @@ x86UpdateHostModel(virCPUDefPtr guest,
      * Note: this only works as long as no CPU model contains non-migratable
      * features directly */
     for (i = 0; i < guest->nfeatures; i++) {
-        for (feat = map->migrate_blockers; feat; feat = feat->next) {
-            if (STREQ(feat->name, guest->features[i].name)) {
+        size_t j;
+        for (j = 0; j < map->nblockers; j++) {
+            if (STREQ(map->migrate_blockers[j]->name, guest->features[i].name)) {
                 VIR_FREE(guest->features[i].name);
                 VIR_DELETE_ELEMENT_INPLACE(guest->features, i, guest->nfeatures);
             }
diff --git a/tests/cputestdata/x86-baseline-3-expanded.xml b/tests/cputestdata/x86-baseline-3-expanded.xml
index a7e57be..f0c2273 100644
--- a/tests/cputestdata/x86-baseline-3-expanded.xml
+++ b/tests/cputestdata/x86-baseline-3-expanded.xml
@@ -1,35 +1,35 @@
 <cpu mode='custom' match='exact'>
   <model fallback='forbid'>Westmere</model>
-  <feature policy='require' name='lahf_lm'/>
-  <feature policy='require' name='lm'/>
-  <feature policy='require' name='nx'/>
-  <feature policy='require' name='syscall'/>
-  <feature policy='require' name='aes'/>
-  <feature policy='require' name='popcnt'/>
-  <feature policy='require' name='sse4.2'/>
-  <feature policy='require' name='sse4.1'/>
-  <feature policy='require' name='cx16'/>
-  <feature policy='require' name='ssse3'/>
-  <feature policy='require' name='pni'/>
-  <feature policy='require' name='sse2'/>
-  <feature policy='require' name='sse'/>
-  <feature policy='require' name='fxsr'/>
-  <feature policy='require' name='mmx'/>
-  <feature policy='require' name='clflush'/>
-  <feature policy='require' name='pse36'/>
-  <feature policy='require' name='pat'/>
-  <feature policy='require' name='cmov'/>
-  <feature policy='require' name='mca'/>
-  <feature policy='require' name='pge'/>
-  <feature policy='require' name='mtrr'/>
-  <feature policy='require' name='sep'/>
-  <feature policy='require' name='apic'/>
-  <feature policy='require' name='cx8'/>
-  <feature policy='require' name='mce'/>
-  <feature policy='require' name='pae'/>
-  <feature policy='require' name='msr'/>
-  <feature policy='require' name='tsc'/>
-  <feature policy='require' name='pse'/>
-  <feature policy='require' name='de'/>
   <feature policy='require' name='fpu'/>
+  <feature policy='require' name='de'/>
+  <feature policy='require' name='pse'/>
+  <feature policy='require' name='tsc'/>
+  <feature policy='require' name='msr'/>
+  <feature policy='require' name='pae'/>
+  <feature policy='require' name='mce'/>
+  <feature policy='require' name='cx8'/>
+  <feature policy='require' name='apic'/>
+  <feature policy='require' name='sep'/>
+  <feature policy='require' name='mtrr'/>
+  <feature policy='require' name='pge'/>
+  <feature policy='require' name='mca'/>
+  <feature policy='require' name='cmov'/>
+  <feature policy='require' name='pat'/>
+  <feature policy='require' name='pse36'/>
+  <feature policy='require' name='clflush'/>
+  <feature policy='require' name='mmx'/>
+  <feature policy='require' name='fxsr'/>
+  <feature policy='require' name='sse'/>
+  <feature policy='require' name='sse2'/>
+  <feature policy='require' name='pni'/>
+  <feature policy='require' name='ssse3'/>
+  <feature policy='require' name='cx16'/>
+  <feature policy='require' name='sse4.1'/>
+  <feature policy='require' name='sse4.2'/>
+  <feature policy='require' name='popcnt'/>
+  <feature policy='require' name='aes'/>
+  <feature policy='require' name='syscall'/>
+  <feature policy='require' name='nx'/>
+  <feature policy='require' name='lm'/>
+  <feature policy='require' name='lahf_lm'/>
 </cpu>
diff --git a/tests/cputestdata/x86-baseline-4-expanded.xml b/tests/cputestdata/x86-baseline-4-expanded.xml
index b5671b5..7e4578e 100644
--- a/tests/cputestdata/x86-baseline-4-expanded.xml
+++ b/tests/cputestdata/x86-baseline-4-expanded.xml
@@ -1,46 +1,46 @@
 <cpu mode='custom' match='exact'>
   <model fallback='forbid'>Westmere</model>
   <vendor>Intel</vendor>
-  <feature policy='require' name='hypervisor'/>
-  <feature policy='require' name='avx'/>
-  <feature policy='require' name='osxsave'/>
-  <feature policy='require' name='xsave'/>
-  <feature policy='require' name='tsc-deadline'/>
-  <feature policy='require' name='x2apic'/>
-  <feature policy='require' name='pcid'/>
-  <feature policy='require' name='pclmuldq'/>
-  <feature policy='require' name='ss'/>
   <feature policy='require' name='vme'/>
-  <feature policy='require' name='lahf_lm'/>
-  <feature policy='require' name='lm'/>
-  <feature policy='require' name='nx'/>
-  <feature policy='require' name='syscall'/>
-  <feature policy='require' name='aes'/>
-  <feature policy='require' name='popcnt'/>
-  <feature policy='require' name='sse4.2'/>
-  <feature policy='require' name='sse4.1'/>
-  <feature policy='require' name='cx16'/>
-  <feature policy='require' name='ssse3'/>
-  <feature policy='require' name='pni'/>
-  <feature policy='require' name='sse2'/>
-  <feature policy='require' name='sse'/>
-  <feature policy='require' name='fxsr'/>
-  <feature policy='require' name='mmx'/>
-  <feature policy='require' name='clflush'/>
-  <feature policy='require' name='pse36'/>
-  <feature policy='require' name='pat'/>
-  <feature policy='require' name='cmov'/>
-  <feature policy='require' name='mca'/>
-  <feature policy='require' name='pge'/>
-  <feature policy='require' name='mtrr'/>
-  <feature policy='require' name='sep'/>
-  <feature policy='require' name='apic'/>
-  <feature policy='require' name='cx8'/>
-  <feature policy='require' name='mce'/>
-  <feature policy='require' name='pae'/>
-  <feature policy='require' name='msr'/>
-  <feature policy='require' name='tsc'/>
-  <feature policy='require' name='pse'/>
-  <feature policy='require' name='de'/>
+  <feature policy='require' name='ss'/>
+  <feature policy='require' name='pclmuldq'/>
+  <feature policy='require' name='pcid'/>
+  <feature policy='require' name='x2apic'/>
+  <feature policy='require' name='tsc-deadline'/>
+  <feature policy='require' name='xsave'/>
+  <feature policy='require' name='osxsave'/>
+  <feature policy='require' name='avx'/>
+  <feature policy='require' name='hypervisor'/>
   <feature policy='require' name='fpu'/>
+  <feature policy='require' name='de'/>
+  <feature policy='require' name='pse'/>
+  <feature policy='require' name='tsc'/>
+  <feature policy='require' name='msr'/>
+  <feature policy='require' name='pae'/>
+  <feature policy='require' name='mce'/>
+  <feature policy='require' name='cx8'/>
+  <feature policy='require' name='apic'/>
+  <feature policy='require' name='sep'/>
+  <feature policy='require' name='mtrr'/>
+  <feature policy='require' name='pge'/>
+  <feature policy='require' name='mca'/>
+  <feature policy='require' name='cmov'/>
+  <feature policy='require' name='pat'/>
+  <feature policy='require' name='pse36'/>
+  <feature policy='require' name='clflush'/>
+  <feature policy='require' name='mmx'/>
+  <feature policy='require' name='fxsr'/>
+  <feature policy='require' name='sse'/>
+  <feature policy='require' name='sse2'/>
+  <feature policy='require' name='pni'/>
+  <feature policy='require' name='ssse3'/>
+  <feature policy='require' name='cx16'/>
+  <feature policy='require' name='sse4.1'/>
+  <feature policy='require' name='sse4.2'/>
+  <feature policy='require' name='popcnt'/>
+  <feature policy='require' name='aes'/>
+  <feature policy='require' name='syscall'/>
+  <feature policy='require' name='nx'/>
+  <feature policy='require' name='lm'/>
+  <feature policy='require' name='lahf_lm'/>
 </cpu>
diff --git a/tests/cputestdata/x86-baseline-4-result.xml b/tests/cputestdata/x86-baseline-4-result.xml
index 44fbc38..1461a5b 100644
--- a/tests/cputestdata/x86-baseline-4-result.xml
+++ b/tests/cputestdata/x86-baseline-4-result.xml
@@ -1,14 +1,14 @@
 <cpu mode='custom' match='exact'>
   <model fallback='forbid'>Westmere</model>
   <vendor>Intel</vendor>
-  <feature policy='require' name='hypervisor'/>
-  <feature policy='require' name='avx'/>
-  <feature policy='require' name='osxsave'/>
-  <feature policy='require' name='xsave'/>
-  <feature policy='require' name='tsc-deadline'/>
-  <feature policy='require' name='x2apic'/>
-  <feature policy='require' name='pcid'/>
-  <feature policy='require' name='pclmuldq'/>
-  <feature policy='require' name='ss'/>
   <feature policy='require' name='vme'/>
+  <feature policy='require' name='ss'/>
+  <feature policy='require' name='pclmuldq'/>
+  <feature policy='require' name='pcid'/>
+  <feature policy='require' name='x2apic'/>
+  <feature policy='require' name='tsc-deadline'/>
+  <feature policy='require' name='xsave'/>
+  <feature policy='require' name='osxsave'/>
+  <feature policy='require' name='avx'/>
+  <feature policy='require' name='hypervisor'/>
 </cpu>
diff --git a/tests/cputestdata/x86-baseline-5-expanded.xml b/tests/cputestdata/x86-baseline-5-expanded.xml
index 2408704..daef2a7 100644
--- a/tests/cputestdata/x86-baseline-5-expanded.xml
+++ b/tests/cputestdata/x86-baseline-5-expanded.xml
@@ -1,47 +1,47 @@
 <cpu mode='custom' match='exact'>
   <model fallback='allow'>SandyBridge</model>
   <vendor>Intel</vendor>
-  <feature policy='require' name='hypervisor'/>
-  <feature policy='require' name='osxsave'/>
-  <feature policy='require' name='pcid'/>
-  <feature policy='require' name='ss'/>
   <feature policy='require' name='vme'/>
+  <feature policy='require' name='ss'/>
+  <feature policy='require' name='pcid'/>
+  <feature policy='require' name='osxsave'/>
+  <feature policy='require' name='hypervisor'/>
   <feature policy='disable' name='rdtscp'/>
-  <feature policy='require' name='lahf_lm'/>
-  <feature policy='require' name='lm'/>
-  <feature policy='require' name='nx'/>
-  <feature policy='require' name='syscall'/>
-  <feature policy='require' name='avx'/>
-  <feature policy='require' name='xsave'/>
-  <feature policy='require' name='aes'/>
-  <feature policy='require' name='tsc-deadline'/>
-  <feature policy='require' name='popcnt'/>
-  <feature policy='require' name='x2apic'/>
-  <feature policy='require' name='sse4.2'/>
-  <feature policy='require' name='sse4.1'/>
-  <feature policy='require' name='cx16'/>
-  <feature policy='require' name='ssse3'/>
-  <feature policy='require' name='pclmuldq'/>
-  <feature policy='require' name='pni'/>
-  <feature policy='require' name='sse2'/>
-  <feature policy='require' name='sse'/>
-  <feature policy='require' name='fxsr'/>
-  <feature policy='require' name='mmx'/>
-  <feature policy='require' name='clflush'/>
-  <feature policy='require' name='pse36'/>
-  <feature policy='require' name='pat'/>
-  <feature policy='require' name='cmov'/>
-  <feature policy='require' name='mca'/>
-  <feature policy='require' name='pge'/>
-  <feature policy='require' name='mtrr'/>
-  <feature policy='require' name='sep'/>
-  <feature policy='require' name='apic'/>
-  <feature policy='require' name='cx8'/>
-  <feature policy='require' name='mce'/>
-  <feature policy='require' name='pae'/>
-  <feature policy='require' name='msr'/>
-  <feature policy='require' name='tsc'/>
-  <feature policy='require' name='pse'/>
-  <feature policy='require' name='de'/>
   <feature policy='require' name='fpu'/>
+  <feature policy='require' name='de'/>
+  <feature policy='require' name='pse'/>
+  <feature policy='require' name='tsc'/>
+  <feature policy='require' name='msr'/>
+  <feature policy='require' name='pae'/>
+  <feature policy='require' name='mce'/>
+  <feature policy='require' name='cx8'/>
+  <feature policy='require' name='apic'/>
+  <feature policy='require' name='sep'/>
+  <feature policy='require' name='mtrr'/>
+  <feature policy='require' name='pge'/>
+  <feature policy='require' name='mca'/>
+  <feature policy='require' name='cmov'/>
+  <feature policy='require' name='pat'/>
+  <feature policy='require' name='pse36'/>
+  <feature policy='require' name='clflush'/>
+  <feature policy='require' name='mmx'/>
+  <feature policy='require' name='fxsr'/>
+  <feature policy='require' name='sse'/>
+  <feature policy='require' name='sse2'/>
+  <feature policy='require' name='pni'/>
+  <feature policy='require' name='pclmuldq'/>
+  <feature policy='require' name='ssse3'/>
+  <feature policy='require' name='cx16'/>
+  <feature policy='require' name='sse4.1'/>
+  <feature policy='require' name='sse4.2'/>
+  <feature policy='require' name='x2apic'/>
+  <feature policy='require' name='popcnt'/>
+  <feature policy='require' name='tsc-deadline'/>
+  <feature policy='require' name='aes'/>
+  <feature policy='require' name='xsave'/>
+  <feature policy='require' name='avx'/>
+  <feature policy='require' name='syscall'/>
+  <feature policy='require' name='nx'/>
+  <feature policy='require' name='lm'/>
+  <feature policy='require' name='lahf_lm'/>
 </cpu>
diff --git a/tests/cputestdata/x86-baseline-5-result.xml b/tests/cputestdata/x86-baseline-5-result.xml
index 3c2f38c..775a27d 100644
--- a/tests/cputestdata/x86-baseline-5-result.xml
+++ b/tests/cputestdata/x86-baseline-5-result.xml
@@ -1,10 +1,10 @@
 <cpu mode='custom' match='exact'>
   <model fallback='allow'>SandyBridge</model>
   <vendor>Intel</vendor>
-  <feature policy='require' name='hypervisor'/>
-  <feature policy='require' name='osxsave'/>
-  <feature policy='require' name='pcid'/>
-  <feature policy='require' name='ss'/>
   <feature policy='require' name='vme'/>
+  <feature policy='require' name='ss'/>
+  <feature policy='require' name='pcid'/>
+  <feature policy='require' name='osxsave'/>
+  <feature policy='require' name='hypervisor'/>
   <feature policy='disable' name='rdtscp'/>
 </cpu>
diff --git a/tests/cputestdata/x86-baseline-6-migratable.xml b/tests/cputestdata/x86-baseline-6-migratable.xml
index 3c2f38c..775a27d 100644
--- a/tests/cputestdata/x86-baseline-6-migratable.xml
+++ b/tests/cputestdata/x86-baseline-6-migratable.xml
@@ -1,10 +1,10 @@
 <cpu mode='custom' match='exact'>
   <model fallback='allow'>SandyBridge</model>
   <vendor>Intel</vendor>
-  <feature policy='require' name='hypervisor'/>
-  <feature policy='require' name='osxsave'/>
-  <feature policy='require' name='pcid'/>
-  <feature policy='require' name='ss'/>
   <feature policy='require' name='vme'/>
+  <feature policy='require' name='ss'/>
+  <feature policy='require' name='pcid'/>
+  <feature policy='require' name='osxsave'/>
+  <feature policy='require' name='hypervisor'/>
   <feature policy='disable' name='rdtscp'/>
 </cpu>
diff --git a/tests/cputestdata/x86-baseline-6-result.xml b/tests/cputestdata/x86-baseline-6-result.xml
index bea0beb..cafca97 100644
--- a/tests/cputestdata/x86-baseline-6-result.xml
+++ b/tests/cputestdata/x86-baseline-6-result.xml
@@ -1,11 +1,11 @@
 <cpu mode='custom' match='exact'>
   <model fallback='allow'>SandyBridge</model>
   <vendor>Intel</vendor>
-  <feature policy='require' name='invtsc'/>
-  <feature policy='require' name='hypervisor'/>
-  <feature policy='require' name='osxsave'/>
-  <feature policy='require' name='pcid'/>
-  <feature policy='require' name='ss'/>
   <feature policy='require' name='vme'/>
+  <feature policy='require' name='ss'/>
+  <feature policy='require' name='pcid'/>
+  <feature policy='require' name='osxsave'/>
+  <feature policy='require' name='hypervisor'/>
+  <feature policy='require' name='invtsc'/>
   <feature policy='disable' name='rdtscp'/>
 </cpu>
diff --git a/tests/cputestdata/x86-host+guest,model486-result.xml b/tests/cputestdata/x86-host+guest,model486-result.xml
index e21c8b8..8bd425d 100644
--- a/tests/cputestdata/x86-host+guest,model486-result.xml
+++ b/tests/cputestdata/x86-host+guest,model486-result.xml
@@ -1,37 +1,37 @@
 <cpu mode='custom' match='exact'>
   <arch>x86_64</arch>
   <model fallback='allow'>486</model>
-  <feature policy='require' name='svm'/>
-  <feature policy='require' name='lahf_lm'/>
-  <feature policy='require' name='3dnowext'/>
-  <feature policy='require' name='lm'/>
-  <feature policy='require' name='nx'/>
-  <feature policy='require' name='syscall'/>
-  <feature policy='require' name='sse4.1'/>
-  <feature policy='require' name='dca'/>
-  <feature policy='require' name='xtpr'/>
-  <feature policy='require' name='cx16'/>
-  <feature policy='require' name='ssse3'/>
-  <feature policy='require' name='monitor'/>
-  <feature policy='require' name='pni'/>
-  <feature policy='require' name='pbe'/>
-  <feature policy='require' name='sse2'/>
-  <feature policy='require' name='fxsr'/>
-  <feature policy='require' name='mmx'/>
-  <feature policy='require' name='clflush'/>
-  <feature policy='require' name='pse36'/>
-  <feature policy='require' name='pat'/>
-  <feature policy='require' name='cmov'/>
-  <feature policy='require' name='mca'/>
-  <feature policy='require' name='pge'/>
-  <feature policy='require' name='mtrr'/>
-  <feature policy='require' name='sep'/>
-  <feature policy='require' name='apic'/>
-  <feature policy='require' name='cx8'/>
-  <feature policy='require' name='mce'/>
-  <feature policy='require' name='pae'/>
-  <feature policy='require' name='msr'/>
-  <feature policy='require' name='tsc'/>
   <feature policy='require' name='de'/>
+  <feature policy='require' name='tsc'/>
+  <feature policy='require' name='msr'/>
+  <feature policy='require' name='pae'/>
+  <feature policy='require' name='mce'/>
+  <feature policy='require' name='cx8'/>
+  <feature policy='require' name='apic'/>
+  <feature policy='require' name='sep'/>
+  <feature policy='require' name='mtrr'/>
+  <feature policy='require' name='pge'/>
+  <feature policy='require' name='mca'/>
+  <feature policy='require' name='cmov'/>
+  <feature policy='require' name='pat'/>
+  <feature policy='require' name='pse36'/>
+  <feature policy='require' name='clflush'/>
+  <feature policy='require' name='mmx'/>
+  <feature policy='require' name='fxsr'/>
+  <feature policy='require' name='sse2'/>
+  <feature policy='require' name='pbe'/>
+  <feature policy='require' name='pni'/>
+  <feature policy='require' name='monitor'/>
+  <feature policy='require' name='ssse3'/>
+  <feature policy='require' name='cx16'/>
+  <feature policy='require' name='xtpr'/>
+  <feature policy='require' name='dca'/>
+  <feature policy='require' name='sse4.1'/>
+  <feature policy='require' name='syscall'/>
+  <feature policy='require' name='nx'/>
+  <feature policy='require' name='lm'/>
+  <feature policy='require' name='3dnowext'/>
+  <feature policy='require' name='lahf_lm'/>
+  <feature policy='require' name='svm'/>
   <feature policy='disable' name='vme'/>
 </cpu>
diff --git a/tests/cputestdata/x86-host+guest,models,Penryn-result.xml b/tests/cputestdata/x86-host+guest,models,Penryn-result.xml
index 6a31dcd..6cd0668 100644
--- a/tests/cputestdata/x86-host+guest,models,Penryn-result.xml
+++ b/tests/cputestdata/x86-host+guest,models,Penryn-result.xml
@@ -1,13 +1,13 @@
 <cpu mode='custom' match='exact'>
   <arch>x86_64</arch>
   <model fallback='allow'>Nehalem</model>
-  <feature policy='require' name='svm'/>
-  <feature policy='require' name='3dnowext'/>
-  <feature policy='require' name='dca'/>
-  <feature policy='require' name='xtpr'/>
-  <feature policy='require' name='monitor'/>
   <feature policy='require' name='pbe'/>
-  <feature policy='disable' name='popcnt'/>
-  <feature policy='disable' name='sse4.2'/>
+  <feature policy='require' name='monitor'/>
+  <feature policy='require' name='xtpr'/>
+  <feature policy='require' name='dca'/>
+  <feature policy='require' name='3dnowext'/>
+  <feature policy='require' name='svm'/>
   <feature policy='disable' name='sse'/>
+  <feature policy='disable' name='sse4.2'/>
+  <feature policy='disable' name='popcnt'/>
 </cpu>
diff --git a/tests/cputestdata/x86-host+guest,models,qemu64-result.xml b/tests/cputestdata/x86-host+guest,models,qemu64-result.xml
index 469d39a..8b170e5 100644
--- a/tests/cputestdata/x86-host+guest,models,qemu64-result.xml
+++ b/tests/cputestdata/x86-host+guest,models,qemu64-result.xml
@@ -1,13 +1,13 @@
 <cpu mode='custom' match='exact'>
   <arch>x86_64</arch>
   <model fallback='allow'>qemu64</model>
-  <feature policy='require' name='lahf_lm'/>
-  <feature policy='require' name='3dnowext'/>
-  <feature policy='require' name='sse4.1'/>
-  <feature policy='require' name='dca'/>
-  <feature policy='require' name='xtpr'/>
-  <feature policy='require' name='ssse3'/>
-  <feature policy='require' name='monitor'/>
   <feature policy='require' name='pbe'/>
+  <feature policy='require' name='monitor'/>
+  <feature policy='require' name='ssse3'/>
+  <feature policy='require' name='xtpr'/>
+  <feature policy='require' name='dca'/>
+  <feature policy='require' name='sse4.1'/>
+  <feature policy='require' name='3dnowext'/>
+  <feature policy='require' name='lahf_lm'/>
   <feature policy='disable' name='sse'/>
 </cpu>
diff --git a/tests/cputestdata/x86-host+guest,models-result.xml b/tests/cputestdata/x86-host+guest,models-result.xml
index 6a31dcd..6cd0668 100644
--- a/tests/cputestdata/x86-host+guest,models-result.xml
+++ b/tests/cputestdata/x86-host+guest,models-result.xml
@@ -1,13 +1,13 @@
 <cpu mode='custom' match='exact'>
   <arch>x86_64</arch>
   <model fallback='allow'>Nehalem</model>
-  <feature policy='require' name='svm'/>
-  <feature policy='require' name='3dnowext'/>
-  <feature policy='require' name='dca'/>
-  <feature policy='require' name='xtpr'/>
-  <feature policy='require' name='monitor'/>
   <feature policy='require' name='pbe'/>
-  <feature policy='disable' name='popcnt'/>
-  <feature policy='disable' name='sse4.2'/>
+  <feature policy='require' name='monitor'/>
+  <feature policy='require' name='xtpr'/>
+  <feature policy='require' name='dca'/>
+  <feature policy='require' name='3dnowext'/>
+  <feature policy='require' name='svm'/>
   <feature policy='disable' name='sse'/>
+  <feature policy='disable' name='sse4.2'/>
+  <feature policy='disable' name='popcnt'/>
 </cpu>
diff --git a/tests/cputestdata/x86-host+guest-result.xml b/tests/cputestdata/x86-host+guest-result.xml
index 9d37dec..6082b7b 100644
--- a/tests/cputestdata/x86-host+guest-result.xml
+++ b/tests/cputestdata/x86-host+guest-result.xml
@@ -1,11 +1,11 @@
 <cpu mode='custom' match='exact'>
   <arch>x86_64</arch>
   <model fallback='allow'>Penryn</model>
-  <feature policy='require' name='svm'/>
-  <feature policy='require' name='3dnowext'/>
-  <feature policy='require' name='dca'/>
-  <feature policy='require' name='xtpr'/>
-  <feature policy='require' name='monitor'/>
   <feature policy='require' name='pbe'/>
+  <feature policy='require' name='monitor'/>
+  <feature policy='require' name='xtpr'/>
+  <feature policy='require' name='dca'/>
+  <feature policy='require' name='3dnowext'/>
+  <feature policy='require' name='svm'/>
   <feature policy='disable' name='sse'/>
 </cpu>
diff --git a/tests/cputestdata/x86-host+host+host-model,models,Penryn-result.xml b/tests/cputestdata/x86-host+host+host-model,models,Penryn-result.xml
index e2b7f5b..2696356 100644
--- a/tests/cputestdata/x86-host+host+host-model,models,Penryn-result.xml
+++ b/tests/cputestdata/x86-host+host+host-model,models,Penryn-result.xml
@@ -1,19 +1,19 @@
 <cpu mode='custom' match='exact'>
   <arch>x86_64</arch>
   <model fallback='allow'>core2duo</model>
-  <feature policy='require' name='lahf_lm'/>
-  <feature policy='require' name='sse4.1'/>
-  <feature policy='require' name='dca'/>
-  <feature policy='require' name='xtpr'/>
-  <feature policy='require' name='cx16'/>
-  <feature policy='require' name='tm2'/>
-  <feature policy='require' name='est'/>
-  <feature policy='require' name='vmx'/>
-  <feature policy='require' name='ds_cpl'/>
-  <feature policy='require' name='pbe'/>
-  <feature policy='require' name='tm'/>
-  <feature policy='require' name='ht'/>
-  <feature policy='require' name='ss'/>
-  <feature policy='require' name='acpi'/>
   <feature policy='require' name='ds'/>
+  <feature policy='require' name='acpi'/>
+  <feature policy='require' name='ss'/>
+  <feature policy='require' name='ht'/>
+  <feature policy='require' name='tm'/>
+  <feature policy='require' name='pbe'/>
+  <feature policy='require' name='ds_cpl'/>
+  <feature policy='require' name='vmx'/>
+  <feature policy='require' name='est'/>
+  <feature policy='require' name='tm2'/>
+  <feature policy='require' name='cx16'/>
+  <feature policy='require' name='xtpr'/>
+  <feature policy='require' name='dca'/>
+  <feature policy='require' name='sse4.1'/>
+  <feature policy='require' name='lahf_lm'/>
 </cpu>
diff --git a/tests/cputestdata/x86-host+min.xml b/tests/cputestdata/x86-host+min.xml
index 8101151..6d2d5cd 100644
--- a/tests/cputestdata/x86-host+min.xml
+++ b/tests/cputestdata/x86-host+min.xml
@@ -1,17 +1,17 @@
 <cpu mode='custom' match='exact'>
   <model fallback='allow'>Penryn</model>
-  <feature policy='require' name='dca'/>
-  <feature policy='require' name='xtpr'/>
-  <feature policy='require' name='tm2'/>
-  <feature policy='require' name='est'/>
-  <feature policy='require' name='vmx'/>
-  <feature policy='require' name='ds_cpl'/>
-  <feature policy='require' name='monitor'/>
-  <feature policy='require' name='pbe'/>
-  <feature policy='require' name='tm'/>
-  <feature policy='require' name='ht'/>
-  <feature policy='require' name='ss'/>
-  <feature policy='require' name='acpi'/>
-  <feature policy='require' name='ds'/>
   <feature policy='require' name='vme'/>
+  <feature policy='require' name='ds'/>
+  <feature policy='require' name='acpi'/>
+  <feature policy='require' name='ss'/>
+  <feature policy='require' name='ht'/>
+  <feature policy='require' name='tm'/>
+  <feature policy='require' name='pbe'/>
+  <feature policy='require' name='monitor'/>
+  <feature policy='require' name='ds_cpl'/>
+  <feature policy='require' name='vmx'/>
+  <feature policy='require' name='est'/>
+  <feature policy='require' name='tm2'/>
+  <feature policy='require' name='xtpr'/>
+  <feature policy='require' name='dca'/>
 </cpu>
diff --git a/tests/cputestdata/x86-host+pentium3.xml b/tests/cputestdata/x86-host+pentium3.xml
index d46525c..a8c15f4 100644
--- a/tests/cputestdata/x86-host+pentium3.xml
+++ b/tests/cputestdata/x86-host+pentium3.xml
@@ -1,27 +1,27 @@
 <cpu mode='custom' match='exact'>
   <model fallback='allow'>pentium3</model>
-  <feature policy='require' name='lahf_lm'/>
-  <feature policy='require' name='lm'/>
-  <feature policy='require' name='nx'/>
-  <feature policy='require' name='syscall'/>
-  <feature policy='require' name='sse4.1'/>
-  <feature policy='require' name='dca'/>
-  <feature policy='require' name='xtpr'/>
-  <feature policy='require' name='cx16'/>
-  <feature policy='require' name='ssse3'/>
-  <feature policy='require' name='tm2'/>
-  <feature policy='require' name='est'/>
-  <feature policy='require' name='vmx'/>
-  <feature policy='require' name='ds_cpl'/>
-  <feature policy='require' name='monitor'/>
-  <feature policy='require' name='pni'/>
-  <feature policy='require' name='pbe'/>
-  <feature policy='require' name='tm'/>
-  <feature policy='require' name='ht'/>
-  <feature policy='require' name='ss'/>
-  <feature policy='require' name='sse2'/>
-  <feature policy='require' name='acpi'/>
-  <feature policy='require' name='ds'/>
-  <feature policy='require' name='clflush'/>
   <feature policy='require' name='apic'/>
+  <feature policy='require' name='clflush'/>
+  <feature policy='require' name='ds'/>
+  <feature policy='require' name='acpi'/>
+  <feature policy='require' name='sse2'/>
+  <feature policy='require' name='ss'/>
+  <feature policy='require' name='ht'/>
+  <feature policy='require' name='tm'/>
+  <feature policy='require' name='pbe'/>
+  <feature policy='require' name='pni'/>
+  <feature policy='require' name='monitor'/>
+  <feature policy='require' name='ds_cpl'/>
+  <feature policy='require' name='vmx'/>
+  <feature policy='require' name='est'/>
+  <feature policy='require' name='tm2'/>
+  <feature policy='require' name='ssse3'/>
+  <feature policy='require' name='cx16'/>
+  <feature policy='require' name='xtpr'/>
+  <feature policy='require' name='dca'/>
+  <feature policy='require' name='sse4.1'/>
+  <feature policy='require' name='syscall'/>
+  <feature policy='require' name='nx'/>
+  <feature policy='require' name='lm'/>
+  <feature policy='require' name='lahf_lm'/>
 </cpu>
diff --git a/tests/cputestdata/x86-host+strict-force-extra-result.xml b/tests/cputestdata/x86-host+strict-force-extra-result.xml
index 68db412..958d458 100644
--- a/tests/cputestdata/x86-host+strict-force-extra-result.xml
+++ b/tests/cputestdata/x86-host+strict-force-extra-result.xml
@@ -1,19 +1,19 @@
 <cpu mode='custom' match='exact'>
   <arch>x86_64</arch>
   <model fallback='allow'>Penryn</model>
-  <feature policy='require' name='3dnow'/>
-  <feature policy='require' name='dca'/>
-  <feature policy='require' name='xtpr'/>
-  <feature policy='require' name='tm2'/>
-  <feature policy='require' name='est'/>
-  <feature policy='require' name='vmx'/>
-  <feature policy='require' name='ds_cpl'/>
-  <feature policy='require' name='monitor'/>
-  <feature policy='require' name='pbe'/>
-  <feature policy='require' name='tm'/>
-  <feature policy='require' name='ht'/>
-  <feature policy='require' name='ss'/>
-  <feature policy='require' name='acpi'/>
-  <feature policy='require' name='ds'/>
   <feature policy='require' name='vme'/>
+  <feature policy='require' name='ds'/>
+  <feature policy='require' name='acpi'/>
+  <feature policy='require' name='ss'/>
+  <feature policy='require' name='ht'/>
+  <feature policy='require' name='tm'/>
+  <feature policy='require' name='pbe'/>
+  <feature policy='require' name='monitor'/>
+  <feature policy='require' name='ds_cpl'/>
+  <feature policy='require' name='vmx'/>
+  <feature policy='require' name='est'/>
+  <feature policy='require' name='tm2'/>
+  <feature policy='require' name='xtpr'/>
+  <feature policy='require' name='dca'/>
+  <feature policy='require' name='3dnow'/>
 </cpu>
diff --git a/tests/cputestdata/x86-host-Haswell-noTSX+Haswell,haswell,Haswell-result.xml b/tests/cputestdata/x86-host-Haswell-noTSX+Haswell,haswell,Haswell-result.xml
index 087aa7d..dfdca13 100644
--- a/tests/cputestdata/x86-host-Haswell-noTSX+Haswell,haswell,Haswell-result.xml
+++ b/tests/cputestdata/x86-host-Haswell-noTSX+Haswell,haswell,Haswell-result.xml
@@ -1,6 +1,6 @@
 <cpu mode='custom' match='exact'>
   <arch>x86_64</arch>
   <model fallback='allow'>Haswell</model>
-  <feature policy='disable' name='rtm'/>
   <feature policy='disable' name='hle'/>
+  <feature policy='disable' name='rtm'/>
 </cpu>
diff --git a/tests/cputestdata/x86-host-Haswell-noTSX+Haswell-noTSX,haswell,Haswell-noTSX-result.xml b/tests/cputestdata/x86-host-Haswell-noTSX+Haswell-noTSX,haswell,Haswell-noTSX-result.xml
index 087aa7d..dfdca13 100644
--- a/tests/cputestdata/x86-host-Haswell-noTSX+Haswell-noTSX,haswell,Haswell-noTSX-result.xml
+++ b/tests/cputestdata/x86-host-Haswell-noTSX+Haswell-noTSX,haswell,Haswell-noTSX-result.xml
@@ -1,6 +1,6 @@
 <cpu mode='custom' match='exact'>
   <arch>x86_64</arch>
   <model fallback='allow'>Haswell</model>
-  <feature policy='disable' name='rtm'/>
   <feature policy='disable' name='hle'/>
+  <feature policy='disable' name='rtm'/>
 </cpu>
diff --git a/tests/cputestdata/x86-host-better+pentium3,core2duo-result.xml b/tests/cputestdata/x86-host-better+pentium3,core2duo-result.xml
index 0c436d9..2bf691c 100644
--- a/tests/cputestdata/x86-host-better+pentium3,core2duo-result.xml
+++ b/tests/cputestdata/x86-host-better+pentium3,core2duo-result.xml
@@ -1,21 +1,21 @@
 <cpu mode='custom' match='exact'>
   <arch>x86_64</arch>
   <model fallback='allow'>core2duo</model>
-  <feature policy='require' name='lahf_lm'/>
-  <feature policy='require' name='popcnt'/>
-  <feature policy='require' name='sse4.2'/>
-  <feature policy='require' name='sse4.1'/>
-  <feature policy='require' name='dca'/>
-  <feature policy='require' name='xtpr'/>
-  <feature policy='require' name='cx16'/>
-  <feature policy='require' name='tm2'/>
-  <feature policy='require' name='est'/>
-  <feature policy='require' name='vmx'/>
-  <feature policy='require' name='ds_cpl'/>
-  <feature policy='require' name='pbe'/>
-  <feature policy='require' name='tm'/>
-  <feature policy='require' name='ht'/>
-  <feature policy='require' name='ss'/>
-  <feature policy='require' name='acpi'/>
   <feature policy='require' name='ds'/>
+  <feature policy='require' name='acpi'/>
+  <feature policy='require' name='ss'/>
+  <feature policy='require' name='ht'/>
+  <feature policy='require' name='tm'/>
+  <feature policy='require' name='pbe'/>
+  <feature policy='require' name='ds_cpl'/>
+  <feature policy='require' name='vmx'/>
+  <feature policy='require' name='est'/>
+  <feature policy='require' name='tm2'/>
+  <feature policy='require' name='cx16'/>
+  <feature policy='require' name='xtpr'/>
+  <feature policy='require' name='dca'/>
+  <feature policy='require' name='sse4.1'/>
+  <feature policy='require' name='sse4.2'/>
+  <feature policy='require' name='popcnt'/>
+  <feature policy='require' name='lahf_lm'/>
 </cpu>
diff --git a/tests/cputestdata/x86-host-better+pentium3,pentium3-result.xml b/tests/cputestdata/x86-host-better+pentium3,pentium3-result.xml
index 1e4f488..d1d0c4b 100644
--- a/tests/cputestdata/x86-host-better+pentium3,pentium3-result.xml
+++ b/tests/cputestdata/x86-host-better+pentium3,pentium3-result.xml
@@ -1,30 +1,30 @@
 <cpu mode='custom' match='exact'>
   <arch>x86_64</arch>
   <model fallback='allow'>pentium3</model>
-  <feature policy='require' name='lahf_lm'/>
-  <feature policy='require' name='lm'/>
-  <feature policy='require' name='nx'/>
-  <feature policy='require' name='syscall'/>
-  <feature policy='require' name='popcnt'/>
-  <feature policy='require' name='sse4.2'/>
-  <feature policy='require' name='sse4.1'/>
-  <feature policy='require' name='dca'/>
-  <feature policy='require' name='xtpr'/>
-  <feature policy='require' name='cx16'/>
-  <feature policy='require' name='ssse3'/>
-  <feature policy='require' name='tm2'/>
-  <feature policy='require' name='est'/>
-  <feature policy='require' name='vmx'/>
-  <feature policy='require' name='ds_cpl'/>
-  <feature policy='require' name='monitor'/>
-  <feature policy='require' name='pni'/>
-  <feature policy='require' name='pbe'/>
-  <feature policy='require' name='tm'/>
-  <feature policy='require' name='ht'/>
-  <feature policy='require' name='ss'/>
-  <feature policy='require' name='sse2'/>
-  <feature policy='require' name='acpi'/>
-  <feature policy='require' name='ds'/>
-  <feature policy='require' name='clflush'/>
   <feature policy='require' name='apic'/>
+  <feature policy='require' name='clflush'/>
+  <feature policy='require' name='ds'/>
+  <feature policy='require' name='acpi'/>
+  <feature policy='require' name='sse2'/>
+  <feature policy='require' name='ss'/>
+  <feature policy='require' name='ht'/>
+  <feature policy='require' name='tm'/>
+  <feature policy='require' name='pbe'/>
+  <feature policy='require' name='pni'/>
+  <feature policy='require' name='monitor'/>
+  <feature policy='require' name='ds_cpl'/>
+  <feature policy='require' name='vmx'/>
+  <feature policy='require' name='est'/>
+  <feature policy='require' name='tm2'/>
+  <feature policy='require' name='ssse3'/>
+  <feature policy='require' name='cx16'/>
+  <feature policy='require' name='xtpr'/>
+  <feature policy='require' name='dca'/>
+  <feature policy='require' name='sse4.1'/>
+  <feature policy='require' name='sse4.2'/>
+  <feature policy='require' name='popcnt'/>
+  <feature policy='require' name='syscall'/>
+  <feature policy='require' name='nx'/>
+  <feature policy='require' name='lm'/>
+  <feature policy='require' name='lahf_lm'/>
 </cpu>
diff --git a/tests/cputestdata/x86-host-better+pentium3-result.xml b/tests/cputestdata/x86-host-better+pentium3-result.xml
index 07be0f7..a37b368 100644
--- a/tests/cputestdata/x86-host-better+pentium3-result.xml
+++ b/tests/cputestdata/x86-host-better+pentium3-result.xml
@@ -1,18 +1,18 @@
 <cpu mode='custom' match='exact'>
   <arch>x86_64</arch>
   <model fallback='allow'>Nehalem</model>
-  <feature policy='require' name='dca'/>
-  <feature policy='require' name='xtpr'/>
-  <feature policy='require' name='tm2'/>
-  <feature policy='require' name='est'/>
-  <feature policy='require' name='vmx'/>
-  <feature policy='require' name='ds_cpl'/>
-  <feature policy='require' name='monitor'/>
-  <feature policy='require' name='pbe'/>
-  <feature policy='require' name='tm'/>
-  <feature policy='require' name='ht'/>
-  <feature policy='require' name='ss'/>
-  <feature policy='require' name='acpi'/>
-  <feature policy='require' name='ds'/>
   <feature policy='require' name='vme'/>
+  <feature policy='require' name='ds'/>
+  <feature policy='require' name='acpi'/>
+  <feature policy='require' name='ss'/>
+  <feature policy='require' name='ht'/>
+  <feature policy='require' name='tm'/>
+  <feature policy='require' name='pbe'/>
+  <feature policy='require' name='monitor'/>
+  <feature policy='require' name='ds_cpl'/>
+  <feature policy='require' name='vmx'/>
+  <feature policy='require' name='est'/>
+  <feature policy='require' name='tm2'/>
+  <feature policy='require' name='xtpr'/>
+  <feature policy='require' name='dca'/>
 </cpu>
diff --git a/tests/cputestdata/x86-host-worse+guest-result.xml b/tests/cputestdata/x86-host-worse+guest-result.xml
index 441259f..6b9c74a 100644
--- a/tests/cputestdata/x86-host-worse+guest-result.xml
+++ b/tests/cputestdata/x86-host-worse+guest-result.xml
@@ -1,9 +1,9 @@
 <cpu mode='custom' match='exact'>
   <arch>x86_64</arch>
   <model fallback='allow'>Penryn</model>
-  <feature policy='require' name='svm'/>
-  <feature policy='require' name='3dnowext'/>
-  <feature policy='require' name='monitor'/>
   <feature policy='require' name='pbe'/>
+  <feature policy='require' name='monitor'/>
+  <feature policy='require' name='3dnowext'/>
+  <feature policy='require' name='svm'/>
   <feature policy='disable' name='sse'/>
 </cpu>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell2.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell2.args
index 3f55ffb..6503a52 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell2.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell2.args
@@ -8,7 +8,7 @@ QEMU_AUDIO_DRV=none \
 -name QEMUGuest1 \
 -S \
 -M pc \
--cpu Haswell,-rtm,-hle \
+-cpu Haswell,-hle,-rtm \
 -m 214 \
 -smp 6 \
 -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.args
index 9c9f53a..971d522 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.args
@@ -8,7 +8,7 @@ QEMU_AUDIO_DRV=none \
 -name QEMUGuest1 \
 -S \
 -M pc \
--cpu qemu64,-svm,-lm,-nx,-syscall,-clflush,-pse36,-mca \
+-cpu qemu64,-mca,-pse36,-clflush,-syscall,-nx,-lm,-svm \
 -m 214 \
 -smp 6 \
 -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2-nofallback.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2-nofallback.args
index 2bc03ca..404878d 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2-nofallback.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2-nofallback.args
@@ -8,7 +8,7 @@ QEMU_AUDIO_DRV=none \
 -name QEMUGuest1 \
 -S \
 -M pc \
--cpu core2duo,+lahf_lm,+3dnowext,+xtpr,+ds_cpl,+tm,+ht,+ds,-nx \
+-cpu core2duo,+ds,+ht,+tm,+ds_cpl,+xtpr,+3dnowext,+lahf_lm,-nx \
 -m 214 \
 -smp 6 \
 -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.args
index 2bc03ca..404878d 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.args
@@ -8,7 +8,7 @@ QEMU_AUDIO_DRV=none \
 -name QEMUGuest1 \
 -S \
 -M pc \
--cpu core2duo,+lahf_lm,+3dnowext,+xtpr,+ds_cpl,+tm,+ht,+ds,-nx \
+-cpu core2duo,+ds,+ht,+tm,+ds_cpl,+xtpr,+3dnowext,+lahf_lm,-nx \
 -m 214 \
 -smp 6 \
 -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-fallback.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-fallback.args
index 07a8504..d96d973 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-fallback.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-fallback.args
@@ -8,8 +8,8 @@ QEMU_AUDIO_DRV=none \
 -name QEMUGuest1 \
 -S \
 -M pc \
--cpu Penryn,+xtpr,+tm2,+est,+vmx,+ds_cpl,+monitor,+pbe,+tm,+ht,+ss,+acpi,+ds,\
-+vme,-sse4.1 \
+-cpu Penryn,+vme,+ds,+acpi,+ss,+ht,+tm,+pbe,+monitor,+ds_cpl,+vmx,+est,+tm2,\
++xtpr,-sse4.1 \
 -m 214 \
 -smp 6 \
 -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-vendor.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-vendor.args
index 4a8cf90..04abe06 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-vendor.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-vendor.args
@@ -8,8 +8,8 @@ QEMU_AUDIO_DRV=none \
 -name QEMUGuest1 \
 -S \
 -M pc \
--cpu 'core2duo,vendor=Libvirt QEMU,+lahf_lm,+xtpr,+cx16,+tm2,+est,+vmx,+ds_cpl,\
-+pbe,+tm,+ht,+ss,+acpi,+ds' \
+-cpu 'core2duo,vendor=Libvirt QEMU,+ds,+acpi,+ss,+ht,+tm,+pbe,+ds_cpl,+vmx,+est,\
++tm2,+cx16,+xtpr,+lahf_lm' \
 -m 214 \
 -smp 6 \
 -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model.args
index b8dd2d4..b6e660c 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model.args
@@ -8,8 +8,8 @@ QEMU_AUDIO_DRV=none \
 -name QEMUGuest1 \
 -S \
 -M pc \
--cpu core2duo,+lahf_lm,+xtpr,+cx16,+tm2,+est,+vmx,+ds_cpl,+pbe,+tm,+ht,+ss,+acpi,\
-+ds \
+-cpu core2duo,+ds,+acpi,+ss,+ht,+tm,+pbe,+ds_cpl,+vmx,+est,+tm2,+cx16,+xtpr,\
++lahf_lm \
 -m 214 \
 -smp 6 \
 -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum1.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum1.args
index 849d945..a7d37fc 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum1.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum1.args
@@ -8,8 +8,8 @@ QEMU_AUDIO_DRV=none \
 -name QEMUGuest1 \
 -S \
 -M pc \
--cpu core2duo,+lahf_lm,+xtpr,+cx16,+tm2,+est,+vmx,+ds_cpl,+pbe,+tm,+ht,+ss,+acpi,\
-+ds \
+-cpu core2duo,+ds,+acpi,+ss,+ht,+tm,+pbe,+ds_cpl,+vmx,+est,+tm2,+cx16,+xtpr,\
++lahf_lm \
 -m 214 \
 -smp 6 \
 -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum2.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum2.args
index 0de55ab..ca6592f 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum2.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum2.args
@@ -8,8 +8,8 @@ QEMU_AUDIO_DRV=none \
 -name QEMUGuest1 \
 -S \
 -M pc \
--cpu core2duo,+lahf_lm,+xtpr,+cx16,+tm2,+est,+vmx,+ds_cpl,+pbe,+tm,+ht,+ss,+acpi,\
-+ds,-lm,-nx,-syscall \
+-cpu core2duo,+ds,+acpi,+ss,+ht,+tm,+pbe,+ds_cpl,+vmx,+est,+tm2,+cx16,+xtpr,\
++lahf_lm,-syscall,-nx,-lm \
 -m 214 \
 -smp 6 \
 -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-strict1.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-strict1.args
index c0b420f..a6b2c1f 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-strict1.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-strict1.args
@@ -8,7 +8,7 @@ QEMU_AUDIO_DRV=none \
 -name QEMUGuest1 \
 -S \
 -M pc \
--cpu core2duo,+lahf_lm,+3dnowext,+xtpr,+est,+vmx,+ds_cpl,+tm,+ht,+acpi,+ds,-nx \
+-cpu core2duo,+ds,+acpi,+ht,+tm,+ds_cpl,+vmx,+est,+xtpr,+3dnowext,+lahf_lm,-nx \
 -m 214 \
 -smp 6 \
 -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.args
index 0950c1b..100a94e 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.args
@@ -8,8 +8,8 @@ QEMU_AUDIO_DRV=spice \
 -name f14 \
 -S \
 -M pc \
--cpu core2duo,+lahf_lm,+xtpr,+cx16,+tm2,+est,+vmx,+ds_cpl,+pbe,+tm,+ht,+ss,+acpi,\
-+ds \
+-cpu core2duo,+ds,+acpi,+ss,+ht,+tm,+pbe,+ds_cpl,+vmx,+est,+tm2,+cx16,+xtpr,\
++lahf_lm \
 -m 1024 \
 -smp 2 \
 -uuid 553effab-b5e1-2d80-dfe3-da4344826c43 \
-- 
2.8.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]