[PATCH v2 1/8] KVM: arm64: Drop an incomplete MMIO access when resetting a vcpu
From: Dan Carpenter
Date: Wed Nov 25 2026 - 01:56:44 EST
When a vcpu exits to userspace for an MMIO access, the next KVM_RUN
completes it. So for a read, the next run increments the PC counter
and copies data from userspace to the destination vcpu register.
A reset should cancel the MMIO read/write access. Otherwise the next
run will copy memory from userspace to the vcpu and increment the PC
which skips the first instruction.
Clear vcpu->mmio_needed in kvm_reset_vcpu().
Fixes: 45e96ea6b369 ("KVM: ARM: Handle I/O aborts")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Dan Carpenter <dan@xxxxxxxx>
---
v2: new patch
---
arch/arm64/kvm/reset.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/kvm/reset.c b/arch/arm64/kvm/reset.c
index 10eb7249aa9e..26081d273408 100644
--- a/arch/arm64/kvm/reset.c
+++ b/arch/arm64/kvm/reset.c
@@ -199,6 +199,7 @@ void kvm_reset_vcpu(struct kvm_vcpu *vcpu)
/* Reset core registers */
kvm_reset_vcpu_core(vcpu);
+ vcpu->mmio_needed = false;
/* Reset system registers */
kvm_reset_sys_regs(vcpu);
--
2.53.0