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