render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
49d448
From b37a398da4323407de24d19afac937eac80170cc Mon Sep 17 00:00:00 2001
49d448
Message-Id: <b37a398da4323407de24d19afac937eac80170cc@dist-git>
49d448
From: Jiri Denemark <jdenemar@redhat.com>
49d448
Date: Thu, 21 Apr 2022 18:25:15 +0200
49d448
Subject: [PATCH] cputest: Add some real world baseline tests
49d448
49d448
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
49d448
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
49d448
(cherry picked from commit 63d633b9a4fc42da7e2acaf45501914607d968a5)
49d448
49d448
https://bugzilla.redhat.com/show_bug.cgi?id=1851227
49d448
49d448
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
49d448
---
49d448
 tests/cputest.c                               | 118 +++++++++++++++---
49d448
 ...id-baseline-Broadwell-IBRS+Cascadelake.xml |  11 ++
49d448
 ..._64-cpuid-baseline-Cascadelake+Icelake.xml |  14 +++
49d448
 ...puid-baseline-Cascadelake+Skylake-IBRS.xml |  12 ++
49d448
 ..._64-cpuid-baseline-Cascadelake+Skylake.xml |   8 ++
49d448
 ...-cpuid-baseline-Cooperlake+Cascadelake.xml |  17 +++
49d448
 ...6_64-cpuid-baseline-Cooperlake+Icelake.xml |  14 +++
49d448
 .../x86_64-cpuid-baseline-EPYC+Rome.xml       |  13 ++
49d448
 .../x86_64-cpuid-baseline-Haswell+Skylake.xml |  14 +++
49d448
 ...-baseline-Haswell-noTSX-IBRS+Broadwell.xml |  14 +++
49d448
 ...seline-Haswell-noTSX-IBRS+Skylake-IBRS.xml |  14 +++
49d448
 ...id-baseline-Haswell-noTSX-IBRS+Skylake.xml |  14 +++
49d448
 .../x86_64-cpuid-baseline-Ryzen+Rome.xml      |  13 ++
49d448
 ...4-cpuid-baseline-Skylake-Client+Server.xml |   9 ++
49d448
 14 files changed, 271 insertions(+), 14 deletions(-)
49d448
 create mode 100644 tests/cputestdata/x86_64-cpuid-baseline-Broadwell-IBRS+Cascadelake.xml
49d448
 create mode 100644 tests/cputestdata/x86_64-cpuid-baseline-Cascadelake+Icelake.xml
49d448
 create mode 100644 tests/cputestdata/x86_64-cpuid-baseline-Cascadelake+Skylake-IBRS.xml
49d448
 create mode 100644 tests/cputestdata/x86_64-cpuid-baseline-Cascadelake+Skylake.xml
49d448
 create mode 100644 tests/cputestdata/x86_64-cpuid-baseline-Cooperlake+Cascadelake.xml
49d448
 create mode 100644 tests/cputestdata/x86_64-cpuid-baseline-Cooperlake+Icelake.xml
49d448
 create mode 100644 tests/cputestdata/x86_64-cpuid-baseline-EPYC+Rome.xml
49d448
 create mode 100644 tests/cputestdata/x86_64-cpuid-baseline-Haswell+Skylake.xml
49d448
 create mode 100644 tests/cputestdata/x86_64-cpuid-baseline-Haswell-noTSX-IBRS+Broadwell.xml
49d448
 create mode 100644 tests/cputestdata/x86_64-cpuid-baseline-Haswell-noTSX-IBRS+Skylake-IBRS.xml
49d448
 create mode 100644 tests/cputestdata/x86_64-cpuid-baseline-Haswell-noTSX-IBRS+Skylake.xml
49d448
 create mode 100644 tests/cputestdata/x86_64-cpuid-baseline-Ryzen+Rome.xml
49d448
 create mode 100644 tests/cputestdata/x86_64-cpuid-baseline-Skylake-Client+Server.xml
49d448
49d448
diff --git a/tests/cputest.c b/tests/cputest.c
49d448
index b939e20718..b39ec7e18b 100644
49d448
--- a/tests/cputest.c
49d448
+++ b/tests/cputest.c
49d448
@@ -58,6 +58,8 @@ struct data {
49d448
     const char *name;
49d448
     virDomainCapsCPUModels *models;
49d448
     const char *modelsName;
49d448
+    const char **cpus;
49d448
+    int ncpus;
49d448
     unsigned int flags;
49d448
     int result;
49d448
 };
49d448
@@ -561,6 +563,60 @@ cpuTestCPUID(bool guest, const void *arg)
49d448
 }
49d448
 
49d448
 
49d448
+static int
49d448
+cpuTestCPUIDBaseline(const void *arg)
49d448
+{
49d448
+    const struct data *data = arg;
49d448
+    int ret = -1;
49d448
+    virCPUDef **cpus = NULL;
49d448
+    virCPUDef *baseline = NULL;
49d448
+    g_autofree char *result = NULL;
49d448
+    size_t i;
49d448
+
49d448
+    cpus = g_new0(virCPUDef *, data->ncpus);
49d448
+    for (i = 0; i < data->ncpus; i++) {
49d448
+        g_autofree char *name = NULL;
49d448
+
49d448
+        name = g_strdup_printf("cpuid-%s-json", data->cpus[i]);
49d448
+        if (!(cpus[i] = cpuTestLoadXML(data->arch, name)))
49d448
+            goto cleanup;
49d448
+    }
49d448
+
49d448
+    baseline = virCPUBaseline(data->arch, cpus, data->ncpus, NULL, NULL, false);
49d448
+    if (!baseline)
49d448
+        goto cleanup;
49d448
+
49d448
+    result = g_strdup_printf("cpuid-baseline-%s", data->name);
49d448
+
49d448
+    if (cpuTestCompareXML(data->arch, baseline, result) < 0)
49d448
+        goto cleanup;
49d448
+
49d448
+    for (i = 0; i < data->ncpus; i++) {
49d448
+        virCPUCompareResult cmp;
49d448
+
49d448
+        cmp = virCPUCompare(data->arch, cpus[i], baseline, false);
49d448
+        if (cmp != VIR_CPU_COMPARE_SUPERSET &&
49d448
+            cmp != VIR_CPU_COMPARE_IDENTICAL) {
49d448
+            VIR_TEST_VERBOSE("\nbaseline CPU is incompatible with CPU %zu", i);
49d448
+            VIR_TEST_VERBOSE("%74s", "... ");
49d448
+            ret = -1;
49d448
+            goto cleanup;
49d448
+        }
49d448
+    }
49d448
+
49d448
+    ret = 0;
49d448
+
49d448
+ cleanup:
49d448
+    if (cpus) {
49d448
+        for (i = 0; i < data->ncpus; i++)
49d448
+            virCPUDefFree(cpus[i]);
49d448
+        VIR_FREE(cpus);
49d448
+    }
49d448
+    virCPUDefFree(baseline);
49d448
+    return ret;
49d448
+}
49d448
+
49d448
+
49d448
 static int
49d448
 cpuTestHostCPUID(const void *arg)
49d448
 {
49d448
@@ -888,13 +944,13 @@ mymain(void)
49d448
         goto cleanup;
49d448
     }
49d448
 
49d448
-#define DO_TEST(arch, api, name, host, cpu, \
49d448
+#define DO_TEST(arch, api, name, host, cpu, cpus, ncpus, \
49d448
                 models, flags, result) \
49d448
     do { \
49d448
         struct data data = { \
49d448
             arch, host, cpu, models, \
49d448
             models == NULL ? NULL : #models, \
49d448
-            flags, result \
49d448
+            cpus, ncpus, flags, result \
49d448
         }; \
49d448
         g_autofree char *testLabel = NULL; \
49d448
  \
49d448
@@ -907,12 +963,12 @@ mymain(void)
49d448
 #define DO_TEST_COMPARE(arch, host, cpu, result) \
49d448
     DO_TEST(arch, cpuTestCompare, \
49d448
             host "/" cpu " (" #result ")", \
49d448
-            host, cpu, NULL, 0, result)
49d448
+            host, cpu, NULL, 0, NULL, 0, result)
49d448
 
49d448
 #define DO_TEST_UPDATE_ONLY(arch, host, cpu) \
49d448
     DO_TEST(arch, cpuTestUpdate, \
49d448
             cpu " on " host, \
49d448
-            host, cpu, NULL, 0, 0)
49d448
+            host, cpu, NULL, 0, NULL, 0, 0)
49d448
 
49d448
 #define DO_TEST_UPDATE(arch, host, cpu, result) \
49d448
     do { \
49d448
@@ -930,31 +986,31 @@ mymain(void)
49d448
             suffix = " (migratable)"; \
49d448
         label = g_strdup_printf("%s%s", name, suffix); \
49d448
         DO_TEST(arch, cpuTestBaseline, label, NULL, \
49d448
-                "baseline-" name, NULL, flags, result); \
49d448
+                "baseline-" name, NULL, 0, NULL, flags, result); \
49d448
     } while (0)
49d448
 
49d448
 #define DO_TEST_HASFEATURE(arch, host, feature, result) \
49d448
     DO_TEST(arch, cpuTestHasFeature, \
49d448
             host "/" feature " (" #result ")", \
49d448
-            host, feature, NULL, 0, result)
49d448
+            host, feature, NULL, 0, NULL, 0, result)
49d448
 
49d448
 #define DO_TEST_GUESTCPU(arch, host, cpu, models, result) \
49d448
     DO_TEST(arch, cpuTestGuestCPU, \
49d448
             host "/" cpu " (" #models ")", \
49d448
-            host, cpu, models, 0, result)
49d448
+            host, cpu, NULL, 0, models, 0, result)
49d448
 
49d448
 #if WITH_QEMU
49d448
 # define DO_TEST_JSON(arch, host, json) \
49d448
     do { \
49d448
         if (json == JSON_MODELS) { \
49d448
             DO_TEST(arch, cpuTestGuestCPUID, host, host, \
49d448
-                    NULL, NULL, 0, 0); \
49d448
+                    NULL, NULL, 0, NULL, 0, 0); \
49d448
         } \
49d448
         if (json != JSON_NONE) { \
49d448
             DO_TEST(arch, cpuTestJSONCPUID, host, host, \
49d448
-                    NULL, NULL, json, 0); \
49d448
+                    NULL, NULL, 0, NULL, json, 0); \
49d448
             DO_TEST(arch, cpuTestJSONSignature, host, host, \
49d448
-                    NULL, NULL, 0, 0); \
49d448
+                    NULL, NULL, 0, NULL, 0, 0); \
49d448
         } \
49d448
     } while (0)
49d448
 #else
49d448
@@ -964,18 +1020,26 @@ mymain(void)
49d448
 #define DO_TEST_CPUID(arch, host, json) \
49d448
     do { \
49d448
         DO_TEST(arch, cpuTestHostCPUID, host, host, \
49d448
-                NULL, NULL, 0, 0); \
49d448
+                NULL, NULL, 0, NULL, 0, 0); \
49d448
         DO_TEST(arch, cpuTestGuestCPUID, host, host, \
49d448
-                NULL, NULL, json, 0); \
49d448
+                NULL, NULL, 0, NULL, json, 0); \
49d448
         DO_TEST(arch, cpuTestCPUIDSignature, host, host, \
49d448
-                NULL, NULL, 0, 0); \
49d448
+                NULL, NULL, 0, NULL, 0, 0); \
49d448
         DO_TEST_JSON(arch, host, json); \
49d448
         if (json != JSON_NONE) { \
49d448
             DO_TEST(arch, cpuTestUpdateLive, host, host, \
49d448
-                    NULL, NULL, json, 0); \
49d448
+                    NULL, NULL, 0, NULL, json, 0); \
49d448
         } \
49d448
     } while (0)
49d448
 
49d448
+#define DO_TEST_CPUID_BASELINE(arch, label, cpu1, cpu2) \
49d448
+    do { \
49d448
+        const char *cpus[] = {cpu1, cpu2}; \
49d448
+        DO_TEST(arch, cpuTestCPUIDBaseline, \
49d448
+                label " (" cpu1 ", " cpu2 ")", \
49d448
+                NULL, label, cpus, 2, NULL, 0, 0); \
49d448
+    } while (0)
49d448
+
49d448
     /* host to host comparison */
49d448
     DO_TEST_COMPARE(VIR_ARCH_X86_64, "host", "host", VIR_CPU_COMPARE_IDENTICAL);
49d448
     DO_TEST_COMPARE(VIR_ARCH_X86_64, "host", "host-better", VIR_CPU_COMPARE_INCOMPATIBLE);
49d448
@@ -1157,6 +1221,32 @@ mymain(void)
49d448
     DO_TEST_CPUID(VIR_ARCH_X86_64, "Ice-Lake-Server", JSON_MODELS);
49d448
     DO_TEST_CPUID(VIR_ARCH_X86_64, "Cooperlake", JSON_MODELS);
49d448
 
49d448
+    DO_TEST_CPUID_BASELINE(VIR_ARCH_X86_64, "Ryzen+Rome",
49d448
+                           "Ryzen-7-1800X-Eight-Core", "Ryzen-9-3900X-12-Core");
49d448
+    DO_TEST_CPUID_BASELINE(VIR_ARCH_X86_64, "EPYC+Rome",
49d448
+                           "EPYC-7601-32-Core", "EPYC-7502-32-Core");
49d448
+    DO_TEST_CPUID_BASELINE(VIR_ARCH_X86_64, "Haswell-noTSX-IBRS+Skylake",
49d448
+                           "Xeon-E5-2609-v3", "Xeon-Gold-6148");
49d448
+    DO_TEST_CPUID_BASELINE(VIR_ARCH_X86_64, "Haswell-noTSX-IBRS+Skylake-IBRS",
49d448
+                           "Xeon-E5-2609-v3", "Xeon-Gold-6130");
49d448
+    DO_TEST_CPUID_BASELINE(VIR_ARCH_X86_64, "Broadwell-IBRS+Cascadelake",
49d448
+                           "Xeon-E5-2623-v4", "Xeon-Platinum-8268");
49d448
+    DO_TEST_CPUID_BASELINE(VIR_ARCH_X86_64, "Cascadelake+Skylake-IBRS",
49d448
+                           "Xeon-Platinum-8268", "Xeon-Gold-6130");
49d448
+    DO_TEST_CPUID_BASELINE(VIR_ARCH_X86_64, "Cascadelake+Skylake",
49d448
+                           "Xeon-Platinum-9242", "Xeon-Gold-6148");
49d448
+    DO_TEST_CPUID_BASELINE(VIR_ARCH_X86_64, "Cascadelake+Icelake",
49d448
+                           "Xeon-Platinum-9242", "Ice-Lake-Server");
49d448
+    DO_TEST_CPUID_BASELINE(VIR_ARCH_X86_64, "Cooperlake+Icelake",
49d448
+                           "Cooperlake", "Ice-Lake-Server");
49d448
+    DO_TEST_CPUID_BASELINE(VIR_ARCH_X86_64, "Cooperlake+Cascadelake",
49d448
+                           "Cooperlake", "Xeon-Platinum-9242");
49d448
+    DO_TEST_CPUID_BASELINE(VIR_ARCH_X86_64, "Skylake-Client+Server",
49d448
+                           "Core-i5-6600", "Xeon-Gold-6148");
49d448
+    DO_TEST_CPUID_BASELINE(VIR_ARCH_X86_64, "Haswell-noTSX-IBRS+Broadwell",
49d448
+                           "Xeon-E5-2609-v3", "Xeon-E5-2650-v4");
49d448
+    DO_TEST_CPUID_BASELINE(VIR_ARCH_X86_64, "Haswell+Skylake",
49d448
+                           "Xeon-E7-8890-v3", "Xeon-Gold-5115");
49d448
  cleanup:
49d448
 #if WITH_QEMU
49d448
     qemuTestDriverFree(&driver);
49d448
diff --git a/tests/cputestdata/x86_64-cpuid-baseline-Broadwell-IBRS+Cascadelake.xml b/tests/cputestdata/x86_64-cpuid-baseline-Broadwell-IBRS+Cascadelake.xml
49d448
new file mode 100644
49d448
index 0000000000..4e3f253e9b
49d448
--- /dev/null
49d448
+++ b/tests/cputestdata/x86_64-cpuid-baseline-Broadwell-IBRS+Cascadelake.xml
49d448
@@ -0,0 +1,11 @@
49d448
+<cpu mode='custom' match='exact'>
49d448
+  <model fallback='allow'>Skylake-Client-IBRS</model>
49d448
+  <vendor>Intel</vendor>
49d448
+  <feature policy='require' name='ss'/>
49d448
+  <feature policy='require' name='hypervisor'/>
49d448
+  <feature policy='require' name='tsc_adjust'/>
49d448
+  <feature policy='require' name='pdpe1gb'/>
49d448
+  <feature policy='disable' name='mpx'/>
49d448
+  <feature policy='disable' name='xsavec'/>
49d448
+  <feature policy='disable' name='xgetbv1'/>
49d448
+</cpu>
49d448
diff --git a/tests/cputestdata/x86_64-cpuid-baseline-Cascadelake+Icelake.xml b/tests/cputestdata/x86_64-cpuid-baseline-Cascadelake+Icelake.xml
49d448
new file mode 100644
49d448
index 0000000000..e372a3e446
49d448
--- /dev/null
49d448
+++ b/tests/cputestdata/x86_64-cpuid-baseline-Cascadelake+Icelake.xml
49d448
@@ -0,0 +1,14 @@
49d448
+<cpu mode='custom' match='exact'>
49d448
+  <model fallback='allow'>Cooperlake</model>
49d448
+  <vendor>Intel</vendor>
49d448
+  <feature policy='require' name='ss'/>
49d448
+  <feature policy='require' name='hypervisor'/>
49d448
+  <feature policy='require' name='tsc_adjust'/>
49d448
+  <feature policy='require' name='mpx'/>
49d448
+  <feature policy='require' name='umip'/>
49d448
+  <feature policy='require' name='xsaves'/>
49d448
+  <feature policy='disable' name='avx512-bf16'/>
49d448
+  <feature policy='disable' name='mds-no'/>
49d448
+  <feature policy='disable' name='pschange-mc-no'/>
49d448
+  <feature policy='disable' name='taa-no'/>
49d448
+</cpu>
49d448
diff --git a/tests/cputestdata/x86_64-cpuid-baseline-Cascadelake+Skylake-IBRS.xml b/tests/cputestdata/x86_64-cpuid-baseline-Cascadelake+Skylake-IBRS.xml
49d448
new file mode 100644
49d448
index 0000000000..e559e01583
49d448
--- /dev/null
49d448
+++ b/tests/cputestdata/x86_64-cpuid-baseline-Cascadelake+Skylake-IBRS.xml
49d448
@@ -0,0 +1,12 @@
49d448
+<cpu mode='custom' match='exact'>
49d448
+  <model fallback='allow'>Cascadelake-Server</model>
49d448
+  <vendor>Intel</vendor>
49d448
+  <feature policy='require' name='ss'/>
49d448
+  <feature policy='require' name='hypervisor'/>
49d448
+  <feature policy='require' name='tsc_adjust'/>
49d448
+  <feature policy='require' name='umip'/>
49d448
+  <feature policy='require' name='pku'/>
49d448
+  <feature policy='require' name='xsaves'/>
49d448
+  <feature policy='require' name='skip-l1dfl-vmentry'/>
49d448
+  <feature policy='disable' name='avx512vnni'/>
49d448
+</cpu>
49d448
diff --git a/tests/cputestdata/x86_64-cpuid-baseline-Cascadelake+Skylake.xml b/tests/cputestdata/x86_64-cpuid-baseline-Cascadelake+Skylake.xml
49d448
new file mode 100644
49d448
index 0000000000..906259df0b
49d448
--- /dev/null
49d448
+++ b/tests/cputestdata/x86_64-cpuid-baseline-Cascadelake+Skylake.xml
49d448
@@ -0,0 +1,8 @@
49d448
+<cpu mode='custom' match='exact'>
49d448
+  <model fallback='allow'>Skylake-Server</model>
49d448
+  <vendor>Intel</vendor>
49d448
+  <feature policy='require' name='ss'/>
49d448
+  <feature policy='require' name='hypervisor'/>
49d448
+  <feature policy='require' name='tsc_adjust'/>
49d448
+  <feature policy='require' name='clflushopt'/>
49d448
+</cpu>
49d448
diff --git a/tests/cputestdata/x86_64-cpuid-baseline-Cooperlake+Cascadelake.xml b/tests/cputestdata/x86_64-cpuid-baseline-Cooperlake+Cascadelake.xml
49d448
new file mode 100644
49d448
index 0000000000..46c32c996f
49d448
--- /dev/null
49d448
+++ b/tests/cputestdata/x86_64-cpuid-baseline-Cooperlake+Cascadelake.xml
49d448
@@ -0,0 +1,17 @@
49d448
+<cpu mode='custom' match='exact'>
49d448
+  <model fallback='allow'>Cooperlake</model>
49d448
+  <vendor>Intel</vendor>
49d448
+  <feature policy='require' name='ss'/>
49d448
+  <feature policy='require' name='vmx'/>
49d448
+  <feature policy='require' name='hypervisor'/>
49d448
+  <feature policy='require' name='tsc_adjust'/>
49d448
+  <feature policy='require' name='mpx'/>
49d448
+  <feature policy='require' name='umip'/>
49d448
+  <feature policy='require' name='md-clear'/>
49d448
+  <feature policy='require' name='xsaves'/>
49d448
+  <feature policy='require' name='ibpb'/>
49d448
+  <feature policy='require' name='amd-ssbd'/>
49d448
+  <feature policy='require' name='tsx-ctrl'/>
49d448
+  <feature policy='disable' name='avx512-bf16'/>
49d448
+  <feature policy='disable' name='taa-no'/>
49d448
+</cpu>
49d448
diff --git a/tests/cputestdata/x86_64-cpuid-baseline-Cooperlake+Icelake.xml b/tests/cputestdata/x86_64-cpuid-baseline-Cooperlake+Icelake.xml
49d448
new file mode 100644
49d448
index 0000000000..e372a3e446
49d448
--- /dev/null
49d448
+++ b/tests/cputestdata/x86_64-cpuid-baseline-Cooperlake+Icelake.xml
49d448
@@ -0,0 +1,14 @@
49d448
+<cpu mode='custom' match='exact'>
49d448
+  <model fallback='allow'>Cooperlake</model>
49d448
+  <vendor>Intel</vendor>
49d448
+  <feature policy='require' name='ss'/>
49d448
+  <feature policy='require' name='hypervisor'/>
49d448
+  <feature policy='require' name='tsc_adjust'/>
49d448
+  <feature policy='require' name='mpx'/>
49d448
+  <feature policy='require' name='umip'/>
49d448
+  <feature policy='require' name='xsaves'/>
49d448
+  <feature policy='disable' name='avx512-bf16'/>
49d448
+  <feature policy='disable' name='mds-no'/>
49d448
+  <feature policy='disable' name='pschange-mc-no'/>
49d448
+  <feature policy='disable' name='taa-no'/>
49d448
+</cpu>
49d448
diff --git a/tests/cputestdata/x86_64-cpuid-baseline-EPYC+Rome.xml b/tests/cputestdata/x86_64-cpuid-baseline-EPYC+Rome.xml
49d448
new file mode 100644
49d448
index 0000000000..e1984b2890
49d448
--- /dev/null
49d448
+++ b/tests/cputestdata/x86_64-cpuid-baseline-EPYC+Rome.xml
49d448
@@ -0,0 +1,13 @@
49d448
+<cpu mode='custom' match='exact'>
49d448
+  <model fallback='allow'>EPYC</model>
49d448
+  <vendor>AMD</vendor>
49d448
+  <feature policy='require' name='x2apic'/>
49d448
+  <feature policy='require' name='tsc-deadline'/>
49d448
+  <feature policy='require' name='hypervisor'/>
49d448
+  <feature policy='require' name='tsc_adjust'/>
49d448
+  <feature policy='require' name='cmp_legacy'/>
49d448
+  <feature policy='require' name='npt'/>
49d448
+  <feature policy='require' name='nrip-save'/>
49d448
+  <feature policy='disable' name='svm'/>
49d448
+  <feature policy='disable' name='monitor'/>
49d448
+</cpu>
49d448
diff --git a/tests/cputestdata/x86_64-cpuid-baseline-Haswell+Skylake.xml b/tests/cputestdata/x86_64-cpuid-baseline-Haswell+Skylake.xml
49d448
new file mode 100644
49d448
index 0000000000..e687a679b3
49d448
--- /dev/null
49d448
+++ b/tests/cputestdata/x86_64-cpuid-baseline-Haswell+Skylake.xml
49d448
@@ -0,0 +1,14 @@
49d448
+<cpu mode='custom' match='exact'>
49d448
+  <model fallback='allow'>Haswell</model>
49d448
+  <vendor>Intel</vendor>
49d448
+  <feature policy='require' name='vme'/>
49d448
+  <feature policy='require' name='ss'/>
49d448
+  <feature policy='require' name='f16c'/>
49d448
+  <feature policy='require' name='rdrand'/>
49d448
+  <feature policy='require' name='hypervisor'/>
49d448
+  <feature policy='require' name='arat'/>
49d448
+  <feature policy='require' name='tsc_adjust'/>
49d448
+  <feature policy='require' name='xsaveopt'/>
49d448
+  <feature policy='require' name='pdpe1gb'/>
49d448
+  <feature policy='require' name='abm'/>
49d448
+</cpu>
49d448
diff --git a/tests/cputestdata/x86_64-cpuid-baseline-Haswell-noTSX-IBRS+Broadwell.xml b/tests/cputestdata/x86_64-cpuid-baseline-Haswell-noTSX-IBRS+Broadwell.xml
49d448
new file mode 100644
49d448
index 0000000000..651457b17a
49d448
--- /dev/null
49d448
+++ b/tests/cputestdata/x86_64-cpuid-baseline-Haswell-noTSX-IBRS+Broadwell.xml
49d448
@@ -0,0 +1,14 @@
49d448
+<cpu mode='custom' match='exact'>
49d448
+  <model fallback='allow'>Haswell-noTSX</model>
49d448
+  <vendor>Intel</vendor>
49d448
+  <feature policy='require' name='vme'/>
49d448
+  <feature policy='require' name='ss'/>
49d448
+  <feature policy='require' name='f16c'/>
49d448
+  <feature policy='require' name='rdrand'/>
49d448
+  <feature policy='require' name='hypervisor'/>
49d448
+  <feature policy='require' name='arat'/>
49d448
+  <feature policy='require' name='tsc_adjust'/>
49d448
+  <feature policy='require' name='xsaveopt'/>
49d448
+  <feature policy='require' name='pdpe1gb'/>
49d448
+  <feature policy='require' name='abm'/>
49d448
+</cpu>
49d448
diff --git a/tests/cputestdata/x86_64-cpuid-baseline-Haswell-noTSX-IBRS+Skylake-IBRS.xml b/tests/cputestdata/x86_64-cpuid-baseline-Haswell-noTSX-IBRS+Skylake-IBRS.xml
49d448
new file mode 100644
49d448
index 0000000000..8bda1c02e2
49d448
--- /dev/null
49d448
+++ b/tests/cputestdata/x86_64-cpuid-baseline-Haswell-noTSX-IBRS+Skylake-IBRS.xml
49d448
@@ -0,0 +1,14 @@
49d448
+<cpu mode='custom' match='exact'>
49d448
+  <model fallback='allow'>Haswell-noTSX-IBRS</model>
49d448
+  <vendor>Intel</vendor>
49d448
+  <feature policy='require' name='vme'/>
49d448
+  <feature policy='require' name='ss'/>
49d448
+  <feature policy='require' name='f16c'/>
49d448
+  <feature policy='require' name='rdrand'/>
49d448
+  <feature policy='require' name='hypervisor'/>
49d448
+  <feature policy='require' name='arat'/>
49d448
+  <feature policy='require' name='tsc_adjust'/>
49d448
+  <feature policy='require' name='xsaveopt'/>
49d448
+  <feature policy='require' name='pdpe1gb'/>
49d448
+  <feature policy='require' name='abm'/>
49d448
+</cpu>
49d448
diff --git a/tests/cputestdata/x86_64-cpuid-baseline-Haswell-noTSX-IBRS+Skylake.xml b/tests/cputestdata/x86_64-cpuid-baseline-Haswell-noTSX-IBRS+Skylake.xml
49d448
new file mode 100644
49d448
index 0000000000..651457b17a
49d448
--- /dev/null
49d448
+++ b/tests/cputestdata/x86_64-cpuid-baseline-Haswell-noTSX-IBRS+Skylake.xml
49d448
@@ -0,0 +1,14 @@
49d448
+<cpu mode='custom' match='exact'>
49d448
+  <model fallback='allow'>Haswell-noTSX</model>
49d448
+  <vendor>Intel</vendor>
49d448
+  <feature policy='require' name='vme'/>
49d448
+  <feature policy='require' name='ss'/>
49d448
+  <feature policy='require' name='f16c'/>
49d448
+  <feature policy='require' name='rdrand'/>
49d448
+  <feature policy='require' name='hypervisor'/>
49d448
+  <feature policy='require' name='arat'/>
49d448
+  <feature policy='require' name='tsc_adjust'/>
49d448
+  <feature policy='require' name='xsaveopt'/>
49d448
+  <feature policy='require' name='pdpe1gb'/>
49d448
+  <feature policy='require' name='abm'/>
49d448
+</cpu>
49d448
diff --git a/tests/cputestdata/x86_64-cpuid-baseline-Ryzen+Rome.xml b/tests/cputestdata/x86_64-cpuid-baseline-Ryzen+Rome.xml
49d448
new file mode 100644
49d448
index 0000000000..051402b9d5
49d448
--- /dev/null
49d448
+++ b/tests/cputestdata/x86_64-cpuid-baseline-Ryzen+Rome.xml
49d448
@@ -0,0 +1,13 @@
49d448
+<cpu mode='custom' match='exact'>
49d448
+  <model fallback='allow'>EPYC</model>
49d448
+  <vendor>AMD</vendor>
49d448
+  <feature policy='require' name='x2apic'/>
49d448
+  <feature policy='require' name='tsc-deadline'/>
49d448
+  <feature policy='require' name='hypervisor'/>
49d448
+  <feature policy='require' name='tsc_adjust'/>
49d448
+  <feature policy='require' name='cmp_legacy'/>
49d448
+  <feature policy='require' name='npt'/>
49d448
+  <feature policy='require' name='nrip-save'/>
49d448
+  <feature policy='disable' name='sha-ni'/>
49d448
+  <feature policy='disable' name='monitor'/>
49d448
+</cpu>
49d448
diff --git a/tests/cputestdata/x86_64-cpuid-baseline-Skylake-Client+Server.xml b/tests/cputestdata/x86_64-cpuid-baseline-Skylake-Client+Server.xml
49d448
new file mode 100644
49d448
index 0000000000..d46ff26eeb
49d448
--- /dev/null
49d448
+++ b/tests/cputestdata/x86_64-cpuid-baseline-Skylake-Client+Server.xml
49d448
@@ -0,0 +1,9 @@
49d448
+<cpu mode='custom' match='exact'>
49d448
+  <model fallback='allow'>Skylake-Client</model>
49d448
+  <vendor>Intel</vendor>
49d448
+  <feature policy='require' name='ss'/>
49d448
+  <feature policy='require' name='hypervisor'/>
49d448
+  <feature policy='require' name='tsc_adjust'/>
49d448
+  <feature policy='require' name='clflushopt'/>
49d448
+  <feature policy='require' name='pdpe1gb'/>
49d448
+</cpu>
49d448
-- 
49d448
2.35.1
49d448