From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B675C3A5A1 for ; Thu, 22 Aug 2019 12:21:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 35355214DA for ; Thu, 22 Aug 2019 12:21:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566476487; bh=J7IQrt2KZZ4dqcSQxrBQtJO3ZFPUnk2HQ5TKjCNUA2w=; h=Subject:To:Cc:References:From:Date:In-Reply-To:List-ID:From; b=BGLznNhuq7FaKGqKdUDqLTkhOW9TuqZidp+df2BUqfBlHIWBMKKa4X8HlNINRsC19 D5i8RIGb1pNYVrh2/p/M537sqOIkAxO9kZwfcIiy/gnArMUH/01MJzYNEQbegN0iVW zgnesgP4JzDXvZLJrJrpyHd5k4R0HmADsYIykpTI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731418AbfHVMV0 (ORCPT ); Thu, 22 Aug 2019 08:21:26 -0400 Received: from foss.arm.com ([217.140.110.172]:45030 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731132AbfHVMV0 (ORCPT ); Thu, 22 Aug 2019 08:21:26 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B1D7C337; Thu, 22 Aug 2019 05:21:25 -0700 (PDT) Received: from [10.1.197.61] (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E78B13F706; Thu, 22 Aug 2019 05:21:24 -0700 (PDT) Subject: Re: [PATCH v2] arm64: KVM: Only skip MMIO insn once To: Andrew Jones , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org Cc: mark.rutland@arm.com References: <20190822110305.18035-1-drjones@redhat.com> From: Marc Zyngier Organization: Approximate Message-ID: Date: Thu, 22 Aug 2019 13:21:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190822110305.18035-1-drjones@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 22/08/2019 12:03, Andrew Jones wrote: > If after an MMIO exit to userspace a VCPU is immediately run with an > immediate_exit request, such as when a signal is delivered or an MMIO > emulation completion is needed, then the VCPU completes the MMIO > emulation and immediately returns to userspace. As the exit_reason > does not get changed from KVM_EXIT_MMIO in these cases we have to > be careful not to complete the MMIO emulation again, when the VCPU is > eventually run again, because the emulation does an instruction skip > (and doing too many skips would be a waste of guest code :-) We need > to use additional VCPU state to track if the emulation is complete. > As luck would have it, we already have 'mmio_needed', which even > appears to be used in this way by other architectures already. > > Fixes: 0d640732dbeb ("arm64: KVM: Skip MMIO insn after emulation") > Signed-off-by: Andrew Jones > --- > v2: move mmio_needed use closer to other mmio state use [maz] > > virt/kvm/arm/mmio.c | 7 +++++++ > 1 file changed, 7 insertions(+) Applied with Mark's Ack. Thanks, M. -- Jazz is not dead, it just smells funny...