From: Brijesh Singh <brijesh.singh(a)amd.com>
Add a new CPU model called 'EPYC' to model processors from AMD EPYC
family (which includes EPYC 76xx,75xx,74xx, 73xx and 72xx).
The following features bits have been added/removed compare to Opteron_G5
Added: monitor, movbe, rdrand, mmxext, ffxsr, rdtscp, cr8legacy, osvw,
fsgsbase, bmi1, avx2, smep, bmi2, rdseed, adx, smap, clfshopt, sha
xsaveopt, xsavec, xgetbv1, arat
Removed: xop, fma4, tbm
The patch is depend on EPYC CPU model supported introduced in qemu [1]
[1]
https://patchwork.kernel.org/patch/9902205/
Cc: Tom Lendacky <Thomas.Lendacky(a)amd.com>
Signed-off-by: Brijesh Singh <brijesh.singh(a)amd.com>
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/cpu/cpu_map.xml | 74 ++++++++++++++++++++++
...x86_64-cpuid-Ryzen-7-1800X-Eight-Core-guest.xml | 26 +-------
.../x86_64-cpuid-Ryzen-7-1800X-Eight-Core-host.xml | 33 +---------
.../x86_64-cpuid-Ryzen-7-1800X-Eight-Core-json.xml | 27 +-------
4 files changed, 79 insertions(+), 81 deletions(-)
diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml
index 8e7ac4973d..6243fbe902 100644
--- a/src/cpu/cpu_map.xml
+++ b/src/cpu/cpu_map.xml
@@ -260,6 +260,9 @@
<feature name='avx512cd'>
<cpuid eax_in='0x07' ecx_in='0x00'
ebx='0x10000000'/>
</feature>
+ <feature name='sha-ni'>
+ <cpuid eax_in='0x07' ecx_in='0x00'
ebx='0x20000000'/>
+ </feature>
<feature name='avx512bw'>
<cpuid eax_in='0x07' ecx_in='0x00'
ebx='0x40000000'/>
</feature>
@@ -1545,6 +1548,77 @@
<feature name='xop'/>
<feature name='xsave'/>
</model>
+
+ <model name='EPYC'>
+ <signature family='23' model='1'/>
+ <vendor name='AMD'/>
+ <feature name='3dnowprefetch'/>
+ <feature name='abm'/>
+ <feature name='adx'/>
+ <feature name='aes'/>
+ <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='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='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='nx'/>
+ <feature name='osvw'/>
+ <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='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='vme'/>
+ <feature name='xgetbv1'/>
+ <feature name='xsave'/>
+ <feature name='xsavec'/>
+ <feature name='xsaveopt'/>
+ </model>
</arch>
<arch name='ppc64'>
diff --git a/tests/cputestdata/x86_64-cpuid-Ryzen-7-1800X-Eight-Core-guest.xml
b/tests/cputestdata/x86_64-cpuid-Ryzen-7-1800X-Eight-Core-guest.xml
index fcad36e34e..18edb71bcd 100644
--- a/tests/cputestdata/x86_64-cpuid-Ryzen-7-1800X-Eight-Core-guest.xml
+++ b/tests/cputestdata/x86_64-cpuid-Ryzen-7-1800X-Eight-Core-guest.xml
@@ -1,32 +1,11 @@
<cpu mode='custom' match='exact'>
- <model fallback='forbid'>Opteron_G5</model>
+ <model fallback='forbid'>EPYC</model>
<vendor>AMD</vendor>
- <feature policy='require' name='vme'/>
<feature policy='require' name='ht'/>
- <feature policy='require' name='monitor'/>
- <feature policy='require' name='movbe'/>
<feature policy='require' name='osxsave'/>
- <feature policy='require' name='rdrand'/>
- <feature policy='require' name='arat'/>
- <feature policy='require' name='fsgsbase'/>
- <feature policy='require' name='bmi1'/>
- <feature policy='require' name='avx2'/>
- <feature policy='require' name='smep'/>
- <feature policy='require' name='bmi2'/>
- <feature policy='require' name='rdseed'/>
- <feature policy='require' name='adx'/>
- <feature policy='require' name='smap'/>
- <feature policy='require' name='clflushopt'/>
- <feature policy='require' name='xsaveopt'/>
- <feature policy='require' name='xsavec'/>
- <feature policy='require' name='xgetbv1'/>
<feature policy='require' name='xsaves'/>
- <feature policy='require' name='mmxext'/>
- <feature policy='require' name='fxsr_opt'/>
<feature policy='require' name='cmp_legacy'/>
<feature policy='require' name='extapic'/>
- <feature policy='require' name='cr8legacy'/>
- <feature policy='require' name='osvw'/>
<feature policy='require' name='skinit'/>
<feature policy='require' name='wdt'/>
<feature policy='require' name='tce'/>
@@ -34,7 +13,4 @@
<feature policy='require' name='perfctr_core'/>
<feature policy='require' name='perfctr_nb'/>
<feature policy='require' name='invtsc'/>
- <feature policy='disable' name='xop'/>
- <feature policy='disable' name='fma4'/>
- <feature policy='disable' name='tbm'/>
</cpu>
diff --git a/tests/cputestdata/x86_64-cpuid-Ryzen-7-1800X-Eight-Core-host.xml
b/tests/cputestdata/x86_64-cpuid-Ryzen-7-1800X-Eight-Core-host.xml
index 19f6b1d4df..54afdea4d4 100644
--- a/tests/cputestdata/x86_64-cpuid-Ryzen-7-1800X-Eight-Core-host.xml
+++ b/tests/cputestdata/x86_64-cpuid-Ryzen-7-1800X-Eight-Core-host.xml
@@ -1,43 +1,12 @@
<cpu>
<arch>x86_64</arch>
- <model>Opteron_G3</model>
+ <model>EPYC</model>
<vendor>AMD</vendor>
- <feature name='vme'/>
<feature name='ht'/>
- <feature name='pclmuldq'/>
- <feature name='ssse3'/>
- <feature name='fma'/>
- <feature name='sse4.1'/>
- <feature name='sse4.2'/>
- <feature name='movbe'/>
- <feature name='aes'/>
- <feature name='xsave'/>
<feature name='osxsave'/>
- <feature name='avx'/>
- <feature name='f16c'/>
- <feature name='rdrand'/>
- <feature name='arat'/>
- <feature name='fsgsbase'/>
- <feature name='bmi1'/>
- <feature name='avx2'/>
- <feature name='smep'/>
- <feature name='bmi2'/>
- <feature name='rdseed'/>
- <feature name='adx'/>
- <feature name='smap'/>
- <feature name='clflushopt'/>
- <feature name='xsaveopt'/>
- <feature name='xsavec'/>
- <feature name='xgetbv1'/>
<feature name='xsaves'/>
- <feature name='mmxext'/>
- <feature name='fxsr_opt'/>
- <feature name='pdpe1gb'/>
<feature name='cmp_legacy'/>
<feature name='extapic'/>
- <feature name='cr8legacy'/>
- <feature name='3dnowprefetch'/>
- <feature name='osvw'/>
<feature name='skinit'/>
<feature name='wdt'/>
<feature name='tce'/>
diff --git a/tests/cputestdata/x86_64-cpuid-Ryzen-7-1800X-Eight-Core-json.xml
b/tests/cputestdata/x86_64-cpuid-Ryzen-7-1800X-Eight-Core-json.xml
index 2773147da6..32064548c7 100644
--- a/tests/cputestdata/x86_64-cpuid-Ryzen-7-1800X-Eight-Core-json.xml
+++ b/tests/cputestdata/x86_64-cpuid-Ryzen-7-1800X-Eight-Core-json.xml
@@ -1,32 +1,11 @@
<cpu mode='custom' match='exact'>
- <model fallback='forbid'>Opteron_G5</model>
+ <model fallback='forbid'>EPYC</model>
<vendor>AMD</vendor>
- <feature policy='require' name='vme'/>
<feature policy='require' name='x2apic'/>
- <feature policy='require' name='movbe'/>
<feature policy='require' name='tsc-deadline'/>
- <feature policy='require' name='rdrand'/>
<feature policy='require' name='hypervisor'/>
- <feature policy='require' name='arat'/>
- <feature policy='require' name='fsgsbase'/>
<feature policy='require' name='tsc_adjust'/>
- <feature policy='require' name='bmi1'/>
- <feature policy='require' name='avx2'/>
- <feature policy='require' name='smep'/>
- <feature policy='require' name='bmi2'/>
- <feature policy='require' name='rdseed'/>
- <feature policy='require' name='adx'/>
- <feature policy='require' name='smap'/>
- <feature policy='require' name='clflushopt'/>
- <feature policy='require' name='xsaveopt'/>
- <feature policy='require' name='xsavec'/>
- <feature policy='require' name='xgetbv1'/>
- <feature policy='require' name='mmxext'/>
- <feature policy='require' name='fxsr_opt'/>
<feature policy='require' name='cmp_legacy'/>
- <feature policy='require' name='cr8legacy'/>
- <feature policy='require' name='osvw'/>
- <feature policy='disable' name='xop'/>
- <feature policy='disable' name='fma4'/>
- <feature policy='disable' name='tbm'/>
+ <feature policy='disable' name='monitor'/>
+ <feature policy='disable' name='sha-ni'/>
</cpu>
--
2.14.1