Re: [PATCH v3] KVM: arm64: selftests: Check SError is not pending after delivery
From: Oliver Upton
Date: Mon Oct 05 2026 - 04:22:09 EST
Hi Fuad,
On Mon, Oct 05, 2026 at 06:03:49AM +0100, Fuad Tabba wrote:
> test_serror() never looks at the vCPU after the SError is delivered, so
> a stale pending SError goes unnoticed. Read the vCPU events back and
> check the SError is no longer pending.
>
> Signed-off-by: Fuad Tabba <fuad.tabba@xxxxxxxxx>
> ---
> The fix from v2 was applied [1], but not this test.
>
> Changes since v2 [2]:
> - Dropped the fix, now in kvmarm/next.
> - Rebased on kvmarm/next.
>
> [1] https://lore.kernel.org/all/20261001135711.1640520-2-fuad.tabba@xxxxxxxxx/
> [2] https://lore.kernel.org/all/20260921101030.1231605-1-fuad.tabba@xxxxxxxxx/
>
> tools/testing/selftests/kvm/arm64/external_aborts.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/tools/testing/selftests/kvm/arm64/external_aborts.c b/tools/testing/selftests/kvm/arm64/external_aborts.c
> index 7836756a38a6c..c35b0c87250a1 100644
> --- a/tools/testing/selftests/kvm/arm64/external_aborts.c
> +++ b/tools/testing/selftests/kvm/arm64/external_aborts.c
> @@ -239,6 +239,7 @@ static void test_serror_guest(void)
>
> static void test_serror(void)
> {
> + struct kvm_vcpu_events events;
> struct kvm_vcpu *vcpu;
> struct kvm_vm *vm = vm_create_with_dabt_handler(&vcpu, test_serror_guest,
> unexpected_dabt_handler);
> @@ -247,6 +248,11 @@ static void test_serror(void)
>
> vcpu_inject_serror(vcpu);
> vcpu_run_expect_done(vcpu);
> +
> + vcpu_events_get(vcpu, &events);
> + TEST_ASSERT(!events.exception.serror_pending,
> + "SError still pending after the guest took it");
> +
> kvm_vm_free(vm);
> }
Can you add coverage for the vCPU events state to all the test cases? In
addition to the case where the SError is taken, it'd be good to assert
that the SError remains pending if the guest masked it.
Thanks,
Oliver