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@vger.kernel.org Signed-off-by: Dan Carpenter --- 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