fbe740
From 1c8af21807f2cdaaa24651808f6dfeebfbcf75bb Mon Sep 17 00:00:00 2001
fbe740
Message-Id: <1c8af21807f2cdaaa24651808f6dfeebfbcf75bb@dist-git>
fbe740
From: Jiri Denemark <jdenemar@redhat.com>
fbe740
Date: Tue, 26 May 2020 10:59:40 +0200
fbe740
Subject: [PATCH] cpu_map: Add Cooperlake x86 CPU model
fbe740
MIME-Version: 1.0
fbe740
Content-Type: text/plain; charset=UTF-8
fbe740
Content-Transfer-Encoding: 8bit
fbe740
fbe740
The stepping range (10-11) is likely incomplete. QEMU uses 10 and the
fbe740
CPUID data for Cooperlake show 11. We will update the range if needed
fbe740
once more details about he CPU are available.
fbe740
fbe740
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
fbe740
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
fbe740
(cherry picked from commit 3944f6855b9d4df73754bb6e5c8023d77399879b)
fbe740
fbe740
https://bugzilla.redhat.com/show_bug.cgi?id=1781878
fbe740
fbe740
Conflicts:
fbe740
	tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml
fbe740
	tests/domaincapsdata/qemu_5.1.0-tcg.x86_64.xml
fbe740
	tests/domaincapsdata/qemu_5.1.0.x86_64.xml
fbe740
            - test data files do not exist downstream
fbe740
fbe740
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
fbe740
Message-Id: <62f2fa3e2ecab2026c41e93430b4e2b695c674f0.1590483392.git.jdenemar@redhat.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
---
fbe740
 src/cpu_map/index.xml                         |  1 +
fbe740
 src/cpu_map/x86_Cooperlake.xml                | 90 +++++++++++++++++++
fbe740
 .../x86_64-cpuid-Cooperlake-guest.xml         | 13 +--
fbe740
 .../x86_64-cpuid-Cooperlake-host.xml          | 13 +--
fbe740
 .../x86_64-cpuid-Cooperlake-json.xml          | 13 +--
fbe740
 .../domaincapsdata/qemu_5.0.0-q35.x86_64.xml  |  1 +
fbe740
 .../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml  |  1 +
fbe740
 tests/domaincapsdata/qemu_5.0.0.x86_64.xml    |  1 +
fbe740
 8 files changed, 100 insertions(+), 33 deletions(-)
fbe740
 create mode 100644 src/cpu_map/x86_Cooperlake.xml
fbe740
fbe740
diff --git a/src/cpu_map/index.xml b/src/cpu_map/index.xml
fbe740
index 50b030de29..ff1da2e677 100644
fbe740
--- a/src/cpu_map/index.xml
fbe740
+++ b/src/cpu_map/index.xml
fbe740
@@ -54,6 +54,7 @@
fbe740
     <include filename="x86_Icelake-Client-noTSX.xml"/>
fbe740
     <include filename="x86_Icelake-Server.xml"/>
fbe740
     <include filename="x86_Icelake-Server-noTSX.xml"/>
fbe740
+    <include filename="x86_Cooperlake.xml"/>
fbe740
 
fbe740
     
fbe740
     <include filename="x86_athlon.xml"/>
fbe740
diff --git a/src/cpu_map/x86_Cooperlake.xml b/src/cpu_map/x86_Cooperlake.xml
fbe740
new file mode 100644
fbe740
index 0000000000..41bd210638
fbe740
--- /dev/null
fbe740
+++ b/src/cpu_map/x86_Cooperlake.xml
fbe740
@@ -0,0 +1,90 @@
fbe740
+<cpus>
fbe740
+  <model name='Cooperlake'>
fbe740
+    <decode host='on' guest='on'/>
fbe740
+    <signature family='6' model='85' stepping='10-11'/> 
fbe740
+    <vendor name='Intel'/>
fbe740
+    <feature name="3dnowprefetch"/>
fbe740
+    <feature name="abm"/>
fbe740
+    <feature name="adx"/>
fbe740
+    <feature name="aes"/>
fbe740
+    <feature name="apic"/>
fbe740
+    <feature name="arat"/>
fbe740
+    <feature name="arch-capabilities"/>
fbe740
+    <feature name="avx"/>
fbe740
+    <feature name="avx2"/>
fbe740
+    <feature name="avx512-bf16"/>
fbe740
+    <feature name="avx512bw"/>
fbe740
+    <feature name="avx512cd"/>
fbe740
+    <feature name="avx512dq"/>
fbe740
+    <feature name="avx512f"/>
fbe740
+    <feature name="avx512vl"/>
fbe740
+    <feature name="avx512vnni"/>
fbe740
+    <feature name="bmi1"/>
fbe740
+    <feature name="bmi2"/>
fbe740
+    <feature name="clflush"/>
fbe740
+    <feature name="clflushopt"/>
fbe740
+    <feature name="clwb"/>
fbe740
+    <feature name="cmov"/>
fbe740
+    <feature name="cx16"/>
fbe740
+    <feature name="cx8"/>
fbe740
+    <feature name="de"/>
fbe740
+    <feature name="erms"/>
fbe740
+    <feature name="f16c"/>
fbe740
+    <feature name="fma"/>
fbe740
+    <feature name="fpu"/>
fbe740
+    <feature name="fsgsbase"/>
fbe740
+    <feature name="fxsr"/>
fbe740
+    <feature name="hle"/>
fbe740
+    <feature name="ibrs-all"/>
fbe740
+    <feature name="invpcid"/>
fbe740
+    <feature name="lahf_lm"/>
fbe740
+    <feature name="lm"/>
fbe740
+    <feature name="mca"/>
fbe740
+    <feature name="mce"/>
fbe740
+    <feature name="mds-no"/>
fbe740
+    <feature name="mmx"/>
fbe740
+    <feature name="movbe"/>
fbe740
+    <feature name="msr"/>
fbe740
+    <feature name="mtrr"/>
fbe740
+    <feature name="nx"/>
fbe740
+    <feature name="pae"/>
fbe740
+    <feature name="pat"/>
fbe740
+    <feature name="pcid"/>
fbe740
+    <feature name="pclmuldq"/>
fbe740
+    <feature name="pdpe1gb"/>
fbe740
+    <feature name="pge"/>
fbe740
+    <feature name="pku"/>
fbe740
+    <feature name="pni"/>
fbe740
+    <feature name="popcnt"/>
fbe740
+    <feature name="pschange-mc-no"/>
fbe740
+    <feature name="pse"/>
fbe740
+    <feature name="pse36"/>
fbe740
+    <feature name="rdctl-no"/>
fbe740
+    <feature name="rdrand"/>
fbe740
+    <feature name="rdseed"/>
fbe740
+    <feature name="rdtscp"/>
fbe740
+    <feature name="rtm"/>
fbe740
+    <feature name="sep"/>
fbe740
+    <feature name="skip-l1dfl-vmentry"/>
fbe740
+    <feature name="smap"/>
fbe740
+    <feature name="smep"/>
fbe740
+    <feature name="spec-ctrl"/>
fbe740
+    <feature name="ssbd"/>
fbe740
+    <feature name="sse"/>
fbe740
+    <feature name="sse2"/>
fbe740
+    <feature name="sse4.1"/>
fbe740
+    <feature name="sse4.2"/>
fbe740
+    <feature name="ssse3"/>
fbe740
+    <feature name="stibp"/>
fbe740
+    <feature name="syscall"/>
fbe740
+    <feature name="taa-no"/>
fbe740
+    <feature name="tsc"/>
fbe740
+    <feature name="tsc-deadline"/>
fbe740
+    <feature name="vme"/>
fbe740
+    <feature name="x2apic"/>
fbe740
+    <feature name="xgetbv1"/>
fbe740
+    <feature name="xsave"/>
fbe740
+    <feature name="xsavec"/>
fbe740
+    <feature name="xsaveopt"/>
fbe740
+  </model>
fbe740
+</cpus>
fbe740
diff --git a/tests/cputestdata/x86_64-cpuid-Cooperlake-guest.xml b/tests/cputestdata/x86_64-cpuid-Cooperlake-guest.xml
fbe740
index db5598740c..f169458399 100644
fbe740
--- a/tests/cputestdata/x86_64-cpuid-Cooperlake-guest.xml
fbe740
+++ b/tests/cputestdata/x86_64-cpuid-Cooperlake-guest.xml
fbe740
@@ -1,5 +1,5 @@
fbe740
 <cpu mode='custom' match='exact'>
fbe740
-  <model fallback='forbid'>Cascadelake-Server</model>
fbe740
+  <model fallback='forbid'>Cooperlake</model>
fbe740
   <vendor>Intel</vendor>
fbe740
   <feature policy='require' name='ds'/>
fbe740
   <feature policy='require' name='acpi'/>
fbe740
@@ -20,22 +20,13 @@
fbe740
   <feature policy='require' name='osxsave'/>
fbe740
   <feature policy='require' name='tsc_adjust'/>
fbe740
   <feature policy='require' name='cmt'/>
fbe740
+  <feature policy='require' name='mpx'/>
fbe740
   <feature policy='require' name='intel-pt'/>
fbe740
-  <feature policy='require' name='pku'/>
fbe740
   <feature policy='require' name='ospke'/>
fbe740
   <feature policy='require' name='md-clear'/>
fbe740
-  <feature policy='require' name='stibp'/>
fbe740
-  <feature policy='require' name='arch-capabilities'/>
fbe740
-  <feature policy='require' name='avx512-bf16'/>
fbe740
   <feature policy='require' name='xsaves'/>
fbe740
   <feature policy='require' name='mbm_total'/>
fbe740
   <feature policy='require' name='mbm_local'/>
fbe740
   <feature policy='require' name='invtsc'/>
fbe740
-  <feature policy='require' name='rdctl-no'/>
fbe740
-  <feature policy='require' name='ibrs-all'/>
fbe740
-  <feature policy='require' name='skip-l1dfl-vmentry'/>
fbe740
-  <feature policy='require' name='mds-no'/>
fbe740
-  <feature policy='require' name='pschange-mc-no'/>
fbe740
   <feature policy='require' name='tsx-ctrl'/>
fbe740
-  <feature policy='require' name='taa-no'/>
fbe740
 </cpu>
fbe740
diff --git a/tests/cputestdata/x86_64-cpuid-Cooperlake-host.xml b/tests/cputestdata/x86_64-cpuid-Cooperlake-host.xml
fbe740
index 6926b7c975..b0777181bb 100644
fbe740
--- a/tests/cputestdata/x86_64-cpuid-Cooperlake-host.xml
fbe740
+++ b/tests/cputestdata/x86_64-cpuid-Cooperlake-host.xml
fbe740
@@ -1,6 +1,6 @@
fbe740
 <cpu>
fbe740
   <arch>x86_64</arch>
fbe740
-  <model>Cascadelake-Server</model>
fbe740
+  <model>Cooperlake</model>
fbe740
   <vendor>Intel</vendor>
fbe740
   <feature name='ds'/>
fbe740
   <feature name='acpi'/>
fbe740
@@ -21,22 +21,13 @@
fbe740
   <feature name='osxsave'/>
fbe740
   <feature name='tsc_adjust'/>
fbe740
   <feature name='cmt'/>
fbe740
+  <feature name='mpx'/>
fbe740
   <feature name='intel-pt'/>
fbe740
-  <feature name='pku'/>
fbe740
   <feature name='ospke'/>
fbe740
   <feature name='md-clear'/>
fbe740
-  <feature name='stibp'/>
fbe740
-  <feature name='arch-capabilities'/>
fbe740
-  <feature name='avx512-bf16'/>
fbe740
   <feature name='xsaves'/>
fbe740
   <feature name='mbm_total'/>
fbe740
   <feature name='mbm_local'/>
fbe740
   <feature name='invtsc'/>
fbe740
-  <feature name='rdctl-no'/>
fbe740
-  <feature name='ibrs-all'/>
fbe740
-  <feature name='skip-l1dfl-vmentry'/>
fbe740
-  <feature name='mds-no'/>
fbe740
-  <feature name='pschange-mc-no'/>
fbe740
   <feature name='tsx-ctrl'/>
fbe740
-  <feature name='taa-no'/>
fbe740
 </cpu>
fbe740
diff --git a/tests/cputestdata/x86_64-cpuid-Cooperlake-json.xml b/tests/cputestdata/x86_64-cpuid-Cooperlake-json.xml
fbe740
index fc52805b2f..fb319d547c 100644
fbe740
--- a/tests/cputestdata/x86_64-cpuid-Cooperlake-json.xml
fbe740
+++ b/tests/cputestdata/x86_64-cpuid-Cooperlake-json.xml
fbe740
@@ -1,24 +1,15 @@
fbe740
 <cpu mode='custom' match='exact'>
fbe740
-  <model fallback='forbid'>Cascadelake-Server</model>
fbe740
+  <model fallback='forbid'>Cooperlake</model>
fbe740
   <vendor>Intel</vendor>
fbe740
   <feature policy='require' name='ss'/>
fbe740
   <feature policy='require' name='vmx'/>
fbe740
   <feature policy='require' name='hypervisor'/>
fbe740
   <feature policy='require' name='tsc_adjust'/>
fbe740
+  <feature policy='require' name='mpx'/>
fbe740
   <feature policy='require' name='umip'/>
fbe740
-  <feature policy='require' name='pku'/>
fbe740
   <feature policy='require' name='md-clear'/>
fbe740
-  <feature policy='require' name='stibp'/>
fbe740
-  <feature policy='require' name='arch-capabilities'/>
fbe740
-  <feature policy='require' name='avx512-bf16'/>
fbe740
   <feature policy='require' name='xsaves'/>
fbe740
   <feature policy='require' name='ibpb'/>
fbe740
   <feature policy='require' name='amd-ssbd'/>
fbe740
-  <feature policy='require' name='rdctl-no'/>
fbe740
-  <feature policy='require' name='ibrs-all'/>
fbe740
-  <feature policy='require' name='skip-l1dfl-vmentry'/>
fbe740
-  <feature policy='require' name='mds-no'/>
fbe740
-  <feature policy='require' name='pschange-mc-no'/>
fbe740
   <feature policy='require' name='tsx-ctrl'/>
fbe740
-  <feature policy='require' name='taa-no'/>
fbe740
 </cpu>
fbe740
diff --git a/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml
fbe740
index b7e2c8a4fe..7bfd786ff6 100644
fbe740
--- a/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml
fbe740
+++ b/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml
fbe740
@@ -93,6 +93,7 @@
fbe740
       <model usable='no'>EPYC-IBPB</model>
fbe740
       <model usable='no'>EPYC</model>
fbe740
       <model usable='no'>Dhyana</model>
fbe740
+      <model usable='no'>Cooperlake</model>
fbe740
       <model usable='yes'>Conroe</model>
fbe740
       <model usable='no'>Cascadelake-Server-noTSX</model>
fbe740
       <model usable='no'>Cascadelake-Server</model>
fbe740
diff --git a/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml
fbe740
index d634803b29..0a4bb16a89 100644
fbe740
--- a/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml
fbe740
+++ b/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml
fbe740
@@ -101,6 +101,7 @@
fbe740
       <model usable='no'>EPYC-IBPB</model>
fbe740
       <model usable='no'>EPYC</model>
fbe740
       <model usable='no'>Dhyana</model>
fbe740
+      <model usable='no'>Cooperlake</model>
fbe740
       <model usable='yes'>Conroe</model>
fbe740
       <model usable='no'>Cascadelake-Server-noTSX</model>
fbe740
       <model usable='no'>Cascadelake-Server</model>
fbe740
diff --git a/tests/domaincapsdata/qemu_5.0.0.x86_64.xml b/tests/domaincapsdata/qemu_5.0.0.x86_64.xml
fbe740
index d2741375b4..d6ee66ab60 100644
fbe740
--- a/tests/domaincapsdata/qemu_5.0.0.x86_64.xml
fbe740
+++ b/tests/domaincapsdata/qemu_5.0.0.x86_64.xml
fbe740
@@ -92,6 +92,7 @@
fbe740
       <model usable='no'>EPYC-IBPB</model>
fbe740
       <model usable='no'>EPYC</model>
fbe740
       <model usable='no'>Dhyana</model>
fbe740
+      <model usable='no'>Cooperlake</model>
fbe740
       <model usable='yes'>Conroe</model>
fbe740
       <model usable='no'>Cascadelake-Server-noTSX</model>
fbe740
       <model usable='no'>Cascadelake-Server</model>
fbe740
-- 
fbe740
2.26.2
fbe740