From patchwork Fri Aug 14 12:21:58 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 31400 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id 1EB66B708C for ; Fri, 14 Aug 2009 22:49:00 +1000 (EST) Received: from localhost ([127.0.0.1]:51648 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MbwCp-0007J2-2l for incoming@patchwork.ozlabs.org; Fri, 14 Aug 2009 08:48:27 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MbvnR-0007LV-Ma for qemu-devel@nongnu.org; Fri, 14 Aug 2009 08:22:13 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MbvnM-0007Hk-JV for qemu-devel@nongnu.org; Fri, 14 Aug 2009 08:22:12 -0400 Received: from [199.232.76.173] (port=47019 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MbvnM-0007Hg-8D for qemu-devel@nongnu.org; Fri, 14 Aug 2009 08:22:08 -0400 Received: from mx2.redhat.com ([66.187.237.31]:41899) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MbvnL-0006G6-OS for qemu-devel@nongnu.org; Fri, 14 Aug 2009 08:22:08 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7ECM7ec027048 for ; Fri, 14 Aug 2009 08:22:07 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n7ECM617026565; Fri, 14 Aug 2009 08:22:06 -0400 Received: from zweiblum.home.kraxel.org (vpn1-4-95.ams2.redhat.com [10.36.4.95]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with SMTP id n7ECM4bE006046; Fri, 14 Aug 2009 08:22:04 -0400 Received: by zweiblum.home.kraxel.org (Postfix, from userid 500) id 5DBAF700DD; Fri, 14 Aug 2009 14:21:58 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 14 Aug 2009 14:21:58 +0200 Message-Id: <1250252518-29300-7-git-send-email-kraxel@redhat.com> In-Reply-To: <1250252518-29300-1-git-send-email-kraxel@redhat.com> References: <1250252518-29300-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: avi@redhat.com, Gerd Hoffmann Subject: [Qemu-devel] [PATCH 6/6] add interrupt override entries for IRQs 5, 9, 10, 11 to the MADT X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org so the OS knows that they're active high, level triggered. This allows for proper ACPI event reporting such as the (emulated) power button and should also fix the ACPI timer. by Avi Kivity, adapted for upstream qemu by Gerd Hoffmann Signed-off-by: Gerd Hoffmann --- rombios32.c | 20 +++++++++++++++++++- 1 files changed, 19 insertions(+), 1 deletions(-) diff --git a/rombios32.c b/rombios32.c index ece0865..624f39f 100644 --- a/rombios32.c +++ b/rombios32.c @@ -57,6 +57,9 @@ typedef unsigned long long uint64_t; #define APIC_ID 0x020 #define APIC_LVT3 0x370 +/* IRQs 5,9,10,11 */ +#define PCI_ISA_IRQ_MASK 0x0e20U + #define APIC_ENABLED 0x0100 #define AP_BOOT_ADDR 0x9f000 @@ -1730,7 +1733,7 @@ void acpi_bios_init(void) madt_size = sizeof(*madt) + sizeof(struct madt_processor_apic) * max_cpus + #ifdef BX_QEMU - sizeof(struct madt_io_apic) + sizeof(struct madt_int_override); + sizeof(struct madt_io_apic) + sizeof(struct madt_int_override) * 5; #else sizeof(struct madt_io_apic); #endif @@ -1828,6 +1831,21 @@ void acpi_bios_init(void) int_override->source = cpu_to_le32(0); int_override->gsi = cpu_to_le32(2); int_override->flags = cpu_to_le32(0); + int_override++; + + for ( i = 0; i < 16; i++ ) { + if (!(PCI_ISA_IRQ_MASK & (1U << i))) { + /* No need for a INT source override structure. */ + continue; + } + memset(int_override, 0, sizeof(*int_override)); + int_override->type = APIC_XRUPT_OVERRIDE; + int_override->length = sizeof(*int_override); + int_override->source = i; + int_override->gsi = i; + int_override->flags = 0xd; /* active high, level triggered */ + int_override++; + } #endif acpi_build_table_header((struct acpi_table_header *)madt,