From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966033AbdKPRpT (ORCPT ); Thu, 16 Nov 2017 12:45:19 -0500 Received: from foss.arm.com ([217.140.101.70]:54512 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965935AbdKPRoF (ORCPT ); Thu, 16 Nov 2017 12:44:05 -0500 Subject: Re: [PATCH v3 3/3] kvm: arm64: handle single-step of userspace mmio instructions To: =?UTF-8?Q?Alex_Benn=c3=a9e?= , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org, marc.zyngier@arm.com Cc: open list References: <20171116153921.21991-1-alex.bennee@linaro.org> <20171116153921.21991-4-alex.bennee@linaro.org> From: Julien Thierry Message-ID: <91f89786-5fb9-ce5d-a7c2-2addb1ab4983@arm.com> Date: Thu, 16 Nov 2017 17:44:02 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20171116153921.21991-4-alex.bennee@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16/11/17 15:39, Alex Bennée wrote: > 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 > Reviewed-by: Julien Thierry > --- > 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) > -- Julien Thierry