Re: [PATCH 1/4] KVM: arm64: Track IRQ and FIQ exceptions separately
From: Oliver Upton
Date: Wed Dec 02 2026 - 12:45:00 EST
On Wed, Dec 02, 2026 at 01:30:54PM +0000, Marc Zyngier wrote:
> On Tue, 01 Dec 2026 20:44:59 +0000,
> Oliver Upton <oupton@xxxxxxxxxx> wrote:
>
> [...]
>
> > diff --git a/arch/arm64/kvm/hyp/entry.S b/arch/arm64/kvm/hyp/entry.S
> > index 9709905f21b5..7d38bae49d31 100644
> > --- a/arch/arm64/kvm/hyp/entry.S
> > +++ b/arch/arm64/kvm/hyp/entry.S
> > @@ -48,7 +48,13 @@ alternative_else_nop_endif
> > // synchronization event so that callers don't need ISBs for anything
> > // that would usually be synchronized by the ERET.
> > isb
> > +
> > + // Both a FIQ and IRQ could be pending. Arbitrarily give precedence
> > + // to reporting a pending FIQ.
> > mov x0, #ARM_EXCEPTION_IRQ
> > + mov x2, #ARM_EXCEPTION_FIQ
> > + tst x1, #ISR_EL1_F
> > + csel x0, x2, x0, ne
>
> I think this has the potential of going wrong on an NMI capable
> platform. Not that we support that yet, but it is around the corner.
> I also wonder if we should simply re-encode the exception types to
> better align with ISR_EL1. In any case, something like:
>
> orr x1, x1, x1, lsr #(ISR_EL1_FS_SHIFT - ISR_EL1_F_SHIFT)
> tst x1, #ISR_EL1_F
> csel x0, x2, x0, ne
>
> should do the trick.
Yep, works for me. I've got this applied locally, will include it in a
respin if that proves necessary.
Thanks,
Oliver