]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
KVM: arm64: selftests: Improve error handling for GICv5 PPI selftest
authorSascha Bischoff <sascha.bischoff@arm.com>
Wed, 20 May 2026 09:19:45 +0000 (10:19 +0100)
committerMarc Zyngier <maz@kernel.org>
Sat, 23 May 2026 14:07:41 +0000 (15:07 +0100)
Cases where the KVM_RUN ioctl returned an error were wrongly reported
as incorrect ucalls. Furthermore, potential failures when calling
KVM_IRQ_LINE were being hidden.

Improve the error handling to correctly propagate the error in both
cases.

Fixes: 0a9f38bf612b ("KVM: arm64: selftests: Introduce a minimal GICv5 PPI selftest")
Link: https://sashiko.dev/#/patchset/20260319154937.3619520-1-sascha.bischoff%40arm.com
Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com>
Link: https://lore.kernel.org/r/20260520091949.542365-15-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
tools/testing/selftests/kvm/arm64/vgic_v5.c

index a8707120de0d860fd15ab29bbc20f5d5abc14ab2..96cfd6bb32f6f23ae81d4071f2ba44414fbc145a 100644 (file)
@@ -129,6 +129,8 @@ static void test_vgic_v5_ppis(u32 gic_dev_type)
 
        while (1) {
                ret = run_vcpu(vcpus[0]);
+               if (ret)
+                       break;
 
                switch (get_ucall(vcpus[0], &uc)) {
                case UCALL_SYNC:
@@ -144,7 +146,7 @@ static void test_vgic_v5_ppis(u32 gic_dev_type)
                                irq = FIELD_PREP(KVM_ARM_IRQ_NUM_MASK, 3);
                                irq |= KVM_ARM_IRQ_TYPE_PPI << KVM_ARM_IRQ_TYPE_SHIFT;
 
-                               _kvm_irq_line(v.vm, irq, level);
+                               kvm_irq_line(v.vm, irq, level);
                        } else if (uc.args[1] == GUEST_CMD_IS_AWAKE) {
                                pr_info("Guest skipping WFI due to pending IRQ\n");
                        } else if (uc.args[1] == GUEST_CMD_IRQ_CDIA) {