[PATCH 1/4] KVM: arm64: Track IRQ and FIQ exceptions separately

Marc Zyngier maz at kernel.org
Wed Dec 2 05:30:54 PST 2026


On Tue, 01 Dec 2026 20:44:59 +0000,
Oliver Upton <oupton at kernel.org> 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.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.



More information about the linux-arm-kernel mailing list