KVM: selftests: Add test for uaccesses to non-existent vgic-v2 CPUIF
authorOliver Upton <oliver.upton@linux.dev>
Wed, 24 Apr 2024 17:39:59 +0000 (17:39 +0000)
committerOliver Upton <oliver.upton@linux.dev>
Wed, 24 Apr 2024 19:09:36 +0000 (19:09 +0000)
commit160933e330f4c5a13931d725a4d952a4b9aefa71
tree0cf6432f9b76a46fea7f4e8e8a7de54c29668ccd
parent6ddb4f372fc63210034b903d96ebbeb3c7195adb
KVM: selftests: Add test for uaccesses to non-existent vgic-v2 CPUIF

Assert that accesses to a non-existent vgic-v2 CPU interface
consistently fail across the various KVM device attr ioctls. This also
serves as a regression test for a bug wherein KVM hits a NULL
dereference when the CPUID specified in the ioctl is invalid.

Note that there is no need to print the observed errno, as TEST_ASSERT()
will take care of it.

Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20240424173959.3776798-3-oliver.upton@linux.dev
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
tools/testing/selftests/kvm/aarch64/vgic_init.c