From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KuWmw-0008Oe-Pz for qemu-devel@nongnu.org; Mon, 27 Oct 2008 14:26:02 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KuWmt-0008OD-92 for qemu-devel@nongnu.org; Mon, 27 Oct 2008 14:26:02 -0400 Received: from [199.232.76.173] (port=58558 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KuWmt-0008OA-3v for qemu-devel@nongnu.org; Mon, 27 Oct 2008 14:25:59 -0400 Received: from e3.ny.us.ibm.com ([32.97.182.143]:48919) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KuWms-00065A-Hy for qemu-devel@nongnu.org; Mon, 27 Oct 2008 14:25:58 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e3.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id m9RIPvUr029373 for ; Mon, 27 Oct 2008 14:25:57 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id m9RIPvIi121538 for ; Mon, 27 Oct 2008 14:25:57 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m9RIPpkv022025 for ; Mon, 27 Oct 2008 14:25:51 -0400 Received: from [9.65.94.29] (sig-9-65-94-29.mts.ibm.com [9.65.94.29]) by d01av02.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m9RIPpDq022009 for ; Mon, 27 Oct 2008 14:25:51 -0400 From: Beth Kon Content-Type: multipart/mixed; boundary="=-xjYrT/Lh4tC+v+fMkEax" Date: Mon, 27 Oct 2008 14:26:00 -0400 Message-Id: <1225131960.7555.79.camel@beth-laptop> Mime-Version: 1.0 Subject: [Qemu-devel] [PATCH 2/2] Add code to override IRQ 0 to INTI 2 Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --=-xjYrT/Lh4tC+v+fMkEax Content-Type: text/plain Content-Transfer-Encoding: 7bit This patch, provided by Anthony Liguori, maps IRQ0 to INTI2. -- Elizabeth Kon (Beth) IBM Linux Technology Center Open Hypervisor Team email: eak@us.ibm.com --=-xjYrT/Lh4tC+v+fMkEax Content-Disposition: attachment; filename=apic_int_override.patch Content-Type: text/x-patch; name=apic_int_override.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit Signed-off-by Beth Kon diff --git a/hw/apic.c b/hw/apic.c index a2915f8..3e34132 100644 --- a/hw/apic.c +++ b/hw/apic.c @@ -945,6 +945,13 @@ void ioapic_set_irq(void *opaque, int vector, int level) { IOAPICState *s = opaque; + /* ISA IRQs map to GSI 1-1 except for IRQ0 which maps + to GSI 2. GSI maps to ioapic 1-1. This is not + the cleanest way of doing it but it should work. */ + + if (vector == 0) + vector = 2; + if (vector >= 0 && vector < IOAPIC_NUM_PINS) { uint32_t mask = 1 << vector; uint64_t entry = s->ioredtbl[vector]; --=-xjYrT/Lh4tC+v+fMkEax--