From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 1/1] KVM: IRQ ACK notifier should be used with in-kernel irqchip Date: Thu, 09 Oct 2008 10:34:47 +0200 Message-ID: <48EDC227.40904@redhat.com> References: <1223540214-353-1-git-send-email-sheng@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, Amit Shah To: Sheng Yang Return-path: Received: from mx2.redhat.com ([66.187.237.31]:45868 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751343AbYJIIew (ORCPT ); Thu, 9 Oct 2008 04:34:52 -0400 In-Reply-To: <1223540214-353-1-git-send-email-sheng@linux.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: 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? -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.