From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KBTZ1-0002jb-GH for qemu-devel@nongnu.org; Wed, 25 Jun 2008 07:53:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KBTZ0-0002iD-FP for qemu-devel@nongnu.org; Wed, 25 Jun 2008 07:53:26 -0400 Received: from [199.232.76.173] (port=45814 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KBTYz-0002hL-Ln for qemu-devel@nongnu.org; Wed, 25 Jun 2008 07:53:26 -0400 Received: from il.qumranet.com ([212.179.150.194]:52839) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KBTYy-0005DA-RX for qemu-devel@nongnu.org; Wed, 25 Jun 2008 07:53:25 -0400 Message-ID: <486231B0.9080904@qumranet.com> Date: Wed, 25 Jun 2008 14:53:20 +0300 From: Avi Kivity MIME-Version: 1.0 References: <51CFAB8CB6883745AE7B93B3E084EBE201D2C53B@pdsmsx412.ccr.corp.intel.com> In-Reply-To: <51CFAB8CB6883745AE7B93B3E084EBE201D2C53B@pdsmsx412.ccr.corp.intel.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] irq assignment Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Xu, Anthony" Cc: kvm-ia64@vger.kernel.org, qemu-devel , kvm@vger.kernel.org (copying qemu-devel) Xu, Anthony wrote: > Subject: [PATCH] Irq assignment > > 1. use bimodal _PRT > 2. pci device can use irq > 15, reduce interrupt sharing > 3. test by running linux guest in kvm-ia64, kvm-i32(w/ wo/ -no-kvm) > > > + > +static int ioapic_irq_count[IOAPIC_NUM_PINS]; > + > void ioapic_set_irq(void *opaque, int vector, int level) > { > IOAPICState *s = opaque; > - > + if( vector >= 16 ){ > + if( level ) > + ioapic_irq_count[vector] += 1; > + else > + ioapic_irq_count[vector] -= 1; > + level = (ioapic_irq_count[vector] != 0); > + } > +#ifdef KVM_CAP_IRQCHIP > + if (kvm_enabled()) > + if (kvm_set_irq(vector, ioapic_irq_count[vector] == 0)) > + return; > +#endif > It's legal to call ioapic_set_irq(vector, 1) twice, which will screw up the level calculation. We need qemu_irq_or(), similar to qemu_irq_invert(): qemu_irq qemu_irq_or(qemu_irq irqs[], int nr); Also, this is not the place for doing the or. The ioapic does not know which interrupts are level connected and which are not. This belongs on the pci level (or the mainboard level). -- error compiling committee.c: too many arguments to function