From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MHihW-0000ZK-EF for qemu-devel@nongnu.org; Fri, 19 Jun 2009 14:20:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MHihT-0000X9-0I for qemu-devel@nongnu.org; Fri, 19 Jun 2009 14:20:34 -0400 Received: from [199.232.76.173] (port=48405 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MHihS-0000X6-Pw for qemu-devel@nongnu.org; Fri, 19 Jun 2009 14:20:30 -0400 Received: from e4.ny.us.ibm.com ([32.97.182.144]:35909) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MHihS-0003r4-Ec for qemu-devel@nongnu.org; Fri, 19 Jun 2009 14:20:30 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e4.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n5JIFQXh004708 for ; Fri, 19 Jun 2009 14:15:26 -0400 Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n5JIKQcF236906 for ; Fri, 19 Jun 2009 14:20:26 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n5JIKQNN004969 for ; Fri, 19 Jun 2009 14:20:26 -0400 From: Beth Kon Date: Fri, 19 Jun 2009 14:22:00 -0400 Message-Id: <1245435720-1564-1-git-send-email-eak@us.ibm.com> Subject: [Qemu-devel] [PATCH][RESEND] Fix non-ACPI Timer Interrupt Routing - v3 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: aliguori@us.ibm.com Cc: Beth Kon , qemu-devel@nongnu.org ***NOTE: Anthony, this needs to replace 0013_fix-non-acpi-timer-interrupt-routing.patch.*** Replicate ACPI irq0->inti2 override in mp table for non-acpi case. v1 -> v2 adds comment suggested by Ryan. v2 -> v3 clarifies comment and corrects entry count Anthony, the old version of this patch needs to be removed and replaced with this version. Signed-off-by: Beth Kon --- diff --git a/bios/rombios32.c b/bios/rombios32.c index 1a1ed64..d789e20 100644 --- a/bios/rombios32.c +++ b/bios/rombios32.c @@ -1124,7 +1124,11 @@ static void mptable_init(void) putstr(&q, "0.1 "); /* vendor id */ putle32(&q, 0); /* OEM table ptr */ putle16(&q, 0); /* OEM table size */ +#ifdef BX_QEMU + putle16(&q, smp_cpus + 17); /* entry count */ +#else putle16(&q, smp_cpus + 18); /* entry count */ +#endif putle32(&q, 0xfee00000); /* local APIC addr */ putle16(&q, 0); /* ext table length */ putb(&q, 0); /* ext table checksum */ @@ -1166,6 +1170,12 @@ static void mptable_init(void) /* irqs */ for(i = 0; i < 16; i++) { +#ifdef BX_QEMU + /* One entry per ioapic interrupt destination. Destination 2 is covered + by irq0->inti2 override (i == 0). Source IRQ 2 is unused */ + if (i == 2) + continue; +#endif putb(&q, 3); /* entry type = I/O interrupt */ putb(&q, 0); /* interrupt type = vectored interrupt */ putb(&q, 0); /* flags: po=0, el=0 */ @@ -1173,7 +1183,11 @@ static void mptable_init(void) putb(&q, 0); /* source bus ID = ISA */ putb(&q, i); /* source bus IRQ */ putb(&q, ioapic_id); /* dest I/O APIC ID */ +#ifdef BX_QEMU + putb(&q, i == 0 ? 2 : i); /* dest I/O APIC interrupt in */ +#else putb(&q, i); /* dest I/O APIC interrupt in */ +#endif } /* patch length */ len = q - mp_config_table;