* [PATCH v3] KVM: arm64: selftests: Check SError is not pending after delivery
@ 2026-10-05 5:03 Fuad Tabba
2026-10-05 8:17 ` Oliver Upton
0 siblings, 1 reply; 3+ messages in thread
From: Fuad Tabba @ 2026-10-05 5:03 UTC (permalink / raw)
To: maz, oupton, kvmarm, linux-arm-kernel, linux-kernel
Cc: catalin.marinas, will, joey.gouly, seiden, suzuki.poulose,
yuzenghui, vdonnefort, qperret, tabba
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@linux.dev>
---
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@linux.dev/
[2] https://lore.kernel.org/all/20260921101030.1231605-1-fuad.tabba@linux.dev/
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);
}
base-commit: fa22cd9947fc245d71bc40482f7f78eb0d5a4af0
--
2.39.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3] KVM: arm64: selftests: Check SError is not pending after delivery
2026-10-05 5:03 [PATCH v3] KVM: arm64: selftests: Check SError is not pending after delivery Fuad Tabba
@ 2026-10-05 8:17 ` Oliver Upton
2026-10-05 8:27 ` Fuad Tabba
0 siblings, 1 reply; 3+ messages in thread
From: Oliver Upton @ 2026-10-05 8:17 UTC (permalink / raw)
To: Fuad Tabba
Cc: maz, kvmarm, linux-arm-kernel, linux-kernel, catalin.marinas,
will, joey.gouly, seiden, suzuki.poulose, yuzenghui, vdonnefort,
qperret, tabba
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@linux.dev>
> ---
> 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@linux.dev/
> [2] https://lore.kernel.org/all/20260921101030.1231605-1-fuad.tabba@linux.dev/
>
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3] KVM: arm64: selftests: Check SError is not pending after delivery
2026-10-05 8:17 ` Oliver Upton
@ 2026-10-05 8:27 ` Fuad Tabba
0 siblings, 0 replies; 3+ messages in thread
From: Fuad Tabba @ 2026-10-05 8:27 UTC (permalink / raw)
To: Oliver Upton
Cc: maz, kvmarm, linux-arm-kernel, linux-kernel, catalin.marinas,
will, joey.gouly, seiden, suzuki.poulose, yuzenghui, vdonnefort,
qperret
Hi Oliver,
On Mon, 5 Oct 2026 at 10:17, Oliver Upton <oupton@kernel.org> wrote:
>
> Hi Fuad,
[...]
>
> 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.
Will do,
/fuad
> Thanks,
> Oliver
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-05 8:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-05 5:03 [PATCH v3] KVM: arm64: selftests: Check SError is not pending after delivery Fuad Tabba
2026-10-05 8:17 ` Oliver Upton
2026-10-05 8:27 ` Fuad Tabba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®