render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
Blob Blame History Raw
From b177f66b37d0c64216ec579a5211461609a96ea8 Mon Sep 17 00:00:00 2001
Message-Id: <b177f66b37d0c64216ec579a5211461609a96ea8@dist-git>
From: Tim Wiederhake <twiederh@redhat.com>
Date: Fri, 15 Jan 2021 15:17:22 +0100
Subject: [PATCH] cpu_map: Define and enable Snowridge model

Due to missing pdpe1gb support in the host CPU data, the CPU is still
incorrectly detected as Westmere-IBRS for host capabilities because we
don't have the option to disable features included in the base model
there.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
(cherry picked from commit f0a5cf4b8a8b5a68348df5e8b197f30dd90b3c34)

https://bugzilla.redhat.com/show_bug.cgi?id=1537734

Conflicts:
- src/cpu_map/index.xml: Context
- src/cpu_map/meson.build: Not present downstream
- tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml: Not present downstream
- tests/domaincapsdata/qemu_5.1.0-tcg.x86_64.xml: Not present downstream
- tests/domaincapsdata/qemu_5.1.0.x86_64.xml: Not present downstream
- tests/domaincapsdata/qemu_5.2.0-q35.x86_64.xml: Not present downstream
- tests/domaincapsdata/qemu_5.2.0-tcg.x86_64.xml: Not present downstream
- tests/domaincapsdata/qemu_5.2.0.x86_64.xml: Not present downstream

Additions:
- src/cpu_map/Makefile.inc.am: Replaces upstream change of "meson.build"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Message-Id: <20210115141722.14986-7-twiederh@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/cpu_map/Makefile.inc.am                   |  1 +
 src/cpu_map/index.xml                         |  1 +
 src/cpu_map/x86_Snowridge.xml                 | 71 +++++++++++++++++++
 .../x86_64-cpuid-Atom-P5362-guest.xml         | 28 ++------
 .../x86_64-cpuid-Atom-P5362-json.xml          | 26 ++-----
 .../domaincapsdata/qemu_4.1.0-q35.x86_64.xml  |  1 +
 .../domaincapsdata/qemu_4.1.0-tcg.x86_64.xml  |  1 +
 tests/domaincapsdata/qemu_4.1.0.x86_64.xml    |  1 +
 .../domaincapsdata/qemu_4.2.0-q35.x86_64.xml  |  1 +
 .../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml  |  1 +
 tests/domaincapsdata/qemu_4.2.0.x86_64.xml    |  1 +
 .../domaincapsdata/qemu_5.0.0-q35.x86_64.xml  |  1 +
 .../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml  |  1 +
 tests/domaincapsdata/qemu_5.0.0.x86_64.xml    |  1 +
 14 files changed, 92 insertions(+), 44 deletions(-)
 create mode 100644 src/cpu_map/x86_Snowridge.xml

diff --git a/src/cpu_map/Makefile.inc.am b/src/cpu_map/Makefile.inc.am
index aad4b410f9..1dd78c6715 100644
--- a/src/cpu_map/Makefile.inc.am
+++ b/src/cpu_map/Makefile.inc.am
@@ -67,6 +67,7 @@ cpumap_DATA = \
 	cpu_map/x86_Skylake-Server.xml \
 	cpu_map/x86_Skylake-Server-IBRS.xml \
 	cpu_map/x86_Skylake-Server-noTSX-IBRS.xml \
+	cpu_map/x86_Snowridge.xml \
 	cpu_map/x86_Westmere.xml \
 	cpu_map/x86_Westmere-IBRS.xml \
 	$(NULL)
diff --git a/src/cpu_map/index.xml b/src/cpu_map/index.xml
index 633b017a93..2f58261e6d 100644
--- a/src/cpu_map/index.xml
+++ b/src/cpu_map/index.xml
@@ -55,6 +55,7 @@
     <include filename="x86_Icelake-Server.xml"/>
     <include filename="x86_Icelake-Server-noTSX.xml"/>
     <include filename="x86_Cooperlake.xml"/>
+    <include filename='x86_Snowridge.xml'/>
 
     <!-- AMD CPUs -->
     <include filename="x86_athlon.xml"/>
diff --git a/src/cpu_map/x86_Snowridge.xml b/src/cpu_map/x86_Snowridge.xml
new file mode 100644
index 0000000000..383a24d367
--- /dev/null
+++ b/src/cpu_map/x86_Snowridge.xml
@@ -0,0 +1,71 @@
+<cpus>
+  <model name='Snowridge'>
+    <decode host='on' guest='on'/>
+    <signature family='6' model='134'/> <!-- 080665 -->
+    <vendor name='Intel'/>
+    <feature name='3dnowprefetch'/>
+    <feature name='aes'/>
+    <feature name='apic'/>
+    <feature name='arat'/>
+    <feature name='arch-capabilities'/>
+    <feature name='cldemote'/>
+    <feature name='clflush'/>
+    <feature name='clflushopt'/>
+    <feature name='clwb'/>
+    <feature name='cmov'/>
+    <feature name='core-capability'/>
+    <feature name='cx16'/>
+    <feature name='cx8'/>
+    <feature name='de'/>
+    <feature name='erms'/>
+    <feature name='fpu'/>
+    <feature name='fsgsbase'/>
+    <feature name='fxsr'/>
+    <feature name='gfni'/>
+    <feature name='lahf_lm'/>
+    <feature name='lm'/>
+    <feature name='mca'/>
+    <feature name='mce'/>
+    <feature name='mmx'/>
+    <feature name='movbe'/>
+    <feature name='movdir64b'/>
+    <feature name='movdiri'/>
+    <feature name='msr'/>
+    <feature name='mtrr'/>
+    <feature name='nx'/>
+    <feature name='pae'/>
+    <feature name='pat'/>
+    <feature name='pclmuldq'/>
+    <feature name='pdpe1gb'/>
+    <feature name='pge'/>
+    <feature name='pni'/>
+    <feature name='popcnt'/>
+    <feature name='pse'/>
+    <feature name='pse36'/>
+    <feature name='rdrand'/>
+    <feature name='rdseed'/>
+    <feature name='rdtscp'/>
+    <feature name='sep'/>
+    <feature name='sha-ni'/>
+    <feature name='smap'/>
+    <feature name='smep'/>
+    <feature name='spec-ctrl'/>
+    <feature name='split-lock-detect'/>
+    <feature name='ssbd'/>
+    <feature name='sse'/>
+    <feature name='sse2'/>
+    <feature name='sse4.1'/>
+    <feature name='sse4.2'/>
+    <feature name='ssse3'/>
+    <feature name='syscall'/>
+    <feature name='tsc'/>
+    <feature name='tsc-deadline'/>
+    <feature name='umip'/>
+    <feature name='vme'/>
+    <feature name='x2apic'/>
+    <feature name='xgetbv1'/>
+    <feature name='xsave'/>
+    <feature name='xsavec'/>
+    <feature name='xsaveopt'/>
+  </model>
+</cpus>
diff --git a/tests/cputestdata/x86_64-cpuid-Atom-P5362-guest.xml b/tests/cputestdata/x86_64-cpuid-Atom-P5362-guest.xml
index 2eeff136c4..f28e70b9e0 100644
--- a/tests/cputestdata/x86_64-cpuid-Atom-P5362-guest.xml
+++ b/tests/cputestdata/x86_64-cpuid-Atom-P5362-guest.xml
@@ -1,5 +1,5 @@
 <cpu mode='custom' match='exact'>
-  <model fallback='forbid'>IvyBridge-IBRS</model>
+  <model fallback='forbid'>Snowridge</model>
   <vendor>Intel</vendor>
   <feature policy='require' name='ds'/>
   <feature policy='require' name='acpi'/>
@@ -16,36 +16,17 @@
   <feature policy='require' name='tm2'/>
   <feature policy='require' name='xtpr'/>
   <feature policy='require' name='pdcm'/>
-  <feature policy='require' name='movbe'/>
   <feature policy='require' name='osxsave'/>
-  <feature policy='require' name='arat'/>
   <feature policy='require' name='tsc_adjust'/>
   <feature policy='require' name='cmt'/>
-  <feature policy='require' name='rdseed'/>
-  <feature policy='require' name='smap'/>
-  <feature policy='require' name='clflushopt'/>
-  <feature policy='require' name='clwb'/>
   <feature policy='require' name='intel-pt'/>
-  <feature policy='require' name='sha-ni'/>
-  <feature policy='require' name='umip'/>
   <feature policy='require' name='waitpkg'/>
-  <feature policy='require' name='gfni'/>
   <feature policy='require' name='rdpid'/>
-  <feature policy='require' name='cldemote'/>
-  <feature policy='require' name='movdiri'/>
-  <feature policy='require' name='movdir64b'/>
   <feature policy='require' name='md-clear'/>
   <feature policy='require' name='stibp'/>
-  <feature policy='require' name='arch-capabilities'/>
-  <feature policy='require' name='core-capability'/>
-  <feature policy='require' name='ssbd'/>
-  <feature policy='require' name='xsaveopt'/>
-  <feature policy='require' name='xsavec'/>
-  <feature policy='require' name='xgetbv1'/>
   <feature policy='require' name='xsaves'/>
   <feature policy='require' name='mbm_total'/>
   <feature policy='require' name='mbm_local'/>
-  <feature policy='require' name='3dnowprefetch'/>
   <feature policy='require' name='invtsc'/>
   <feature policy='require' name='rdctl-no'/>
   <feature policy='require' name='ibrs-all'/>
@@ -53,7 +34,8 @@
   <feature policy='require' name='mds-no'/>
   <feature policy='require' name='pschange-mc-no'/>
   <feature policy='require' name='taa-no'/>
-  <feature policy='require' name='split-lock-detect'/>
-  <feature policy='disable' name='avx'/>
-  <feature policy='disable' name='f16c'/>
+  <feature policy='disable' name='mpx'/>
+  <feature policy='disable' name='core-capability'/>
+  <feature policy='disable' name='pdpe1gb'/>
+  <feature policy='disable' name='split-lock-detect'/>
 </cpu>
diff --git a/tests/cputestdata/x86_64-cpuid-Atom-P5362-json.xml b/tests/cputestdata/x86_64-cpuid-Atom-P5362-json.xml
index ca685d2f80..bbe0919706 100644
--- a/tests/cputestdata/x86_64-cpuid-Atom-P5362-json.xml
+++ b/tests/cputestdata/x86_64-cpuid-Atom-P5362-json.xml
@@ -1,33 +1,15 @@
 <cpu mode='custom' match='exact'>
-  <model fallback='forbid'>IvyBridge-IBRS</model>
+  <model fallback='forbid'>Snowridge</model>
   <vendor>Intel</vendor>
   <feature policy='require' name='ss'/>
   <feature policy='require' name='vmx'/>
   <feature policy='require' name='pdcm'/>
-  <feature policy='require' name='movbe'/>
   <feature policy='require' name='hypervisor'/>
-  <feature policy='require' name='arat'/>
   <feature policy='require' name='tsc_adjust'/>
-  <feature policy='require' name='rdseed'/>
-  <feature policy='require' name='smap'/>
-  <feature policy='require' name='clflushopt'/>
-  <feature policy='require' name='clwb'/>
-  <feature policy='require' name='sha-ni'/>
-  <feature policy='require' name='umip'/>
-  <feature policy='require' name='gfni'/>
   <feature policy='require' name='rdpid'/>
-  <feature policy='require' name='cldemote'/>
-  <feature policy='require' name='movdiri'/>
-  <feature policy='require' name='movdir64b'/>
   <feature policy='require' name='md-clear'/>
   <feature policy='require' name='stibp'/>
-  <feature policy='require' name='arch-capabilities'/>
-  <feature policy='require' name='ssbd'/>
-  <feature policy='require' name='xsaveopt'/>
-  <feature policy='require' name='xsavec'/>
-  <feature policy='require' name='xgetbv1'/>
   <feature policy='require' name='xsaves'/>
-  <feature policy='require' name='3dnowprefetch'/>
   <feature policy='require' name='ibpb'/>
   <feature policy='require' name='amd-stibp'/>
   <feature policy='require' name='amd-ssbd'/>
@@ -36,6 +18,8 @@
   <feature policy='require' name='skip-l1dfl-vmentry'/>
   <feature policy='require' name='mds-no'/>
   <feature policy='require' name='pschange-mc-no'/>
-  <feature policy='disable' name='avx'/>
-  <feature policy='disable' name='f16c'/>
+  <feature policy='disable' name='mpx'/>
+  <feature policy='disable' name='core-capability'/>
+  <feature policy='disable' name='pdpe1gb'/>
+  <feature policy='disable' name='split-lock-detect'/>
 </cpu>
diff --git a/tests/domaincapsdata/qemu_4.1.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_4.1.0-q35.x86_64.xml
index f4ddb66e38..228acde33b 100644
--- a/tests/domaincapsdata/qemu_4.1.0-q35.x86_64.xml
+++ b/tests/domaincapsdata/qemu_4.1.0-q35.x86_64.xml
@@ -63,6 +63,7 @@
       <model usable='no'>athlon</model>
       <model usable='yes'>Westmere-IBRS</model>
       <model usable='yes'>Westmere</model>
+      <model usable='no'>Snowridge</model>
       <model usable='no'>Skylake-Server-IBRS</model>
       <model usable='no'>Skylake-Server</model>
       <model usable='yes'>Skylake-Client-IBRS</model>
diff --git a/tests/domaincapsdata/qemu_4.1.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_4.1.0-tcg.x86_64.xml
index d6265ce243..bda1aba8ed 100644
--- a/tests/domaincapsdata/qemu_4.1.0-tcg.x86_64.xml
+++ b/tests/domaincapsdata/qemu_4.1.0-tcg.x86_64.xml
@@ -75,6 +75,7 @@
       <model usable='yes'>athlon</model>
       <model usable='no'>Westmere-IBRS</model>
       <model usable='no'>Westmere</model>
+      <model usable='no'>Snowridge</model>
       <model usable='no'>Skylake-Server-IBRS</model>
       <model usable='no'>Skylake-Server</model>
       <model usable='no'>Skylake-Client-IBRS</model>
diff --git a/tests/domaincapsdata/qemu_4.1.0.x86_64.xml b/tests/domaincapsdata/qemu_4.1.0.x86_64.xml
index bcc8bbcc7a..bb53138712 100644
--- a/tests/domaincapsdata/qemu_4.1.0.x86_64.xml
+++ b/tests/domaincapsdata/qemu_4.1.0.x86_64.xml
@@ -62,6 +62,7 @@
       <model usable='no'>athlon</model>
       <model usable='yes'>Westmere-IBRS</model>
       <model usable='yes'>Westmere</model>
+      <model usable='no'>Snowridge</model>
       <model usable='no'>Skylake-Server-IBRS</model>
       <model usable='no'>Skylake-Server</model>
       <model usable='yes'>Skylake-Client-IBRS</model>
diff --git a/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml
index 4d9616cb69..0a3f3ef564 100644
--- a/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml
+++ b/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml
@@ -64,6 +64,7 @@
       <model usable='no'>athlon</model>
       <model usable='yes'>Westmere-IBRS</model>
       <model usable='yes'>Westmere</model>
+      <model usable='no'>Snowridge</model>
       <model usable='no'>Skylake-Server-noTSX-IBRS</model>
       <model usable='no'>Skylake-Server-IBRS</model>
       <model usable='no'>Skylake-Server</model>
diff --git a/tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml
index bcaf9afd6f..e64b647f51 100644
--- a/tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml
+++ b/tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml
@@ -75,6 +75,7 @@
       <model usable='yes'>athlon</model>
       <model usable='no'>Westmere-IBRS</model>
       <model usable='no'>Westmere</model>
+      <model usable='no'>Snowridge</model>
       <model usable='no'>Skylake-Server-noTSX-IBRS</model>
       <model usable='no'>Skylake-Server-IBRS</model>
       <model usable='no'>Skylake-Server</model>
diff --git a/tests/domaincapsdata/qemu_4.2.0.x86_64.xml b/tests/domaincapsdata/qemu_4.2.0.x86_64.xml
index 5210c917aa..5525758a48 100644
--- a/tests/domaincapsdata/qemu_4.2.0.x86_64.xml
+++ b/tests/domaincapsdata/qemu_4.2.0.x86_64.xml
@@ -63,6 +63,7 @@
       <model usable='no'>athlon</model>
       <model usable='yes'>Westmere-IBRS</model>
       <model usable='yes'>Westmere</model>
+      <model usable='no'>Snowridge</model>
       <model usable='no'>Skylake-Server-noTSX-IBRS</model>
       <model usable='no'>Skylake-Server-IBRS</model>
       <model usable='no'>Skylake-Server</model>
diff --git a/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml
index b2a7087a0e..4cb4bf6cce 100644
--- a/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml
+++ b/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml
@@ -64,6 +64,7 @@
       <model usable='no'>athlon</model>
       <model usable='yes'>Westmere-IBRS</model>
       <model usable='yes'>Westmere</model>
+      <model usable='no'>Snowridge</model>
       <model usable='no'>Skylake-Server-noTSX-IBRS</model>
       <model usable='no'>Skylake-Server-IBRS</model>
       <model usable='no'>Skylake-Server</model>
diff --git a/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml
index 39b11fb634..b5986404ae 100644
--- a/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml
+++ b/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml
@@ -74,6 +74,7 @@
       <model usable='yes'>athlon</model>
       <model usable='no'>Westmere-IBRS</model>
       <model usable='yes'>Westmere</model>
+      <model usable='no'>Snowridge</model>
       <model usable='no'>Skylake-Server-noTSX-IBRS</model>
       <model usable='no'>Skylake-Server-IBRS</model>
       <model usable='no'>Skylake-Server</model>
diff --git a/tests/domaincapsdata/qemu_5.0.0.x86_64.xml b/tests/domaincapsdata/qemu_5.0.0.x86_64.xml
index 3a1ee23302..0297ce600b 100644
--- a/tests/domaincapsdata/qemu_5.0.0.x86_64.xml
+++ b/tests/domaincapsdata/qemu_5.0.0.x86_64.xml
@@ -63,6 +63,7 @@
       <model usable='no'>athlon</model>
       <model usable='yes'>Westmere-IBRS</model>
       <model usable='yes'>Westmere</model>
+      <model usable='no'>Snowridge</model>
       <model usable='no'>Skylake-Server-noTSX-IBRS</model>
       <model usable='no'>Skylake-Server-IBRS</model>
       <model usable='no'>Skylake-Server</model>
-- 
2.30.0