79b470
From b177f66b37d0c64216ec579a5211461609a96ea8 Mon Sep 17 00:00:00 2001
79b470
Message-Id: <b177f66b37d0c64216ec579a5211461609a96ea8@dist-git>
79b470
From: Tim Wiederhake <twiederh@redhat.com>
79b470
Date: Fri, 15 Jan 2021 15:17:22 +0100
79b470
Subject: [PATCH] cpu_map: Define and enable Snowridge model
79b470
79b470
Due to missing pdpe1gb support in the host CPU data, the CPU is still
79b470
incorrectly detected as Westmere-IBRS for host capabilities because we
79b470
don't have the option to disable features included in the base model
79b470
there.
79b470
79b470
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
79b470
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
79b470
(cherry picked from commit f0a5cf4b8a8b5a68348df5e8b197f30dd90b3c34)
79b470
79b470
https://bugzilla.redhat.com/show_bug.cgi?id=1537734
79b470
79b470
Conflicts:
79b470
- src/cpu_map/index.xml: Context
79b470
- src/cpu_map/meson.build: Not present downstream
79b470
- tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml: Not present downstream
79b470
- tests/domaincapsdata/qemu_5.1.0-tcg.x86_64.xml: Not present downstream
79b470
- tests/domaincapsdata/qemu_5.1.0.x86_64.xml: Not present downstream
79b470
- tests/domaincapsdata/qemu_5.2.0-q35.x86_64.xml: Not present downstream
79b470
- tests/domaincapsdata/qemu_5.2.0-tcg.x86_64.xml: Not present downstream
79b470
- tests/domaincapsdata/qemu_5.2.0.x86_64.xml: Not present downstream
79b470
79b470
Additions:
79b470
- src/cpu_map/Makefile.inc.am: Replaces upstream change of "meson.build"
79b470
79b470
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
79b470
Message-Id: <20210115141722.14986-7-twiederh@redhat.com>
79b470
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
79b470
---
79b470
 src/cpu_map/Makefile.inc.am                   |  1 +
79b470
 src/cpu_map/index.xml                         |  1 +
79b470
 src/cpu_map/x86_Snowridge.xml                 | 71 +++++++++++++++++++
79b470
 .../x86_64-cpuid-Atom-P5362-guest.xml         | 28 ++------
79b470
 .../x86_64-cpuid-Atom-P5362-json.xml          | 26 ++-----
79b470
 .../domaincapsdata/qemu_4.1.0-q35.x86_64.xml  |  1 +
79b470
 .../domaincapsdata/qemu_4.1.0-tcg.x86_64.xml  |  1 +
79b470
 tests/domaincapsdata/qemu_4.1.0.x86_64.xml    |  1 +
79b470
 .../domaincapsdata/qemu_4.2.0-q35.x86_64.xml  |  1 +
79b470
 .../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml  |  1 +
79b470
 tests/domaincapsdata/qemu_4.2.0.x86_64.xml    |  1 +
79b470
 .../domaincapsdata/qemu_5.0.0-q35.x86_64.xml  |  1 +
79b470
 .../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml  |  1 +
79b470
 tests/domaincapsdata/qemu_5.0.0.x86_64.xml    |  1 +
79b470
 14 files changed, 92 insertions(+), 44 deletions(-)
79b470
 create mode 100644 src/cpu_map/x86_Snowridge.xml
79b470
79b470
diff --git a/src/cpu_map/Makefile.inc.am b/src/cpu_map/Makefile.inc.am
79b470
index aad4b410f9..1dd78c6715 100644
79b470
--- a/src/cpu_map/Makefile.inc.am
79b470
+++ b/src/cpu_map/Makefile.inc.am
79b470
@@ -67,6 +67,7 @@ cpumap_DATA = \
79b470
 	cpu_map/x86_Skylake-Server.xml \
79b470
 	cpu_map/x86_Skylake-Server-IBRS.xml \
79b470
 	cpu_map/x86_Skylake-Server-noTSX-IBRS.xml \
79b470
+	cpu_map/x86_Snowridge.xml \
79b470
 	cpu_map/x86_Westmere.xml \
79b470
 	cpu_map/x86_Westmere-IBRS.xml \
79b470
 	$(NULL)
79b470
diff --git a/src/cpu_map/index.xml b/src/cpu_map/index.xml
79b470
index 633b017a93..2f58261e6d 100644
79b470
--- a/src/cpu_map/index.xml
79b470
+++ b/src/cpu_map/index.xml
79b470
@@ -55,6 +55,7 @@
79b470
     <include filename="x86_Icelake-Server.xml"/>
79b470
     <include filename="x86_Icelake-Server-noTSX.xml"/>
79b470
     <include filename="x86_Cooperlake.xml"/>
79b470
+    <include filename='x86_Snowridge.xml'/>
79b470
 
79b470
     
79b470
     <include filename="x86_athlon.xml"/>
79b470
diff --git a/src/cpu_map/x86_Snowridge.xml b/src/cpu_map/x86_Snowridge.xml
79b470
new file mode 100644
79b470
index 0000000000..383a24d367
79b470
--- /dev/null
79b470
+++ b/src/cpu_map/x86_Snowridge.xml
79b470
@@ -0,0 +1,71 @@
79b470
+<cpus>
79b470
+  <model name='Snowridge'>
79b470
+    <decode host='on' guest='on'/>
79b470
+    <signature family='6' model='134'/> 
79b470
+    <vendor name='Intel'/>
79b470
+    <feature name='3dnowprefetch'/>
79b470
+    <feature name='aes'/>
79b470
+    <feature name='apic'/>
79b470
+    <feature name='arat'/>
79b470
+    <feature name='arch-capabilities'/>
79b470
+    <feature name='cldemote'/>
79b470
+    <feature name='clflush'/>
79b470
+    <feature name='clflushopt'/>
79b470
+    <feature name='clwb'/>
79b470
+    <feature name='cmov'/>
79b470
+    <feature name='core-capability'/>
79b470
+    <feature name='cx16'/>
79b470
+    <feature name='cx8'/>
79b470
+    <feature name='de'/>
79b470
+    <feature name='erms'/>
79b470
+    <feature name='fpu'/>
79b470
+    <feature name='fsgsbase'/>
79b470
+    <feature name='fxsr'/>
79b470
+    <feature name='gfni'/>
79b470
+    <feature name='lahf_lm'/>
79b470
+    <feature name='lm'/>
79b470
+    <feature name='mca'/>
79b470
+    <feature name='mce'/>
79b470
+    <feature name='mmx'/>
79b470
+    <feature name='movbe'/>
79b470
+    <feature name='movdir64b'/>
79b470
+    <feature name='movdiri'/>
79b470
+    <feature name='msr'/>
79b470
+    <feature name='mtrr'/>
79b470
+    <feature name='nx'/>
79b470
+    <feature name='pae'/>
79b470
+    <feature name='pat'/>
79b470
+    <feature name='pclmuldq'/>
79b470
+    <feature name='pdpe1gb'/>
79b470
+    <feature name='pge'/>
79b470
+    <feature name='pni'/>
79b470
+    <feature name='popcnt'/>
79b470
+    <feature name='pse'/>
79b470
+    <feature name='pse36'/>
79b470
+    <feature name='rdrand'/>
79b470
+    <feature name='rdseed'/>
79b470
+    <feature name='rdtscp'/>
79b470
+    <feature name='sep'/>
79b470
+    <feature name='sha-ni'/>
79b470
+    <feature name='smap'/>
79b470
+    <feature name='smep'/>
79b470
+    <feature name='spec-ctrl'/>
79b470
+    <feature name='split-lock-detect'/>
79b470
+    <feature name='ssbd'/>
79b470
+    <feature name='sse'/>
79b470
+    <feature name='sse2'/>
79b470
+    <feature name='sse4.1'/>
79b470
+    <feature name='sse4.2'/>
79b470
+    <feature name='ssse3'/>
79b470
+    <feature name='syscall'/>
79b470
+    <feature name='tsc'/>
79b470
+    <feature name='tsc-deadline'/>
79b470
+    <feature name='umip'/>
79b470
+    <feature name='vme'/>
79b470
+    <feature name='x2apic'/>
79b470
+    <feature name='xgetbv1'/>
79b470
+    <feature name='xsave'/>
79b470
+    <feature name='xsavec'/>
79b470
+    <feature name='xsaveopt'/>
79b470
+  </model>
79b470
+</cpus>
79b470
diff --git a/tests/cputestdata/x86_64-cpuid-Atom-P5362-guest.xml b/tests/cputestdata/x86_64-cpuid-Atom-P5362-guest.xml
79b470
index 2eeff136c4..f28e70b9e0 100644
79b470
--- a/tests/cputestdata/x86_64-cpuid-Atom-P5362-guest.xml
79b470
+++ b/tests/cputestdata/x86_64-cpuid-Atom-P5362-guest.xml
79b470
@@ -1,5 +1,5 @@
79b470
 <cpu mode='custom' match='exact'>
79b470
-  <model fallback='forbid'>IvyBridge-IBRS</model>
79b470
+  <model fallback='forbid'>Snowridge</model>
79b470
   <vendor>Intel</vendor>
79b470
   <feature policy='require' name='ds'/>
79b470
   <feature policy='require' name='acpi'/>
79b470
@@ -16,36 +16,17 @@
79b470
   <feature policy='require' name='tm2'/>
79b470
   <feature policy='require' name='xtpr'/>
79b470
   <feature policy='require' name='pdcm'/>
79b470
-  <feature policy='require' name='movbe'/>
79b470
   <feature policy='require' name='osxsave'/>
79b470
-  <feature policy='require' name='arat'/>
79b470
   <feature policy='require' name='tsc_adjust'/>
79b470
   <feature policy='require' name='cmt'/>
79b470
-  <feature policy='require' name='rdseed'/>
79b470
-  <feature policy='require' name='smap'/>
79b470
-  <feature policy='require' name='clflushopt'/>
79b470
-  <feature policy='require' name='clwb'/>
79b470
   <feature policy='require' name='intel-pt'/>
79b470
-  <feature policy='require' name='sha-ni'/>
79b470
-  <feature policy='require' name='umip'/>
79b470
   <feature policy='require' name='waitpkg'/>
79b470
-  <feature policy='require' name='gfni'/>
79b470
   <feature policy='require' name='rdpid'/>
79b470
-  <feature policy='require' name='cldemote'/>
79b470
-  <feature policy='require' name='movdiri'/>
79b470
-  <feature policy='require' name='movdir64b'/>
79b470
   <feature policy='require' name='md-clear'/>
79b470
   <feature policy='require' name='stibp'/>
79b470
-  <feature policy='require' name='arch-capabilities'/>
79b470
-  <feature policy='require' name='core-capability'/>
79b470
-  <feature policy='require' name='ssbd'/>
79b470
-  <feature policy='require' name='xsaveopt'/>
79b470
-  <feature policy='require' name='xsavec'/>
79b470
-  <feature policy='require' name='xgetbv1'/>
79b470
   <feature policy='require' name='xsaves'/>
79b470
   <feature policy='require' name='mbm_total'/>
79b470
   <feature policy='require' name='mbm_local'/>
79b470
-  <feature policy='require' name='3dnowprefetch'/>
79b470
   <feature policy='require' name='invtsc'/>
79b470
   <feature policy='require' name='rdctl-no'/>
79b470
   <feature policy='require' name='ibrs-all'/>
79b470
@@ -53,7 +34,8 @@
79b470
   <feature policy='require' name='mds-no'/>
79b470
   <feature policy='require' name='pschange-mc-no'/>
79b470
   <feature policy='require' name='taa-no'/>
79b470
-  <feature policy='require' name='split-lock-detect'/>
79b470
-  <feature policy='disable' name='avx'/>
79b470
-  <feature policy='disable' name='f16c'/>
79b470
+  <feature policy='disable' name='mpx'/>
79b470
+  <feature policy='disable' name='core-capability'/>
79b470
+  <feature policy='disable' name='pdpe1gb'/>
79b470
+  <feature policy='disable' name='split-lock-detect'/>
79b470
 </cpu>
79b470
diff --git a/tests/cputestdata/x86_64-cpuid-Atom-P5362-json.xml b/tests/cputestdata/x86_64-cpuid-Atom-P5362-json.xml
79b470
index ca685d2f80..bbe0919706 100644
79b470
--- a/tests/cputestdata/x86_64-cpuid-Atom-P5362-json.xml
79b470
+++ b/tests/cputestdata/x86_64-cpuid-Atom-P5362-json.xml
79b470
@@ -1,33 +1,15 @@
79b470
 <cpu mode='custom' match='exact'>
79b470
-  <model fallback='forbid'>IvyBridge-IBRS</model>
79b470
+  <model fallback='forbid'>Snowridge</model>
79b470
   <vendor>Intel</vendor>
79b470
   <feature policy='require' name='ss'/>
79b470
   <feature policy='require' name='vmx'/>
79b470
   <feature policy='require' name='pdcm'/>
79b470
-  <feature policy='require' name='movbe'/>
79b470
   <feature policy='require' name='hypervisor'/>
79b470
-  <feature policy='require' name='arat'/>
79b470
   <feature policy='require' name='tsc_adjust'/>
79b470
-  <feature policy='require' name='rdseed'/>
79b470
-  <feature policy='require' name='smap'/>
79b470
-  <feature policy='require' name='clflushopt'/>
79b470
-  <feature policy='require' name='clwb'/>
79b470
-  <feature policy='require' name='sha-ni'/>
79b470
-  <feature policy='require' name='umip'/>
79b470
-  <feature policy='require' name='gfni'/>
79b470
   <feature policy='require' name='rdpid'/>
79b470
-  <feature policy='require' name='cldemote'/>
79b470
-  <feature policy='require' name='movdiri'/>
79b470
-  <feature policy='require' name='movdir64b'/>
79b470
   <feature policy='require' name='md-clear'/>
79b470
   <feature policy='require' name='stibp'/>
79b470
-  <feature policy='require' name='arch-capabilities'/>
79b470
-  <feature policy='require' name='ssbd'/>
79b470
-  <feature policy='require' name='xsaveopt'/>
79b470
-  <feature policy='require' name='xsavec'/>
79b470
-  <feature policy='require' name='xgetbv1'/>
79b470
   <feature policy='require' name='xsaves'/>
79b470
-  <feature policy='require' name='3dnowprefetch'/>
79b470
   <feature policy='require' name='ibpb'/>
79b470
   <feature policy='require' name='amd-stibp'/>
79b470
   <feature policy='require' name='amd-ssbd'/>
79b470
@@ -36,6 +18,8 @@
79b470
   <feature policy='require' name='skip-l1dfl-vmentry'/>
79b470
   <feature policy='require' name='mds-no'/>
79b470
   <feature policy='require' name='pschange-mc-no'/>
79b470
-  <feature policy='disable' name='avx'/>
79b470
-  <feature policy='disable' name='f16c'/>
79b470
+  <feature policy='disable' name='mpx'/>
79b470
+  <feature policy='disable' name='core-capability'/>
79b470
+  <feature policy='disable' name='pdpe1gb'/>
79b470
+  <feature policy='disable' name='split-lock-detect'/>
79b470
 </cpu>
79b470
diff --git a/tests/domaincapsdata/qemu_4.1.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_4.1.0-q35.x86_64.xml
79b470
index f4ddb66e38..228acde33b 100644
79b470
--- a/tests/domaincapsdata/qemu_4.1.0-q35.x86_64.xml
79b470
+++ b/tests/domaincapsdata/qemu_4.1.0-q35.x86_64.xml
79b470
@@ -63,6 +63,7 @@
79b470
       <model usable='no'>athlon</model>
79b470
       <model usable='yes'>Westmere-IBRS</model>
79b470
       <model usable='yes'>Westmere</model>
79b470
+      <model usable='no'>Snowridge</model>
79b470
       <model usable='no'>Skylake-Server-IBRS</model>
79b470
       <model usable='no'>Skylake-Server</model>
79b470
       <model usable='yes'>Skylake-Client-IBRS</model>
79b470
diff --git a/tests/domaincapsdata/qemu_4.1.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_4.1.0-tcg.x86_64.xml
79b470
index d6265ce243..bda1aba8ed 100644
79b470
--- a/tests/domaincapsdata/qemu_4.1.0-tcg.x86_64.xml
79b470
+++ b/tests/domaincapsdata/qemu_4.1.0-tcg.x86_64.xml
79b470
@@ -75,6 +75,7 @@
79b470
       <model usable='yes'>athlon</model>
79b470
       <model usable='no'>Westmere-IBRS</model>
79b470
       <model usable='no'>Westmere</model>
79b470
+      <model usable='no'>Snowridge</model>
79b470
       <model usable='no'>Skylake-Server-IBRS</model>
79b470
       <model usable='no'>Skylake-Server</model>
79b470
       <model usable='no'>Skylake-Client-IBRS</model>
79b470
diff --git a/tests/domaincapsdata/qemu_4.1.0.x86_64.xml b/tests/domaincapsdata/qemu_4.1.0.x86_64.xml
79b470
index bcc8bbcc7a..bb53138712 100644
79b470
--- a/tests/domaincapsdata/qemu_4.1.0.x86_64.xml
79b470
+++ b/tests/domaincapsdata/qemu_4.1.0.x86_64.xml
79b470
@@ -62,6 +62,7 @@
79b470
       <model usable='no'>athlon</model>
79b470
       <model usable='yes'>Westmere-IBRS</model>
79b470
       <model usable='yes'>Westmere</model>
79b470
+      <model usable='no'>Snowridge</model>
79b470
       <model usable='no'>Skylake-Server-IBRS</model>
79b470
       <model usable='no'>Skylake-Server</model>
79b470
       <model usable='yes'>Skylake-Client-IBRS</model>
79b470
diff --git a/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml
79b470
index 4d9616cb69..0a3f3ef564 100644
79b470
--- a/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml
79b470
+++ b/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml
79b470
@@ -64,6 +64,7 @@
79b470
       <model usable='no'>athlon</model>
79b470
       <model usable='yes'>Westmere-IBRS</model>
79b470
       <model usable='yes'>Westmere</model>
79b470
+      <model usable='no'>Snowridge</model>
79b470
       <model usable='no'>Skylake-Server-noTSX-IBRS</model>
79b470
       <model usable='no'>Skylake-Server-IBRS</model>
79b470
       <model usable='no'>Skylake-Server</model>
79b470
diff --git a/tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml
79b470
index bcaf9afd6f..e64b647f51 100644
79b470
--- a/tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml
79b470
+++ b/tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml
79b470
@@ -75,6 +75,7 @@
79b470
       <model usable='yes'>athlon</model>
79b470
       <model usable='no'>Westmere-IBRS</model>
79b470
       <model usable='no'>Westmere</model>
79b470
+      <model usable='no'>Snowridge</model>
79b470
       <model usable='no'>Skylake-Server-noTSX-IBRS</model>
79b470
       <model usable='no'>Skylake-Server-IBRS</model>
79b470
       <model usable='no'>Skylake-Server</model>
79b470
diff --git a/tests/domaincapsdata/qemu_4.2.0.x86_64.xml b/tests/domaincapsdata/qemu_4.2.0.x86_64.xml
79b470
index 5210c917aa..5525758a48 100644
79b470
--- a/tests/domaincapsdata/qemu_4.2.0.x86_64.xml
79b470
+++ b/tests/domaincapsdata/qemu_4.2.0.x86_64.xml
79b470
@@ -63,6 +63,7 @@
79b470
       <model usable='no'>athlon</model>
79b470
       <model usable='yes'>Westmere-IBRS</model>
79b470
       <model usable='yes'>Westmere</model>
79b470
+      <model usable='no'>Snowridge</model>
79b470
       <model usable='no'>Skylake-Server-noTSX-IBRS</model>
79b470
       <model usable='no'>Skylake-Server-IBRS</model>
79b470
       <model usable='no'>Skylake-Server</model>
79b470
diff --git a/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml
79b470
index b2a7087a0e..4cb4bf6cce 100644
79b470
--- a/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml
79b470
+++ b/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml
79b470
@@ -64,6 +64,7 @@
79b470
       <model usable='no'>athlon</model>
79b470
       <model usable='yes'>Westmere-IBRS</model>
79b470
       <model usable='yes'>Westmere</model>
79b470
+      <model usable='no'>Snowridge</model>
79b470
       <model usable='no'>Skylake-Server-noTSX-IBRS</model>
79b470
       <model usable='no'>Skylake-Server-IBRS</model>
79b470
       <model usable='no'>Skylake-Server</model>
79b470
diff --git a/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml
79b470
index 39b11fb634..b5986404ae 100644
79b470
--- a/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml
79b470
+++ b/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml
79b470
@@ -74,6 +74,7 @@
79b470
       <model usable='yes'>athlon</model>
79b470
       <model usable='no'>Westmere-IBRS</model>
79b470
       <model usable='yes'>Westmere</model>
79b470
+      <model usable='no'>Snowridge</model>
79b470
       <model usable='no'>Skylake-Server-noTSX-IBRS</model>
79b470
       <model usable='no'>Skylake-Server-IBRS</model>
79b470
       <model usable='no'>Skylake-Server</model>
79b470
diff --git a/tests/domaincapsdata/qemu_5.0.0.x86_64.xml b/tests/domaincapsdata/qemu_5.0.0.x86_64.xml
79b470
index 3a1ee23302..0297ce600b 100644
79b470
--- a/tests/domaincapsdata/qemu_5.0.0.x86_64.xml
79b470
+++ b/tests/domaincapsdata/qemu_5.0.0.x86_64.xml
79b470
@@ -63,6 +63,7 @@
79b470
       <model usable='no'>athlon</model>
79b470
       <model usable='yes'>Westmere-IBRS</model>
79b470
       <model usable='yes'>Westmere</model>
79b470
+      <model usable='no'>Snowridge</model>
79b470
       <model usable='no'>Skylake-Server-noTSX-IBRS</model>
79b470
       <model usable='no'>Skylake-Server-IBRS</model>
79b470
       <model usable='no'>Skylake-Server</model>
79b470
-- 
79b470
2.30.0
79b470