summaryrefslogtreecommitdiff
path: root/hw/i386/acpi-build.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2014-07-28 17:34:16 +0200
committerMichael S. Tsirkin <mst@redhat.com>2014-07-29 12:26:12 +0200
commit18045fb9f457a0f0cba2bd113c748a2dcb4ed39e (patch)
tree865890d54e44a6d7532474ac43141a69d676ba8c /hw/i386/acpi-build.c
parent093a35e5fc0c60508e8c754ae81572090365723d (diff)
downloadqemu-18045fb9f457a0f0cba2bd113c748a2dcb4ed39e.tar.gz
qemu-18045fb9f457a0f0cba2bd113c748a2dcb4ed39e.tar.bz2
qemu-18045fb9f457a0f0cba2bd113c748a2dcb4ed39e.zip
pc: future-proof migration-compatibility of ACPI tables
This patch avoids that similar changes break QEMU again in the future. QEMU will now hard-code 64k as the maximum ACPI table size, which (despite being an order of magnitude smaller than 640k) should be enough for everyone. Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/i386/acpi-build.c')
-rw-r--r--hw/i386/acpi-build.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index ec86f1b311..2178894f67 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -62,6 +62,8 @@
#define ACPI_BUILD_LEGACY_CPU_AML_SIZE 97
#define ACPI_BUILD_ALIGN_SIZE 0x1000
+#define ACPI_BUILD_TABLE_SIZE 0x10000
+
typedef struct AcpiCpuInfo {
DECLARE_BITMAP(found_cpus, ACPI_CPU_HOTPLUG_ID_LIMIT);
} AcpiCpuInfo;
@@ -1588,7 +1590,13 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
}
g_array_set_size(tables->table_data, legacy_table_size);
} else {
- acpi_align_size(tables->table_data, ACPI_BUILD_ALIGN_SIZE);
+ if (tables->table_data->len > ACPI_BUILD_TABLE_SIZE) {
+ /* As of QEMU 2.1, this fires with 160 VCPUs and 255 memory slots. */
+ error_report("ACPI tables are larger than 64k. Please remove");
+ error_report("CPUs, NUMA nodes, memory slots or PCI bridges.");
+ exit(1);
+ }
+ g_array_set_size(tables->table_data, ACPI_BUILD_TABLE_SIZE);
}
acpi_align_size(tables->linker, ACPI_BUILD_ALIGN_SIZE);