From patchwork Tue Aug 27 13:41:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 2850192 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 28AC19F271 for ; Tue, 27 Aug 2013 13:42:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0D1DE2037D for ; Tue, 27 Aug 2013 13:42:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E643B20375 for ; Tue, 27 Aug 2013 13:42:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753504Ab3H0NmB (ORCPT ); Tue, 27 Aug 2013 09:42:01 -0400 Received: from mail-wg0-f51.google.com ([74.125.82.51]:56328 "EHLO mail-wg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753410Ab3H0Nl6 (ORCPT ); Tue, 27 Aug 2013 09:41:58 -0400 Received: by mail-wg0-f51.google.com with SMTP id b12so2010280wgh.18 for ; Tue, 27 Aug 2013 06:41:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=sTFMB8RXjDtcb5Un3a6rr9HTmHgrSRbUKfAR1JdsUE0=; b=Ek1Lak4wKodDN9npwuQtpScy1ZZKzuNhs2DIDrJvyjD7jMzTA1zarUkxGZDadw6fV+ HP+kPTEu4qrJ1/3ZOj+9OzCx43/RLVdw+fGcfVzd8jSuyBtCesHQLBEMSUqILMyT2mE6 futj6Xko4NMBFq6IfsIg57b9/8dwav3NA5R4eI1sVmV1VKgbGyeBddWPF5a/kp62p+tc BD+JqKMIW6ft7Gx8b7nRanuSHvGtqxMbD4SzWdErqzHtmXjsJVJaVZo4sMma5amQsSY5 XNPuFH6XNtMQxzkY8FRT6XdF+LDuJZYHONkVbCqo9NQul+mV3vvGA8iP8cX/K16pr9hx IO4g== X-Received: by 10.194.240.197 with SMTP id wc5mr14763571wjc.23.1377610917523; Tue, 27 Aug 2013 06:41:57 -0700 (PDT) Received: from playground.lan (net-37-117-144-28.cust.dsl.vodafone.it. [37.117.144.28]) by mx.google.com with ESMTPSA id mw9sm15150062wic.4.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 27 Aug 2013 06:41:56 -0700 (PDT) From: Paolo Bonzini To: linux-kernel@vger.kernel.org Cc: kvm@vger.kernel.org, gnatapov@redhat.com Subject: [PATCH 3/3] KVM: x86: add comments where MMIO does not return to the emulator Date: Tue, 27 Aug 2013 15:41:43 +0200 Message-Id: <1377610903-12356-4-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1377610903-12356-1-git-send-email-pbonzini@redhat.com> References: <1377610903-12356-1-git-send-email-pbonzini@redhat.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Support for single-step in the emulator (new in 3.12) does not work for MMIO or PIO writes, because they are completed without returning to the emulator. This is not worse than what we had in 3.11; still, add comments so that the issue is not forgotten. Signed-off-by: Paolo Bonzini --- arch/x86/kvm/x86.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 668f19a..3625798 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -5122,9 +5122,10 @@ restart: inject_emulated_exception(vcpu); r = EMULATE_DONE; } else if (vcpu->arch.pio.count) { - if (!vcpu->arch.pio.in) + if (!vcpu->arch.pio.in) { + /* FIXME: return into emulator if single-stepping. */ vcpu->arch.pio.count = 0; - else { + } else { writeback = false; vcpu->arch.complete_userspace_io = complete_emulated_pio; } @@ -6154,6 +6155,8 @@ static int complete_emulated_mmio(struct kvm_vcpu *vcpu) if (vcpu->mmio_cur_fragment == vcpu->mmio_nr_fragments) { vcpu->mmio_needed = 0; + + /* FIXME: return into emulator if single-stepping. */ if (vcpu->mmio_is_write) return 1; vcpu->mmio_read_completed = 1;