diff --git a/hw/acpi/utils.c b/hw/acpi/utils.c index f2d69a6d92..0c486ea29f 100644 --- a/hw/acpi/utils.c +++ b/hw/acpi/utils.c @@ -29,14 +29,19 @@ MemoryRegion *acpi_add_rom_blob(FWCfgCallback update, void *opaque, GArray *blob, const char *name) { - uint64_t max_size = 0; + uint64_t max_size; /* Reserve RAM space for tables: add another order of magnitude. */ if (!strcmp(name, ACPI_BUILD_TABLE_FILE)) { max_size = 0x200000; } else if (!strcmp(name, ACPI_BUILD_LOADER_FILE)) { max_size = 0x10000; + } else if (!strcmp(name, ACPI_BUILD_RSDP_FILE)) { + max_size = 0x1000; + } else { + g_assert_not_reached(); } + g_assert(acpi_data_len(blob) <= max_size); return rom_add_blob(name, blob->data, acpi_data_len(blob), max_size, -1, name, update, opaque, NULL, true);