Signed-off-by: Lin Yang <lin.a.y...@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

Reply via email to