[PATCH] KVM: arm64: nv: Reset MMIO state when committing a nested exception

Marc Zyngier maz at kernel.org
Mon Nov 23 02:00:11 PST 2026


On Mon, 23 Nov 2026 12:47:42 +0300, Dan Carpenter wrote:
> KVM has two ways to commit a pending exception, commit_pending_events()
> which also resets the MMIO emulation state, and a direct call to
> __kvm_adjust_pc() which doesn't.  The EL1 to EL2 path in
> kvm_inject_nested() uses __kvm_adjust_pc(), but it needs to use
> commit_pending_events() instead.
> 
> The scenario is: the vcpu exits to userspace for an MMIO access and
> userspace then injects a synchronous external abort or an SError using
> the KVM_SET_VCPU_EVENTS ioctl.  If the vcpu is in L2 context and L1 has
> asked for the exception, then kvm_inject_nested() enters the exception
> straight away and vcpu->mmio_needed stays set.  On the next KVM_RUN,
> kvm_handle_mmio_return() completes the access in L1's context so it
> skips the first instruction of L1's exception vector and writes the
> MMIO data to one of L1's registers.
> 
> [...]

Applied to fixes, thanks!

[1/1] KVM: arm64: nv: Reset MMIO state when committing a nested exception
      commit: 551e73d9e21ee2a6d045736246eafcd79b32d9c4

Cheers,

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





More information about the linux-arm-kernel mailing list