From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoffer Dall Subject: [PULL 12/19] kvm: arm64: handle single-step of userspace mmio instructions Date: Mon, 4 Dec 2017 15:03:41 +0100 Message-ID: <20171204140348.21965-10-cdall@kernel.org> References: <20171204135637.21620-1-cdall@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, Marc Zyngier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Christoffer Dall To: kvmarm@lists.cs.columbia.edu, Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Return-path: Received: from mail-wm0-f67.google.com ([74.125.82.67]:41891 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754173AbdLDOEF (ORCPT ); Mon, 4 Dec 2017 09:04:05 -0500 Received: by mail-wm0-f67.google.com with SMTP id g75so6045998wme.0 for ; Mon, 04 Dec 2017 06:04:04 -0800 (PST) In-Reply-To: <20171204135637.21620-1-cdall@kernel.org> Sender: kvm-owner@vger.kernel.org List-ID: From: Alex Bennée The system state of KVM when using userspace emulation is not complete until we return into KVM_RUN. To handle mmio related updates we wait until they have been committed and then schedule our KVM_EXIT_DEBUG. The kvm_arm_handle_step_debug() helper tells us if we need to return and sets up the exit_reason for us. Signed-off-by: Alex Bennée Signed-off-by: Christoffer Dall --- virt/kvm/arm/arm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c index a6524ff27de4..322c570d211e 100644 --- a/virt/kvm/arm/arm.c +++ b/virt/kvm/arm/arm.c @@ -628,6 +628,9 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) ret = kvm_handle_mmio_return(vcpu, vcpu->run); if (ret) return ret; + if (kvm_arm_handle_step_debug(vcpu, vcpu->run)) + return 0; + } if (run->immediate_exit) -- 2.14.2