From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCHv5 1/4] Provide userspace IO exit completion callback. Date: Sun, 5 Aug 2012 17:49:41 +0300 Message-ID: <20120805144941.GR27579@redhat.com> References: <1343659101-24877-1-git-send-email-gleb@redhat.com> <1343659101-24877-2-git-send-email-gleb@redhat.com> <20120802192629.GA28613@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, avi@redhat.com To: Marcelo Tosatti Return-path: Received: from mx1.redhat.com ([209.132.183.28]:49918 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754459Ab2HEOtm (ORCPT ); Sun, 5 Aug 2012 10:49:42 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q75EngvD000882 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 5 Aug 2012 10:49:42 -0400 Content-Disposition: inline In-Reply-To: <20120802192629.GA28613@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Aug 02, 2012 at 04:26:29PM -0300, Marcelo Tosatti wrote: > On Mon, Jul 30, 2012 at 05:38:18PM +0300, Gleb Natapov wrote: > > int r; > > @@ -5554,9 +5568,13 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) > > } > > } > > > > - r = complete_mmio(vcpu); > > - if (r <= 0) > > - goto out; > > + if (unlikely(vcpu->arch.complete_userspace_io)) { > > + int (*cui)(struct kvm_vcpu *) = vcpu->arch.complete_userspace_io; > > + vcpu->arch.complete_userspace_io = NULL; > > + r = cui(vcpu); > > + if (r <= 0) > > + goto out; > > + } > > Would it be worthwhile to add BUG/WARN_ONs here checking for > variables that represent valid mmio/pio, but without > complete_userspace_io function pointer set? (you do that in > the reverse case, inside the complete_userspace_io > function pointers). There are never too much asserts :), But I wouldn't want to resend the series just for that, so if there are other comments that will require me to resend the series anyway I'll add asserts too. -- Gleb.