[PATCH 0/2] qemu: Add support for pauth Arm CPU feature

Andrea Bolognani (2): cpu_map: Add pauth Arm CPU feature tests: Add coverage for pauth Arm CPU feature src/cpu_map/arm_features.xml | 3 ++ ...aarch64-features-pauth.aarch64-latest.args | 31 +++++++++++++++++++ .../aarch64-features-pauth.aarch64-latest.xml | 28 +++++++++++++++++ .../aarch64-features-pauth.xml | 17 ++++++++++ tests/qemuxmlconftest.c | 1 + 5 files changed, 80 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 -- 2.45.2

This CPU feature can be used to explicitly enable or disable support for pointer authentication. By default, it will be enabled if the host supports it. https://issues.redhat.com/browse/RHEL-7044 Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/cpu_map/arm_features.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cpu_map/arm_features.xml b/src/cpu_map/arm_features.xml index 8a53384463..fc80a3b5bd 100644 --- a/src/cpu_map/arm_features.xml +++ b/src/cpu_map/arm_features.xml @@ -19,4 +19,7 @@ <feature name='sve1920'/> <feature name='sve2048'/> + <!-- Pointer authentication --> + <feature name='pauth'/> + </cpus> -- 2.45.2

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

On 7/12/24 16:21, Andrea Bolognani wrote:
Andrea Bolognani (2): cpu_map: Add pauth Arm CPU feature tests: Add coverage for pauth Arm CPU feature
src/cpu_map/arm_features.xml | 3 ++ ...aarch64-features-pauth.aarch64-latest.args | 31 +++++++++++++++++++ .../aarch64-features-pauth.aarch64-latest.xml | 28 +++++++++++++++++ .../aarch64-features-pauth.xml | 17 ++++++++++ tests/qemuxmlconftest.c | 1 + 5 files changed, 80 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
Sorry for letting this fall through cracks. Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Michal

On 7/15/24 10:32, Michal Prívozník wrote:
On 7/12/24 16:21, Andrea Bolognani wrote:
Andrea Bolognani (2): cpu_map: Add pauth Arm CPU feature tests: Add coverage for pauth Arm CPU feature
src/cpu_map/arm_features.xml | 3 ++ ...aarch64-features-pauth.aarch64-latest.args | 31 +++++++++++++++++++ .../aarch64-features-pauth.aarch64-latest.xml | 28 +++++++++++++++++ .../aarch64-features-pauth.xml | 17 ++++++++++ tests/qemuxmlconftest.c | 1 + 5 files changed, 80 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
Sorry for letting this fall through cracks.
Actually, I've misread the date this was sent in. It was sent only 3 days ago, so not sorry then :-P Michal

On Mon, Jul 15, 2024 at 10:45:10AM GMT, Michal Prívozník wrote:
On 7/15/24 10:32, Michal Prívozník wrote:
On 7/12/24 16:21, Andrea Bolognani wrote:
Andrea Bolognani (2): cpu_map: Add pauth Arm CPU feature tests: Add coverage for pauth Arm CPU feature
Sorry for letting this fall through cracks.
Actually, I've misread the date this was sent in. It was sent only 3 days ago, so not sorry then :-P
O:-) I just realized that I didn't update the release notes, so I've just posted a small patch for that too (messing up the threading in the process). Can I consider your R-b valid for patch 3/2 too? -- Andrea Bolognani / Red Hat / Virtualization

Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- NEWS.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 775f5904ea..2fdb52c607 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -17,6 +17,8 @@ v10.6.0 (unreleased) * **New features** + * qemu: Add support for the 'pauth' Arm CPU feature + * **Improvements** * **Bug fixes** -- 2.45.2
participants (2)
-
Andrea Bolognani
-
Michal Prívozník