aboutsummaryrefslogtreecommitdiff
path: root/pc-bios
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-12-19 16:17:10 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-12-19 16:17:10 +0000
commitebd7fc5099f8c643a2427bc18b8333d0cebef0d5 (patch)
tree4a929c219f6ad4c592df716c715f7db75b162f7a /pc-bios
parentfe76d97653d6611df19dacc4e326fc7d3d057237 (diff)
downloadqemu-ebd7fc5099f8c643a2427bc18b8333d0cebef0d5.zip
qemu-ebd7fc5099f8c643a2427bc18b8333d0cebef0d5.tar.gz
qemu-ebd7fc5099f8c643a2427bc18b8333d0cebef0d5.tar.bz2
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 <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6108 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'pc-bios')
-rw-r--r--pc-bios/bios-pq/0006_acpi-packing.patch36
-rw-r--r--pc-bios/bios-pq/series1
-rw-r--r--pc-bios/bios.binbin131072 -> 131072 bytes
3 files changed, 37 insertions, 0 deletions
diff --git a/pc-bios/bios-pq/0006_acpi-packing.patch b/pc-bios/bios-pq/0006_acpi-packing.patch
new file mode 100644
index 0000000..0037046
--- /dev/null
+++ b/pc-bios/bios-pq/0006_acpi-packing.patch
@@ -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 <aliguori@us.ibm.com>
+
+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)
diff --git a/pc-bios/bios-pq/series b/pc-bios/bios-pq/series
index beff2c6..b53157e 100644
--- a/pc-bios/bios-pq/series
+++ b/pc-bios/bios-pq/series
@@ -3,3 +3,4 @@
0003_smp-startup-poll.patch
0004_no-stack-protector.patch
0005_hpet.patch
+0006_acpi-packing.patch
diff --git a/pc-bios/bios.bin b/pc-bios/bios.bin
index c401d25..1d987d0 100644
--- a/pc-bios/bios.bin
+++ b/pc-bios/bios.bin
Binary files differ