Commit ebd7fc5099f8c643a2427bc18b8333d0cebef0d5

Authored by aliguori
1 parent fe76d976

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
pc-bios/bios-pq/0006_acpi-packing.patch 0 → 100644
  1 +Make ACPI tables byte-aligned
  2 +
  3 +The ACPI spec requires structures to be byte-aligned. I'm a bit surprised we've
  4 +gotten away with this for so long. This patch allows Knoppix to boot. This bug
  5 +was reported by Paul Brook.
  6 +
  7 +Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
  8 +
  9 +diff --git a/bios/rombios32.c b/bios/rombios32.c
  10 +index 7953485..540912a 100644
  11 +--- a/bios/rombios32.c
  12 ++++ b/bios/rombios32.c
  13 +@@ -1099,6 +1099,12 @@ static void mptable_init(void)
  14 + /* Table structure from Linux kernel (the ACPI tables are under the
  15 + BSD license) */
  16 +
  17 ++/*
  18 ++ * All tables must be byte-packed to match the ACPI specification, since
  19 ++ * the tables are provided by the system BIOS.
  20 ++ */
  21 ++#pragma pack(1)
  22 ++
  23 + #define ACPI_TABLE_HEADER_DEF /* ACPI common table header */ \
  24 + uint8_t signature [4]; /* ACPI signature (4 ASCII characters) */\
  25 + uint32_t length; /* Length of table, in bytes, including header */\
  26 +@@ -1326,6 +1332,10 @@ struct madt_int_override
  27 + };
  28 + #endif
  29 +
  30 ++/* Reset to default packing */
  31 ++
  32 ++#pragma pack()
  33 ++
  34 + #include "acpi-dsdt.hex"
  35 +
  36 + static inline uint16_t cpu_to_le16(uint16_t x)
pc-bios/bios-pq/series
@@ -3,3 +3,4 @@ @@ -3,3 +3,4 @@
3 0003_smp-startup-poll.patch 3 0003_smp-startup-poll.patch
4 0004_no-stack-protector.patch 4 0004_no-stack-protector.patch
5 0005_hpet.patch 5 0005_hpet.patch
  6 +0006_acpi-packing.patch
pc-bios/bios.bin
No preview for this file type