* [Bug Report] external_aborts failure related to efa1368ba9f4 ("KVM: arm64: Commit exceptions from KVM_SET_VCPU_EVENTS immediately")
@ 2025-07-21 14:00 Jiaqi Yan
2025-07-25 22:38 ` Jiaqi Yan
0 siblings, 1 reply; 4+ messages in thread
From: Jiaqi Yan @ 2025-07-21 14:00 UTC (permalink / raw)
To: Oliver Upton; +Cc: kvmarm, kvm
Hi Oliver,
I was doing some SEA injection dev work and found
tools/testing/selftests/kvm/arm64/external_aborts.c is failing at the
head of my locally-tracked kvmarm/next, commit 811ec70dcf9cc ("Merge
branch 'kvm-arm64/config-masks' into kvmarm/next"):
vobeb33:/export/hda3/tmp/yjq# ./external_aborts
Random seed: 0x6b8b4567
test_mmio_abort <= fail
==== Test Assertion Failure ====
arm64/external_aborts.c:19: regs->pc == expected_abort_pc
pid=25675 tid=25675 errno=4 - Interrupted system call
(stack trace empty)
0x0 != 0x21ed20 (regs->pc != expected_abort_pc)
vobeb33:/export/hda3/tmp/yjq#
vobeb33:/export/hda3/tmp/yjq#
vobeb33:/export/hda3/tmp/yjq# ./external_aborts
Random seed: 0x6b8b4567
test_mmio_nisv <= pass
test_mmio_nisv_abort <=fail
==== Test Assertion Failure ====
arm64/external_aborts.c:19: regs->pc == expected_abort_pc
pid=26153 tid=26153 errno=4 - Interrupted system call
(stack trace empty)
0x0 != 0x21eb18 (regs->pc != expected_abort_pc)
It looks like the PC in the guest register is lost / polluted. I only
tested test_mmio_abort (fail), test_mmio_nisv (pass), and
test_mmio_nisv_abort (fail), but from reading the code of
test_mmio_nisv vs test_mmio_nisv_abort, I guess test failure is
probably due to some bug in the code kvm injects SEA into guest.
If I revert a single commit efa1368ba9f4 ("KVM: arm64: Commit
exceptions from KVM_SET_VCPU_EVENTS immediately"), all tests in
tools/testing/selftests/kvm/arm64/external_aborts.c pass. I have not
yet figured out the bug tho. Want to report since you are the author
maybe you can (or already) spot something.
Thanks,
Jiaqi
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Bug Report] external_aborts failure related to efa1368ba9f4 ("KVM: arm64: Commit exceptions from KVM_SET_VCPU_EVENTS immediately")
2025-07-21 14:00 [Bug Report] external_aborts failure related to efa1368ba9f4 ("KVM: arm64: Commit exceptions from KVM_SET_VCPU_EVENTS immediately") Jiaqi Yan
@ 2025-07-25 22:38 ` Jiaqi Yan
2025-07-26 9:18 ` Marc Zyngier
0 siblings, 1 reply; 4+ messages in thread
From: Jiaqi Yan @ 2025-07-25 22:38 UTC (permalink / raw)
To: Oliver Upton; +Cc: kvmarm, kvm
On Mon, Jul 21, 2025 at 7:00 AM Jiaqi Yan <jiaqiyan@google.com> wrote:
>
> Hi Oliver,
>
> I was doing some SEA injection dev work and found
> tools/testing/selftests/kvm/arm64/external_aborts.c is failing at the
> head of my locally-tracked kvmarm/next, commit 811ec70dcf9cc ("Merge
> branch 'kvm-arm64/config-masks' into kvmarm/next"):
>
> vobeb33:/export/hda3/tmp/yjq# ./external_aborts
> Random seed: 0x6b8b4567
> test_mmio_abort <= fail
> ==== Test Assertion Failure ====
> arm64/external_aborts.c:19: regs->pc == expected_abort_pc
> pid=25675 tid=25675 errno=4 - Interrupted system call
> (stack trace empty)
> 0x0 != 0x21ed20 (regs->pc != expected_abort_pc)
> vobeb33:/export/hda3/tmp/yjq#
> vobeb33:/export/hda3/tmp/yjq#
> vobeb33:/export/hda3/tmp/yjq# ./external_aborts
> Random seed: 0x6b8b4567
> test_mmio_nisv <= pass
> test_mmio_nisv_abort <=fail
> ==== Test Assertion Failure ====
> arm64/external_aborts.c:19: regs->pc == expected_abort_pc
> pid=26153 tid=26153 errno=4 - Interrupted system call
> (stack trace empty)
> 0x0 != 0x21eb18 (regs->pc != expected_abort_pc)
>
> It looks like the PC in the guest register is lost / polluted. I only
> tested test_mmio_abort (fail), test_mmio_nisv (pass), and
> test_mmio_nisv_abort (fail), but from reading the code of
> test_mmio_nisv vs test_mmio_nisv_abort, I guess test failure is
> probably due to some bug in the code kvm injects SEA into guest.
>
> If I revert a single commit efa1368ba9f4 ("KVM: arm64: Commit
> exceptions from KVM_SET_VCPU_EVENTS immediately"), all tests in
> tools/testing/selftests/kvm/arm64/external_aborts.c pass. I have not
> yet figured out the bug tho. Want to report since you are the author
> maybe you can (or already) spot something.
Friendly ping ;)
>
> Thanks,
>
> Jiaqi
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Bug Report] external_aborts failure related to efa1368ba9f4 ("KVM: arm64: Commit exceptions from KVM_SET_VCPU_EVENTS immediately")
2025-07-25 22:38 ` Jiaqi Yan
@ 2025-07-26 9:18 ` Marc Zyngier
2025-07-29 18:33 ` Jiaqi Yan
0 siblings, 1 reply; 4+ messages in thread
From: Marc Zyngier @ 2025-07-26 9:18 UTC (permalink / raw)
To: Jiaqi Yan; +Cc: Oliver Upton, kvmarm, kvm
On 2025-07-25 23:38, Jiaqi Yan wrote:
> On Mon, Jul 21, 2025 at 7:00 AM Jiaqi Yan <jiaqiyan@google.com> wrote:
>>
>> Hi Oliver,
>>
>> I was doing some SEA injection dev work and found
>> tools/testing/selftests/kvm/arm64/external_aborts.c is failing at the
>> head of my locally-tracked kvmarm/next, commit 811ec70dcf9cc ("Merge
>> branch 'kvm-arm64/config-masks' into kvmarm/next"):
>>
>> vobeb33:/export/hda3/tmp/yjq# ./external_aborts
>> Random seed: 0x6b8b4567
>> test_mmio_abort <= fail
>> ==== Test Assertion Failure ====
>> arm64/external_aborts.c:19: regs->pc == expected_abort_pc
>> pid=25675 tid=25675 errno=4 - Interrupted system call
>> (stack trace empty)
>> 0x0 != 0x21ed20 (regs->pc != expected_abort_pc)
>> vobeb33:/export/hda3/tmp/yjq#
>> vobeb33:/export/hda3/tmp/yjq#
>> vobeb33:/export/hda3/tmp/yjq# ./external_aborts
>> Random seed: 0x6b8b4567
>> test_mmio_nisv <= pass
>> test_mmio_nisv_abort <=fail
>> ==== Test Assertion Failure ====
>> arm64/external_aborts.c:19: regs->pc == expected_abort_pc
>> pid=26153 tid=26153 errno=4 - Interrupted system call
>> (stack trace empty)
>> 0x0 != 0x21eb18 (regs->pc != expected_abort_pc)
>>
>> It looks like the PC in the guest register is lost / polluted. I only
>> tested test_mmio_abort (fail), test_mmio_nisv (pass), and
>> test_mmio_nisv_abort (fail), but from reading the code of
>> test_mmio_nisv vs test_mmio_nisv_abort, I guess test failure is
>> probably due to some bug in the code kvm injects SEA into guest.
>>
>> If I revert a single commit efa1368ba9f4 ("KVM: arm64: Commit
>> exceptions from KVM_SET_VCPU_EVENTS immediately"), all tests in
>> tools/testing/selftests/kvm/arm64/external_aborts.c pass. I have not
>> yet figured out the bug tho. Want to report since you are the author
>> maybe you can (or already) spot something.
>
> Friendly ping ;)
Please check this:
https://web.git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git/commit/?h=next&id=c6e35dff58d348c1a9489e9b3b62b3721e62631d
M.
--
Who you jivin' with that Cosmik Debris?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Bug Report] external_aborts failure related to efa1368ba9f4 ("KVM: arm64: Commit exceptions from KVM_SET_VCPU_EVENTS immediately")
2025-07-26 9:18 ` Marc Zyngier
@ 2025-07-29 18:33 ` Jiaqi Yan
0 siblings, 0 replies; 4+ messages in thread
From: Jiaqi Yan @ 2025-07-29 18:33 UTC (permalink / raw)
To: Marc Zyngier; +Cc: Oliver Upton, kvmarm, kvm
That commit fixed my issue, thanks a lot Marc!
On Sat, Jul 26, 2025 at 2:18 AM Marc Zyngier <maz@misterjones.org> wrote:
>
> On 2025-07-25 23:38, Jiaqi Yan wrote:
> > On Mon, Jul 21, 2025 at 7:00 AM Jiaqi Yan <jiaqiyan@google.com> wrote:
> >>
> >> Hi Oliver,
> >>
> >> I was doing some SEA injection dev work and found
> >> tools/testing/selftests/kvm/arm64/external_aborts.c is failing at the
> >> head of my locally-tracked kvmarm/next, commit 811ec70dcf9cc ("Merge
> >> branch 'kvm-arm64/config-masks' into kvmarm/next"):
> >>
> >> vobeb33:/export/hda3/tmp/yjq# ./external_aborts
> >> Random seed: 0x6b8b4567
> >> test_mmio_abort <= fail
> >> ==== Test Assertion Failure ====
> >> arm64/external_aborts.c:19: regs->pc == expected_abort_pc
> >> pid=25675 tid=25675 errno=4 - Interrupted system call
> >> (stack trace empty)
> >> 0x0 != 0x21ed20 (regs->pc != expected_abort_pc)
> >> vobeb33:/export/hda3/tmp/yjq#
> >> vobeb33:/export/hda3/tmp/yjq#
> >> vobeb33:/export/hda3/tmp/yjq# ./external_aborts
> >> Random seed: 0x6b8b4567
> >> test_mmio_nisv <= pass
> >> test_mmio_nisv_abort <=fail
> >> ==== Test Assertion Failure ====
> >> arm64/external_aborts.c:19: regs->pc == expected_abort_pc
> >> pid=26153 tid=26153 errno=4 - Interrupted system call
> >> (stack trace empty)
> >> 0x0 != 0x21eb18 (regs->pc != expected_abort_pc)
> >>
> >> It looks like the PC in the guest register is lost / polluted. I only
> >> tested test_mmio_abort (fail), test_mmio_nisv (pass), and
> >> test_mmio_nisv_abort (fail), but from reading the code of
> >> test_mmio_nisv vs test_mmio_nisv_abort, I guess test failure is
> >> probably due to some bug in the code kvm injects SEA into guest.
> >>
> >> If I revert a single commit efa1368ba9f4 ("KVM: arm64: Commit
> >> exceptions from KVM_SET_VCPU_EVENTS immediately"), all tests in
> >> tools/testing/selftests/kvm/arm64/external_aborts.c pass. I have not
> >> yet figured out the bug tho. Want to report since you are the author
> >> maybe you can (or already) spot something.
> >
> > Friendly ping ;)
>
> Please check this:
>
> https://web.git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git/commit/?h=next&id=c6e35dff58d348c1a9489e9b3b62b3721e62631d
>
> M.
> --
> Who you jivin' with that Cosmik Debris?
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-07-29 18:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-21 14:00 [Bug Report] external_aborts failure related to efa1368ba9f4 ("KVM: arm64: Commit exceptions from KVM_SET_VCPU_EVENTS immediately") Jiaqi Yan
2025-07-25 22:38 ` Jiaqi Yan
2025-07-26 9:18 ` Marc Zyngier
2025-07-29 18:33 ` Jiaqi Yan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).