[libvirt 1/2] cpu_map: Add SapphireRapids CPU model

Introduced in QEMU by commit v8.0.0-7eb061b06e. Signed-off-by: Lin Yang <lin.a.yang@intel.com> --- src/cpu_map/index.xml | 1 + src/cpu_map/meson.build | 1 + src/cpu_map/x86_SapphireRapids.xml | 116 +++++++++++++++++++++++++++++ 3 files changed, 118 insertions(+) create mode 100644 src/cpu_map/x86_SapphireRapids.xml diff --git a/src/cpu_map/index.xml b/src/cpu_map/index.xml index deae92552f..0187016c1c 100644 --- a/src/cpu_map/index.xml +++ b/src/cpu_map/index.xml @@ -56,6 +56,7 @@ <include filename='x86_Icelake-Server-noTSX.xml'/> <include filename='x86_Cooperlake.xml'/> <include filename='x86_Snowridge.xml'/> + <include filename='x86_SapphireRapids.xml'/> <!-- AMD CPUs --> <include filename='x86_athlon.xml'/> diff --git a/src/cpu_map/meson.build b/src/cpu_map/meson.build index 55c3703006..fa83b23474 100644 --- a/src/cpu_map/meson.build +++ b/src/cpu_map/meson.build @@ -72,6 +72,7 @@ cpumap_data = [ 'x86_qemu64.xml', 'x86_SandyBridge-IBRS.xml', 'x86_SandyBridge.xml', + 'x86_SapphireRapids.xml', 'x86_Skylake-Client-IBRS.xml', 'x86_Skylake-Client-noTSX-IBRS.xml', 'x86_Skylake-Client.xml', diff --git a/src/cpu_map/x86_SapphireRapids.xml b/src/cpu_map/x86_SapphireRapids.xml new file mode 100644 index 0000000000..2297feeeca --- /dev/null +++ b/src/cpu_map/x86_SapphireRapids.xml @@ -0,0 +1,116 @@ +<cpus> + <model name='SapphireRapids'> + <decode host='on' guest='on'/> + <signature family='6' model='143'/> + <vendor name='Intel'/> + <feature name='3dnowprefetch'/> + <feature name='abm'/> + <feature name='adx'/> + <feature name='aes'/> + <feature name='amx-bf16'/> + <feature name='amx-int8'/> + <feature name='amx-tile'/> + <feature name='apic'/> + <feature name='arat'/> + <feature name='arch-capabilities'/> + <feature name='avx'/> + <feature name='avx-vnni'/> + <feature name='avx2'/> + <feature name='avx512-bf16'/> + <feature name='avx512-fp16'/> + <feature name='avx512-vpopcntdq'/> + <feature name='avx512bitalg'/> + <feature name='avx512bw'/> + <feature name='avx512cd'/> + <feature name='avx512dq'/> + <feature name='avx512f'/> + <feature name='avx512ifma'/> + <feature name='avx512vbmi'/> + <feature name='avx512vbmi2'/> + <feature name='avx512vl'/> + <feature name='avx512vnni'/> + <feature name='bmi1'/> + <feature name='bmi2'/> + <feature name='bus-lock-detect'/> + <feature name='clflush'/> + <feature name='clflushopt'/> + <feature name='clwb'/> + <feature name='cmov'/> + <feature name='cx16'/> + <feature name='cx8'/> + <feature name='de'/> + <feature name='erms'/> + <feature name='f16c'/> + <feature name='fma'/> + <feature name='fpu'/> + <feature name='fsgsbase'/> + <feature name='fsrc'/> + <feature name='fsrm'/> + <feature name='fsrs'/> + <feature name='fxsr'/> + <feature name='fzrm'/> + <feature name='gfni'/> + <feature name='hle'/> + <feature name='ibrs-all'/> + <feature name='invpcid'/> + <feature name='la57'/> + <feature name='lahf_lm'/> + <feature name='lm'/> + <feature name='mca'/> + <feature name='mce'/> + <feature name='mds-no'/> + <feature name='mmx'/> + <feature name='movbe'/> + <feature name='msr'/> + <feature name='mtrr'/> + <feature name='nx'/> + <feature name='pae'/> + <feature name='pat'/> + <feature name='pcid'/> + <feature name='pclmuldq'/> + <feature name='pdpe1gb'/> + <feature name='pge'/> + <feature name='pku'/> + <feature name='pni'/> + <feature name='popcnt'/> + <feature name='pschange-mc-no'/> + <feature name='pse'/> + <feature name='pse36'/> + <feature name='rdctl-no'/> + <feature name='rdpid'/> + <feature name='rdrand'/> + <feature name='rdseed'/> + <feature name='rdtscp'/> + <feature name='rtm'/> + <feature name='sep'/> + <feature name='serialize'/> + <feature name='sha-ni'/> + <feature name='skip-l1dfl-vmentry'/> + <feature name='smap'/> + <feature name='smep'/> + <feature name='spec-ctrl'/> + <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='taa-no'/> + <feature name='tsc'/> + <feature name='tsc-deadline'/> + <feature name='tsx-ldtrk'/> + <feature name='umip'/> + <feature name='vaes'/> + <feature name='vme'/> + <feature name='vpclmulqdq'/> + <feature name='wbnoinvd'/> + <feature name='x2apic'/> + <feature name='xfd'/> + <feature name='xgetbv1'/> + <feature name='xsave'/> + <feature name='xsavec'/> + <feature name='xsaveopt'/> + <feature name='xsaves'/> + </model> +</cpus> -- 2.25.1

Signed-off-by: Lin Yang <lin.a.yang@intel.com> --- .../domaincapsdata/qemu_8.0.0-q35.x86_64.xml | 1 + .../domaincapsdata/qemu_8.0.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.0.0.x86_64.xml | 1 + .../cpu-SapphireRapids.x86_64-latest.args | 33 +++++++++++++++++++ tests/qemuxml2argvdata/cpu-SapphireRapids.xml | 21 ++++++++++++ tests/qemuxml2argvtest.c | 1 + .../cpu-SapphireRapids.x86_64-latest.xml | 31 +++++++++++++++++ tests/qemuxml2xmltest.c | 2 ++ 8 files changed, 91 insertions(+) create mode 100644 tests/qemuxml2argvdata/cpu-SapphireRapids.x86_64-latest.args create mode 100644 tests/qemuxml2argvdata/cpu-SapphireRapids.xml create mode 100644 tests/qemuxml2xmloutdata/cpu-SapphireRapids.x86_64-latest.xml diff --git a/tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml index 8b863a9d40..c1a1c0b733 100644 --- a/tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml @@ -91,6 +91,7 @@ <model usable='no' vendor='Intel'>Skylake-Client-noTSX-IBRS</model> <model usable='no' vendor='Intel'>Skylake-Client-IBRS</model> <model usable='no' vendor='Intel'>Skylake-Client</model> + <model usable='no' vendor='Intel'>SapphireRapids</model> <model usable='no' vendor='Intel'>SandyBridge-IBRS</model> <model usable='yes' vendor='Intel'>SandyBridge</model> <model usable='yes' vendor='Intel'>Penryn</model> diff --git a/tests/domaincapsdata/qemu_8.0.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_8.0.0-tcg.x86_64.xml index f258686c87..cde1d70f09 100644 --- a/tests/domaincapsdata/qemu_8.0.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.0.0-tcg.x86_64.xml @@ -93,6 +93,7 @@ <model usable='no' vendor='Intel'>Skylake-Client-noTSX-IBRS</model> <model usable='no' vendor='Intel'>Skylake-Client-IBRS</model> <model usable='no' vendor='Intel'>Skylake-Client</model> + <model usable='no' vendor='Intel'>SapphireRapids</model> <model usable='no' vendor='Intel'>SandyBridge-IBRS</model> <model usable='no' vendor='Intel'>SandyBridge</model> <model usable='yes' vendor='Intel'>Penryn</model> diff --git a/tests/domaincapsdata/qemu_8.0.0.x86_64.xml b/tests/domaincapsdata/qemu_8.0.0.x86_64.xml index 2f2c49bd3a..412847aa62 100644 --- a/tests/domaincapsdata/qemu_8.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.0.0.x86_64.xml @@ -90,6 +90,7 @@ <model usable='no' vendor='Intel'>Skylake-Client-noTSX-IBRS</model> <model usable='no' vendor='Intel'>Skylake-Client-IBRS</model> <model usable='no' vendor='Intel'>Skylake-Client</model> + <model usable='no' vendor='Intel'>SapphireRapids</model> <model usable='no' vendor='Intel'>SandyBridge-IBRS</model> <model usable='yes' vendor='Intel'>SandyBridge</model> <model usable='yes' vendor='Intel'>Penryn</model> diff --git a/tests/qemuxml2argvdata/cpu-SapphireRapids.x86_64-latest.args b/tests/qemuxml2argvdata/cpu-SapphireRapids.x86_64-latest.args new file mode 100644 index 0000000000..7a3d859ad8 --- /dev/null +++ b/tests/qemuxml2argvdata/cpu-SapphireRapids.x86_64-latest.args @@ -0,0 +1,33 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-test \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-test/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-test/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=test,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-test/master-key.aes"}' \ +-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \ +-accel kvm \ +-cpu SapphireRapids \ +-m 214 \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/cpu-SapphireRapids.xml b/tests/qemuxml2argvdata/cpu-SapphireRapids.xml new file mode 100644 index 0000000000..c80238967c --- /dev/null +++ b/tests/qemuxml2argvdata/cpu-SapphireRapids.xml @@ -0,0 +1,21 @@ +<domain type='kvm'> + <name>test</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64' machine='pc'>hvm</type> + <boot dev='network'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>SapphireRapids</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 93d5ae018f..6829bf0dc4 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2697,6 +2697,7 @@ mymain(void) DO_TEST_CAPS_LATEST("crypto-builtin"); + DO_TEST_CAPS_LATEST("cpu-SapphireRapids"); qemuTestDriverFree(&driver); virFileWrapperClearPrefixes(); diff --git a/tests/qemuxml2xmloutdata/cpu-SapphireRapids.x86_64-latest.xml b/tests/qemuxml2xmloutdata/cpu-SapphireRapids.x86_64-latest.xml new file mode 100644 index 0000000000..af452b189c --- /dev/null +++ b/tests/qemuxml2xmloutdata/cpu-SapphireRapids.x86_64-latest.xml @@ -0,0 +1,31 @@ +<domain type='kvm'> + <name>test</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64' machine='pc'>hvm</type> + <boot dev='network'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>SapphireRapids</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='usb' index='0' model='piix3-uhci'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </memballoon> + </devices> +</domain> diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index fb6fa3579f..547ecfd88b 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1239,6 +1239,8 @@ mymain(void) DO_TEST_CAPS_LATEST("cpu-phys-bits-limit"); DO_TEST_CAPS_LATEST("cpu-phys-bits-emulate-bare"); + DO_TEST_CAPS_LATEST("cpu-SapphireRapids"); + cleanup: qemuTestDriverFree(&driver); virFileWrapperClearPrefixes(); -- 2.25.1

On Wed, 2023-05-17 at 17:30 -0700, Lin Yang wrote:
Introduced in QEMU by commit v8.0.0-7eb061b06e.
Signed-off-by: Lin Yang <lin.a.yang@intel.com> --- src/cpu_map/index.xml | 1 + src/cpu_map/meson.build | 1 + src/cpu_map/x86_SapphireRapids.xml | 116 +++++++++++++++++++++++++++++ 3 files changed, 118 insertions(+) create mode 100644 src/cpu_map/x86_SapphireRapids.xml
diff --git a/src/cpu_map/index.xml b/src/cpu_map/index.xml index deae92552f..0187016c1c 100644 --- a/src/cpu_map/index.xml +++ b/src/cpu_map/index.xml @@ -56,6 +56,7 @@ <include filename='x86_Icelake-Server-noTSX.xml'/> <include filename='x86_Cooperlake.xml'/> <include filename='x86_Snowridge.xml'/> + <include filename='x86_SapphireRapids.xml'/> <!-- AMD CPUs --> <include filename='x86_athlon.xml'/> diff --git a/src/cpu_map/meson.build b/src/cpu_map/meson.build index 55c3703006..fa83b23474 100644 --- a/src/cpu_map/meson.build +++ b/src/cpu_map/meson.build @@ -72,6 +72,7 @@ cpumap_data = [ 'x86_qemu64.xml', 'x86_SandyBridge-IBRS.xml', 'x86_SandyBridge.xml', + 'x86_SapphireRapids.xml', 'x86_Skylake-Client-IBRS.xml', 'x86_Skylake-Client-noTSX-IBRS.xml', 'x86_Skylake-Client.xml', diff --git a/src/cpu_map/x86_SapphireRapids.xml b/src/cpu_map/x86_SapphireRapids.xml new file mode 100644 index 0000000000..2297feeeca --- /dev/null +++ b/src/cpu_map/x86_SapphireRapids.xml @@ -0,0 +1,116 @@ +<cpus> + <model name='SapphireRapids'> + <decode host='on' guest='on'/> + <signature family='6' model='143'/> + <vendor name='Intel'/> + <feature name='3dnowprefetch'/> + <feature name='abm'/> + <feature name='adx'/> + <feature name='aes'/> + <feature name='amx-bf16'/> + <feature name='amx-int8'/> + <feature name='amx-tile'/> + <feature name='apic'/> + <feature name='arat'/> + <feature name='arch-capabilities'/> + <feature name='avx'/> + <feature name='avx-vnni'/> + <feature name='avx2'/> + <feature name='avx512-bf16'/> + <feature name='avx512-fp16'/> + <feature name='avx512-vpopcntdq'/> + <feature name='avx512bitalg'/> + <feature name='avx512bw'/> + <feature name='avx512cd'/> + <feature name='avx512dq'/> + <feature name='avx512f'/> + <feature name='avx512ifma'/> + <feature name='avx512vbmi'/> + <feature name='avx512vbmi2'/> + <feature name='avx512vl'/> + <feature name='avx512vnni'/> + <feature name='bmi1'/> + <feature name='bmi2'/> + <feature name='bus-lock-detect'/> + <feature name='clflush'/> + <feature name='clflushopt'/> + <feature name='clwb'/> + <feature name='cmov'/> + <feature name='cx16'/> + <feature name='cx8'/> + <feature name='de'/> + <feature name='erms'/> + <feature name='f16c'/> + <feature name='fma'/> + <feature name='fpu'/> + <feature name='fsgsbase'/> + <feature name='fsrc'/> + <feature name='fsrm'/> + <feature name='fsrs'/> + <feature name='fxsr'/> + <feature name='fzrm'/> + <feature name='gfni'/> + <feature name='hle'/> + <feature name='ibrs-all'/> + <feature name='invpcid'/> + <feature name='la57'/> + <feature name='lahf_lm'/> + <feature name='lm'/> + <feature name='mca'/> + <feature name='mce'/> + <feature name='mds-no'/> + <feature name='mmx'/> + <feature name='movbe'/> + <feature name='msr'/> + <feature name='mtrr'/> + <feature name='nx'/> + <feature name='pae'/> + <feature name='pat'/> + <feature name='pcid'/> + <feature name='pclmuldq'/> + <feature name='pdpe1gb'/> + <feature name='pge'/> + <feature name='pku'/> + <feature name='pni'/> + <feature name='popcnt'/> + <feature name='pschange-mc-no'/> + <feature name='pse'/> + <feature name='pse36'/> + <feature name='rdctl-no'/> + <feature name='rdpid'/> + <feature name='rdrand'/> + <feature name='rdseed'/> + <feature name='rdtscp'/> + <feature name='rtm'/> + <feature name='sep'/> + <feature name='serialize'/> + <feature name='sha-ni'/> + <feature name='skip-l1dfl-vmentry'/> + <feature name='smap'/> + <feature name='smep'/> + <feature name='spec-ctrl'/> + <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='taa-no'/> + <feature name='tsc'/> + <feature name='tsc-deadline'/> + <feature name='tsx-ldtrk'/> + <feature name='umip'/> + <feature name='vaes'/> + <feature name='vme'/> + <feature name='vpclmulqdq'/> + <feature name='wbnoinvd'/> + <feature name='x2apic'/> + <feature name='xfd'/> + <feature name='xgetbv1'/> + <feature name='xsave'/> + <feature name='xsavec'/> + <feature name='xsaveopt'/> + <feature name='xsaves'/> + </model> +</cpus>
Hi, This patch makes the tests fail. The changes to tests/domaincapsdata/*.xml from patch 2 should be merged into this commit. I went ahead and made that change so I could merge it directly. For patch 2 I am unclear on the necessity of the tests, so I would like to hear what others think first. Cheers, Tim
participants (2)
-
Lin Yang
-
Tim Wiederhake