[PATCH 2/2] tests: Add coverage for pauth Arm CPU feature

Andrea Bolognani posted 2 patches 2 months ago
[PATCH 2/2] tests: Add coverage for pauth Arm CPU feature
Posted by Andrea Bolognani 2 months ago
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 ...aarch64-features-pauth.aarch64-latest.args | 31 +++++++++++++++++++
 .../aarch64-features-pauth.aarch64-latest.xml | 28 +++++++++++++++++
 .../aarch64-features-pauth.xml                | 17 ++++++++++
 tests/qemuxmlconftest.c                       |  1 +
 4 files changed, 77 insertions(+)
 create mode 100644 tests/qemuxmlconfdata/aarch64-features-pauth.aarch64-latest.args
 create mode 100644 tests/qemuxmlconfdata/aarch64-features-pauth.aarch64-latest.xml
 create mode 100644 tests/qemuxmlconfdata/aarch64-features-pauth.xml

diff --git a/tests/qemuxmlconfdata/aarch64-features-pauth.aarch64-latest.args b/tests/qemuxmlconfdata/aarch64-features-pauth.aarch64-latest.args
new file mode 100644
index 0000000000..41714ae696
--- /dev/null
+++ b/tests/qemuxmlconfdata/aarch64-features-pauth.aarch64-latest.args
@@ -0,0 +1,31 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/var/lib/libvirt/qemu/domain--1-guest \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
+/usr/bin/qemu-system-aarch64 \
+-name guest=guest,debug-threads=on \
+-S \
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \
+-machine virt,usb=off,gic-version=3,dump-guest-core=off,memory-backend=mach-virt.ram,acpi=off \
+-accel kvm \
+-cpu host,pauth=off \
+-m size=1048576k \
+-object '{"qom-type":"memory-backend-ram","id":"mach-virt.ram","size":1073741824}' \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
+-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 \
+-audiodev '{"id":"audio1","driver":"none"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxmlconfdata/aarch64-features-pauth.aarch64-latest.xml b/tests/qemuxmlconfdata/aarch64-features-pauth.aarch64-latest.xml
new file mode 100644
index 0000000000..be7676bba4
--- /dev/null
+++ b/tests/qemuxmlconfdata/aarch64-features-pauth.aarch64-latest.xml
@@ -0,0 +1,28 @@
+<domain type='kvm'>
+  <name>guest</name>
+  <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+  <memory unit='KiB'>1048576</memory>
+  <currentMemory unit='KiB'>1048576</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='aarch64' machine='virt'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <features>
+    <gic version='3'/>
+  </features>
+  <cpu mode='host-passthrough' check='none'>
+    <feature policy='disable' name='pauth'/>
+  </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-aarch64</emulator>
+    <controller type='usb' index='0' model='none'/>
+    <controller type='pci' index='0' model='pcie-root'/>
+    <audio id='1' type='none'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxmlconfdata/aarch64-features-pauth.xml b/tests/qemuxmlconfdata/aarch64-features-pauth.xml
new file mode 100644
index 0000000000..5dcede8781
--- /dev/null
+++ b/tests/qemuxmlconfdata/aarch64-features-pauth.xml
@@ -0,0 +1,17 @@
+<domain type='kvm'>
+  <name>guest</name>
+  <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+  <memory unit='KiB'>1048576</memory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='aarch64' machine='virt'>hvm</type>
+  </os>
+  <cpu mode='host-passthrough'>
+    <feature policy='disable' name='pauth'/>
+  </cpu>
+  <devices>
+    <emulator>/usr/bin/qemu-system-aarch64</emulator>
+    <controller type='usb' model='none'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c
index 389d31800b..392bb6c0ff 100644
--- a/tests/qemuxmlconftest.c
+++ b/tests/qemuxmlconftest.c
@@ -2601,6 +2601,7 @@ mymain(void)
     DO_TEST_CAPS_ARCH_LATEST("aarch64-features-sve", "aarch64");
 
     DO_TEST_CAPS_ARCH_LATEST("aarch64-features-ras", "aarch64");
+    DO_TEST_CAPS_ARCH_LATEST("aarch64-features-pauth", "aarch64");
 
     DO_TEST_CAPS_ARCH_LATEST("clock-timer-armvtimer", "aarch64");
 
-- 
2.45.2