linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: alex.bennee@linaro.org (Alex Bennée)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 3/3] kvm: arm64: handle single-step of userspace mmio instructions
Date: Thu, 16 Nov 2017 15:39:21 +0000	[thread overview]
Message-ID: <20171116153921.21991-4-alex.bennee@linaro.org> (raw)
In-Reply-To: <20171116153921.21991-1-alex.bennee@linaro.org>

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 <alex.bennee@linaro.org>

---
v2
  - call helper directly from kvm_arch_vcpu_ioctl_run
v3
  - return 0 (ioctl success) instead of 1
---
 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 95cba0799828..b40440defca1 100644
--- a/virt/kvm/arm/arm.c
+++ b/virt/kvm/arm/arm.c
@@ -625,6 +625,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.15.0

  parent reply	other threads:[~2017-11-16 15:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-16 15:39 [PATCH v3 0/3] KVM: arm64: single step emulation instructions Alex Bennée
2017-11-16 15:39 ` [PATCH v3 1/3] kvm: arm debug: introduce helper for single-step Alex Bennée
2017-11-16 15:39 ` [PATCH v3 2/3] kvm: arm64: handle single-stepping trapped instructions Alex Bennée
2017-11-16 15:39 ` Alex Bennée [this message]
2017-11-16 17:44   ` [PATCH v3 3/3] kvm: arm64: handle single-step of userspace mmio instructions Julien Thierry
2017-11-20 15:41 ` [PATCH v3 0/3] KVM: arm64: single step emulation instructions Christoffer Dall
2017-11-21 12:12   ` Alex Bennée
2017-11-21 12:43   ` Alex Bennée
2017-11-21 13:10     ` Marc Zyngier
2017-11-22 11:46     ` Christoffer Dall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171116153921.21991-4-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).