From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LDi2O-0001H6-NT for qemu-devel@nongnu.org; Fri, 19 Dec 2008 11:17:16 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LDi2N-0001Gt-9t for qemu-devel@nongnu.org; Fri, 19 Dec 2008 11:17:16 -0500 Received: from [199.232.76.173] (port=47499 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LDi2N-0001Gq-3S for qemu-devel@nongnu.org; Fri, 19 Dec 2008 11:17:15 -0500 Received: from savannah.gnu.org ([199.232.41.3]:33970 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LDi2M-0001Tr-Ru for qemu-devel@nongnu.org; Fri, 19 Dec 2008 11:17:14 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LDi2K-000470-4I for qemu-devel@nongnu.org; Fri, 19 Dec 2008 16:17:12 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LDi2J-00046w-JT for qemu-devel@nongnu.org; Fri, 19 Dec 2008 16:17:11 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Fri, 19 Dec 2008 16:17:11 +0000 Subject: [Qemu-devel] [6108] Make sure ACPI structures are byte-aligned 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 Revision: 6108 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6108 Author: aliguori Date: 2008-12-19 16:17:10 +0000 (Fri, 19 Dec 2008) Log Message: ----------- Make sure ACPI structures are byte-aligned Apparently, guests are very tolerant of corrupt ACPI tables because our tables have been badly corrupted for some time now. A version of Knoppix using a 2.6.11 kernel refused to boot and it turned out it was due to the interrupt override table introduced by the recent HPET commit. This patch updates the BIOS and introduces a patch to pack the ACPI tables. If you have a guest that used to work and is broken by the this commit, let me know. We have some weird hacks in the tables that I suspect are work arounds for this bug. Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/pc-bios/bios-pq/series trunk/pc-bios/bios.bin Added Paths: ----------- trunk/pc-bios/bios-pq/0006_acpi-packing.patch Added: trunk/pc-bios/bios-pq/0006_acpi-packing.patch =================================================================== --- trunk/pc-bios/bios-pq/0006_acpi-packing.patch (rev 0) +++ trunk/pc-bios/bios-pq/0006_acpi-packing.patch 2008-12-19 16:17:10 UTC (rev 6108) @@ -0,0 +1,36 @@ +Make ACPI tables byte-aligned + +The ACPI spec requires structures to be byte-aligned. I'm a bit surprised we've +gotten away with this for so long. This patch allows Knoppix to boot. This bug +was reported by Paul Brook. + +Signed-off-by: Anthony Liguori + +diff --git a/bios/rombios32.c b/bios/rombios32.c +index 7953485..540912a 100644 +--- a/bios/rombios32.c ++++ b/bios/rombios32.c +@@ -1099,6 +1099,12 @@ static void mptable_init(void) + /* Table structure from Linux kernel (the ACPI tables are under the + BSD license) */ + ++/* ++ * All tables must be byte-packed to match the ACPI specification, since ++ * the tables are provided by the system BIOS. ++ */ ++#pragma pack(1) ++ + #define ACPI_TABLE_HEADER_DEF /* ACPI common table header */ \ + uint8_t signature [4]; /* ACPI signature (4 ASCII characters) */\ + uint32_t length; /* Length of table, in bytes, including header */\ +@@ -1326,6 +1332,10 @@ struct madt_int_override + }; + #endif + ++/* Reset to default packing */ ++ ++#pragma pack() ++ + #include "acpi-dsdt.hex" + + static inline uint16_t cpu_to_le16(uint16_t x) Modified: trunk/pc-bios/bios-pq/series =================================================================== --- trunk/pc-bios/bios-pq/series 2008-12-19 14:33:59 UTC (rev 6107) +++ trunk/pc-bios/bios-pq/series 2008-12-19 16:17:10 UTC (rev 6108) @@ -3,3 +3,4 @@ 0003_smp-startup-poll.patch 0004_no-stack-protector.patch 0005_hpet.patch +0006_acpi-packing.patch Modified: trunk/pc-bios/bios.bin =================================================================== (Binary files differ)