From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: Re: [PATCH 1/1] KVM: IRQ ACK notifier should be used with in-kernel irqchip Date: Thu, 9 Oct 2008 16:43:40 +0800 Message-ID: <200810091643.40817.sheng@linux.intel.com> References: <1223540214-353-1-git-send-email-sheng@linux.intel.com> <48EDC227.40904@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, Amit Shah To: Avi Kivity Return-path: Received: from mga06.intel.com ([134.134.136.21]:4697 "EHLO orsmga101.jf.intel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751706AbYJIIpJ (ORCPT ); Thu, 9 Oct 2008 04:45:09 -0400 In-Reply-To: <48EDC227.40904@redhat.com> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On Thursday 09 October 2008 16:34:47 Avi Kivity wrote: > Sheng Yang wrote: > > Also remove unnecessary parameter of unregister irq ack notifier. > > > > diff --git a/virt/kvm/irq_comm.c b/virt/kvm/irq_comm.c > > index d0169f5..54b251d 100644 > > --- a/virt/kvm/irq_comm.c > > +++ b/virt/kvm/irq_comm.c > > @@ -50,11 +50,15 @@ void kvm_notify_acked_irq(struct kvm *kvm, unsigned > > gsi) void kvm_register_irq_ack_notifier(struct kvm *kvm, > > struct kvm_irq_ack_notifier *kian) > > { > > + /* Must be called with in-kernel IRQ chip, otherwise it's nonsense */ > > + ASSERT(irqchip_in_kernel(kvm)); > > + ASSERT(kian); > > hlist_add_head(&kian->link, &kvm->arch.irq_ack_notifier_list); > > } > > We don't want a BUG() here is the user specifies -no-kvm-irqchip; is > there a check on the irq assignment ioctls before calling this? Yes. kvm_register_irq_ack_notifier should be called within irqchip_in_kernel() (on the other side, only if we have irqchip_in_kernel(), ack_notifier is useful, so we shouldn't call it without it), And I can't see if this would be useful with userspace irqchip, so add a ASSERT here. -- regards Yang, Sheng