From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40780) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSOth-0003Zg-Qf for qemu-devel@nongnu.org; Wed, 27 Jul 2016 09:29:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSOtd-0007Pf-T1 for qemu-devel@nongnu.org; Wed, 27 Jul 2016 09:29:17 -0400 Date: Wed, 27 Jul 2016 21:29:07 +0800 From: Peter Xu Message-ID: <20160727132907.GD18777@pxdev.xzpeter.org> References: <1469605906-20243-1-git-send-email-aik@ozlabs.ru> <20160727085359.GA18777@pxdev.xzpeter.org> <2f1d30a2-fe94-1197-381e-f4e3edb7bb1f@ozlabs.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <2f1d30a2-fe94-1197-381e-f4e3edb7bb1f@ozlabs.ru> Subject: Re: [Qemu-devel] [PATCH qemu] kvm-irqchip: Only do explicit IRQ routing commit when IRQCHIP is in use List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, David Gibson , Paolo Bonzini , alex.williamson@redhat.com, mst@redhat.com, Thomas Huth On Wed, Jul 27, 2016 at 11:14:07PM +1000, Alexey Kardashevskiy wrote: > On 27/07/16 18:53, Peter Xu wrote: [...] > > Sorry for the trouble. How about this one: > > > > diff --git a/kvm-all.c b/kvm-all.c > > index ef81ca5..4b3e330 100644 > > --- a/kvm-all.c > > +++ b/kvm-all.c > > @@ -1047,6 +1047,10 @@ void kvm_irqchip_commit_routes(KVMState *s) > > { > > int ret; > > > > + if (kvm_gsi_direct_mapping()) { > > + return 0; > > + } > > + > > s->irq_routes->flags = 0; > > trace_kvm_irqchip_commit_routes(); > > ret = kvm_vm_ioctl(s, KVM_SET_GSI_ROUTING, s->irq_routes); > > > > I don't know whether irq_routes will be NULL for all GSI direct > > mapping case... at least this can have kvm_irqchip_*() APIs got > > aligned. > > > This works too. > > You may also want to copy if(!kvm_gsi_routing_enabled()) from > kvm_irqchip_add_msi_route() to align API (not needed in my case though). Or > just check the result of these checks by if(!s->irq_routes) :) > Thanks. Right. Do you like to post a v2 for this one? (since of course honor is yours and fault is mine :) Please let me know if you want me to do this for you. It'll be nice we have this fix asap so that less people suffers. Thanks! -- peterx