]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: arm64: selftests: Introduce a minimal GICv5 PPI selftest
authorSascha Bischoff <Sascha.Bischoff@arm.com>
Thu, 19 Mar 2026 16:00:06 +0000 (16:00 +0000)
committerMarc Zyngier <maz@kernel.org>
Thu, 19 Mar 2026 18:21:29 +0000 (18:21 +0000)
commit0a9f38bf612b195e04236d366ed9f769ce14cc27
treee60990236781d9256630cfe63123b92020bef9a7
parentd51c978b7d3e143381f871d28d8a0437d446b51b
KVM: arm64: selftests: Introduce a minimal GICv5 PPI selftest

This basic selftest creates a vgic_v5 device (if supported), and tests
that one of the PPI interrupts works as expected with a basic
single-vCPU guest.

Upon starting, the guest enables interrupts. That means that it is
initialising all PPIs to have reasonable priorities, but marking them
as disabled. Then the priority mask in the ICC_PCR_EL1 is set, and
interrupts are enable in ICC_CR0_EL1. At this stage the guest is able
to receive interrupts. The architected SW_PPI (64) is enabled and
KVM_IRQ_LINE ioctl is used to inject the state into the guest.

The guest's interrupt handler has an explicit WFI in order to ensure
that the guest skips WFI when there are pending and enabled PPI
interrupts.

Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Link: https://patch.msgid.link/20260319154937.3619520-41-sascha.bischoff@arm.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
tools/testing/selftests/kvm/Makefile.kvm
tools/testing/selftests/kvm/arm64/vgic_v5.c [new file with mode: 0644]
tools/testing/selftests/kvm/include/arm64/gic_v5.h [new file with mode: 0644]