Blob Blame History Raw
From f441299f1b589a60199156a217c5f49fc9de954d Mon Sep 17 00:00:00 2001
Message-Id: <f441299f1b589a60199156a217c5f49fc9de954d@dist-git>
From: Markus Schade <markus.schade@hetzner.com>
Date: Thu, 8 Oct 2020 18:01:25 +0200
Subject: [PATCH] cpu_map: Defined and enable EPYC-Rome model
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Markus Schade <markus.schade@hetzner.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
(cherry picked from commit f941639f86f4bc66c106eb1291f1b58cf9e24680)

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

Conflicts:
	src/cpu_map/meson.build
            - the corresponding change was applied to Makefile.inc.am as
              downstream still uses autotools

	tests/cputest.c
	tests/cputestdata/x86_64-cpuid-Ryzen-9-3900X-12-Core-host.xml
            - test data for Ryzen 9 3900X are not present downstream

	tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml
	tests/domaincapsdata/qemu_5.1.0-tcg.x86_64.xml
	tests/domaincapsdata/qemu_5.1.0.x86_64.xml
	tests/domaincapsdata/qemu_5.2.0-q35.x86_64.xml
	tests/domaincapsdata/qemu_5.2.0-tcg.x86_64.xml
	tests/domaincapsdata/qemu_5.2.0.x86_64.xml
            - not present downstream

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Message-Id: <bc87b8a0b0c408f380792eaf63ff07551185d3a5.1602172344.git.jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
 src/cpu_map/Makefile.inc.am                   |  1 +
 src/cpu_map/index.xml                         |  1 +
 src/cpu_map/x86_EPYC-Rome.xml                 | 84 +++++++++++++++++++
 .../x86_64-cpuid-EPYC-7502-32-Core-guest.xml  | 12 +--
 .../x86_64-cpuid-EPYC-7502-32-Core-host.xml   | 12 +--
 .../x86_64-cpuid-EPYC-7502-32-Core-json.xml   | 12 +--
 .../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 +
 9 files changed, 92 insertions(+), 33 deletions(-)
 create mode 100644 src/cpu_map/x86_EPYC-Rome.xml

diff --git a/src/cpu_map/Makefile.inc.am b/src/cpu_map/Makefile.inc.am
index b949cb0bea..aad4b410f9 100644
--- a/src/cpu_map/Makefile.inc.am
+++ b/src/cpu_map/Makefile.inc.am
@@ -30,6 +30,7 @@ cpumap_DATA = \
 	cpu_map/x86_Dhyana.xml \
 	cpu_map/x86_EPYC.xml \
 	cpu_map/x86_EPYC-IBPB.xml \
+	cpu_map/x86_EPYC-Rome.xml \
 	cpu_map/x86_Haswell.xml \
 	cpu_map/x86_Haswell-IBRS.xml \
 	cpu_map/x86_Haswell-noTSX.xml \
diff --git a/src/cpu_map/index.xml b/src/cpu_map/index.xml
index ff1da2e677..633b017a93 100644
--- a/src/cpu_map/index.xml
+++ b/src/cpu_map/index.xml
@@ -66,6 +66,7 @@
     <include filename="x86_Opteron_G5.xml"/>
     <include filename="x86_EPYC.xml"/>
     <include filename="x86_EPYC-IBPB.xml"/>
+    <include filename="x86_EPYC-Rome.xml"/>
 
     <!-- Hygon CPU models -->
     <include filename="x86_Dhyana.xml"/>
diff --git a/src/cpu_map/x86_EPYC-Rome.xml b/src/cpu_map/x86_EPYC-Rome.xml
new file mode 100644
index 0000000000..99fc015fdd
--- /dev/null
+++ b/src/cpu_map/x86_EPYC-Rome.xml
@@ -0,0 +1,84 @@
+<cpus>
+  <model name='EPYC-Rome'>
+    <decode host='on' guest='on'/>
+    <signature family='23' model='49'/>
+    <vendor name='AMD'/>
+    <feature name='3dnowprefetch'/>
+    <feature name='abm'/>
+    <feature name='adx'/>
+    <feature name='aes'/>
+    <feature name='amd-stibp'/>
+    <feature name='apic'/>
+    <feature name='arat'/>
+    <feature name='avx'/>
+    <feature name='avx2'/>
+    <feature name='bmi1'/>
+    <feature name='bmi2'/>
+    <feature name='clflush'/>
+    <feature name='clflushopt'/>
+    <feature name='clwb'/>
+    <feature name='clzero'/>
+    <feature name='cmov'/>
+    <feature name='cr8legacy'/>
+    <feature name='cx16'/>
+    <feature name='cx8'/>
+    <feature name='de'/>
+    <feature name='f16c'/>
+    <feature name='fma'/>
+    <feature name='fpu'/>
+    <feature name='fsgsbase'/>
+    <feature name='fxsr'/>
+    <feature name='fxsr_opt'/>
+    <feature name='ibpb'/>
+    <feature name='lahf_lm'/>
+    <feature name='lm'/>
+    <feature name='mca'/>
+    <feature name='mce'/>
+    <feature name='misalignsse'/>
+    <feature name='mmx'/>
+    <feature name='mmxext'/>
+    <feature name='monitor'/>
+    <feature name='movbe'/>
+    <feature name='msr'/>
+    <feature name='mtrr'/>
+    <feature name='npt'/>
+    <feature name='nrip-save'/>
+    <feature name='nx'/>
+    <feature name='osvw'/>
+    <feature name='pae'/>
+    <feature name='pat'/>
+    <feature name='pclmuldq'/>
+    <feature name='pdpe1gb'/>
+    <feature name='perfctr_core'/>
+    <feature name='pge'/>
+    <feature name='pni'/>
+    <feature name='popcnt'/>
+    <feature name='pse'/>
+    <feature name='pse36'/>
+    <feature name='rdpid'/>
+    <feature name='rdrand'/>
+    <feature name='rdseed'/>
+    <feature name='rdtscp'/>
+    <feature name='sep'/>
+    <feature name='sha-ni'/>
+    <feature name='smap'/>
+    <feature name='smep'/>
+    <feature name='sse'/>
+    <feature name='sse2'/>
+    <feature name='sse4.1'/>
+    <feature name='sse4.2'/>
+    <feature name='sse4a'/>
+    <feature name='ssse3'/>
+    <feature name='svm'/>
+    <feature name='syscall'/>
+    <feature name='tsc'/>
+    <feature name='umip'/>
+    <feature name='vme'/>
+    <feature name='wbnoinvd'/>
+    <feature name='xgetbv1'/>
+    <feature name='xsave'/>
+    <feature name='xsavec'/>
+    <feature name='xsaveerptr'/>
+    <feature name='xsaveopt'/>
+  </model>
+</cpus>
diff --git a/tests/cputestdata/x86_64-cpuid-EPYC-7502-32-Core-guest.xml b/tests/cputestdata/x86_64-cpuid-EPYC-7502-32-Core-guest.xml
index 1320f65a58..cb2caab6f5 100644
--- a/tests/cputestdata/x86_64-cpuid-EPYC-7502-32-Core-guest.xml
+++ b/tests/cputestdata/x86_64-cpuid-EPYC-7502-32-Core-guest.xml
@@ -1,12 +1,9 @@
 <cpu mode='custom' match='exact'>
-  <model fallback='forbid'>EPYC-IBPB</model>
+  <model fallback='forbid'>EPYC-Rome</model>
   <vendor>AMD</vendor>
   <feature policy='require' name='ht'/>
   <feature policy='require' name='osxsave'/>
   <feature policy='require' name='cmt'/>
-  <feature policy='require' name='clwb'/>
-  <feature policy='require' name='umip'/>
-  <feature policy='require' name='rdpid'/>
   <feature policy='require' name='xsaves'/>
   <feature policy='require' name='mbm_total'/>
   <feature policy='require' name='mbm_local'/>
@@ -17,18 +14,11 @@
   <feature policy='require' name='wdt'/>
   <feature policy='require' name='tce'/>
   <feature policy='require' name='topoext'/>
-  <feature policy='require' name='perfctr_core'/>
   <feature policy='require' name='perfctr_nb'/>
   <feature policy='require' name='invtsc'/>
-  <feature policy='require' name='clzero'/>
-  <feature policy='require' name='xsaveerptr'/>
-  <feature policy='require' name='wbnoinvd'/>
-  <feature policy='require' name='amd-stibp'/>
   <feature policy='require' name='amd-ssbd'/>
-  <feature policy='require' name='npt'/>
   <feature policy='require' name='lbrv'/>
   <feature policy='require' name='svm-lock'/>
-  <feature policy='require' name='nrip-save'/>
   <feature policy='require' name='tsc-scale'/>
   <feature policy='require' name='vmcb-clean'/>
   <feature policy='require' name='flushbyasid'/>
diff --git a/tests/cputestdata/x86_64-cpuid-EPYC-7502-32-Core-host.xml b/tests/cputestdata/x86_64-cpuid-EPYC-7502-32-Core-host.xml
index 37905ec812..b6784f9eba 100644
--- a/tests/cputestdata/x86_64-cpuid-EPYC-7502-32-Core-host.xml
+++ b/tests/cputestdata/x86_64-cpuid-EPYC-7502-32-Core-host.xml
@@ -1,13 +1,10 @@
 <cpu>
   <arch>x86_64</arch>
-  <model>EPYC-IBPB</model>
+  <model>EPYC-Rome</model>
   <vendor>AMD</vendor>
   <feature name='ht'/>
   <feature name='osxsave'/>
   <feature name='cmt'/>
-  <feature name='clwb'/>
-  <feature name='umip'/>
-  <feature name='rdpid'/>
   <feature name='xsaves'/>
   <feature name='mbm_total'/>
   <feature name='mbm_local'/>
@@ -18,18 +15,11 @@
   <feature name='wdt'/>
   <feature name='tce'/>
   <feature name='topoext'/>
-  <feature name='perfctr_core'/>
   <feature name='perfctr_nb'/>
   <feature name='invtsc'/>
-  <feature name='clzero'/>
-  <feature name='xsaveerptr'/>
-  <feature name='wbnoinvd'/>
-  <feature name='amd-stibp'/>
   <feature name='amd-ssbd'/>
-  <feature name='npt'/>
   <feature name='lbrv'/>
   <feature name='svm-lock'/>
-  <feature name='nrip-save'/>
   <feature name='tsc-scale'/>
   <feature name='vmcb-clean'/>
   <feature name='flushbyasid'/>
diff --git a/tests/cputestdata/x86_64-cpuid-EPYC-7502-32-Core-json.xml b/tests/cputestdata/x86_64-cpuid-EPYC-7502-32-Core-json.xml
index 225cf63852..86466c0547 100644
--- a/tests/cputestdata/x86_64-cpuid-EPYC-7502-32-Core-json.xml
+++ b/tests/cputestdata/x86_64-cpuid-EPYC-7502-32-Core-json.xml
@@ -1,28 +1,18 @@
 <cpu mode='custom' match='exact'>
-  <model fallback='forbid'>EPYC-IBPB</model>
+  <model fallback='forbid'>EPYC-Rome</model>
   <vendor>AMD</vendor>
   <feature policy='require' name='x2apic'/>
   <feature policy='require' name='tsc-deadline'/>
   <feature policy='require' name='hypervisor'/>
   <feature policy='require' name='tsc_adjust'/>
-  <feature policy='require' name='clwb'/>
-  <feature policy='require' name='umip'/>
-  <feature policy='require' name='rdpid'/>
   <feature policy='require' name='spec-ctrl'/>
   <feature policy='require' name='stibp'/>
   <feature policy='require' name='arch-capabilities'/>
   <feature policy='require' name='ssbd'/>
   <feature policy='require' name='xsaves'/>
   <feature policy='require' name='cmp_legacy'/>
-  <feature policy='require' name='perfctr_core'/>
-  <feature policy='require' name='clzero'/>
-  <feature policy='require' name='xsaveerptr'/>
-  <feature policy='require' name='wbnoinvd'/>
-  <feature policy='require' name='amd-stibp'/>
   <feature policy='require' name='amd-ssbd'/>
   <feature policy='require' name='virt-ssbd'/>
-  <feature policy='require' name='npt'/>
-  <feature policy='require' name='nrip-save'/>
   <feature policy='require' name='rdctl-no'/>
   <feature policy='require' name='skip-l1dfl-vmentry'/>
   <feature policy='require' name='mds-no'/>
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 7bfd786ff6..b2a7087a0e 100644
--- a/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml
+++ b/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml
@@ -90,6 +90,7 @@
       <model usable='yes'>Haswell-noTSX</model>
       <model usable='yes'>Haswell-IBRS</model>
       <model usable='yes'>Haswell</model>
+      <model usable='no'>EPYC-Rome</model>
       <model usable='no'>EPYC-IBPB</model>
       <model usable='no'>EPYC</model>
       <model usable='no'>Dhyana</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 eb456dea28..39b11fb634 100644
--- a/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml
+++ b/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml
@@ -100,6 +100,7 @@
       <model usable='no'>Haswell-noTSX</model>
       <model usable='no'>Haswell-IBRS</model>
       <model usable='no'>Haswell</model>
+      <model usable='no'>EPYC-Rome</model>
       <model usable='no'>EPYC-IBPB</model>
       <model usable='no'>EPYC</model>
       <model usable='no'>Dhyana</model>
diff --git a/tests/domaincapsdata/qemu_5.0.0.x86_64.xml b/tests/domaincapsdata/qemu_5.0.0.x86_64.xml
index d6ee66ab60..3a1ee23302 100644
--- a/tests/domaincapsdata/qemu_5.0.0.x86_64.xml
+++ b/tests/domaincapsdata/qemu_5.0.0.x86_64.xml
@@ -89,6 +89,7 @@
       <model usable='yes'>Haswell-noTSX</model>
       <model usable='yes'>Haswell-IBRS</model>
       <model usable='yes'>Haswell</model>
+      <model usable='no'>EPYC-Rome</model>
       <model usable='no'>EPYC-IBPB</model>
       <model usable='no'>EPYC</model>
       <model usable='no'>Dhyana</model>
-- 
2.29.2