From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Williamson Subject: Re: [RFC v1 5/5] Call irqbypass update routine when updating irqfd Date: Thu, 09 Jul 2015 21:26:18 -0600 Message-ID: <1436498778.1391.246.camel@redhat.com> References: <1436497207-4786-1-git-send-email-feng.wu@intel.com> <1436497207-4786-6-git-send-email-feng.wu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, pbonzini@redhat.com, joro@8bytes.org, avi.kivity@gmail.com, eric.auger@linaro.org To: Feng Wu Return-path: Received: from mx1.redhat.com ([209.132.183.28]:60488 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751566AbbGJD0T (ORCPT ); Thu, 9 Jul 2015 23:26:19 -0400 In-Reply-To: <1436497207-4786-6-git-send-email-feng.wu@intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, 2015-07-10 at 11:00 +0800, Feng Wu wrote: > Call update routine when updating irqfd, this can update the > IRTE for Intel posted-interrupts. > > Signed-off-by: Feng Wu > --- > virt/kvm/eventfd.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c > index a32cf6c..1226835 100644 > --- a/virt/kvm/eventfd.c > +++ b/virt/kvm/eventfd.c > @@ -570,8 +570,10 @@ void kvm_irq_routing_update(struct kvm *kvm) > > spin_lock_irq(&kvm->irqfds.lock); > > - list_for_each_entry(irqfd, &kvm->irqfds.items, list) > + list_for_each_entry(irqfd, &kvm->irqfds.items, list) { > irqfd_update(kvm, irqfd); > + irqfd->consumer.update(&irqfd->consumer); > + } > > spin_unlock_irq(&kvm->irqfds.lock); > } I don't understand why the irq bypass manager needs to know about this update callback. We could just as easily make it be a function pointer on the irqfd structure or maybe just open code it. It's defined by the consumer and called by the consumer, the irq bypass manager shouldn't know about it. Thanks, Alex