Skip to content

Commit

Permalink
pc: exit QEMU if number of slots more than supported 256
Browse files Browse the repository at this point in the history
... which is imposed by current naming scheme of ACPI memory devices.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
Igor Mammedov authored and mstsirkin committed Jun 19, 2014
1 parent 619d11e commit a0cc885
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions hw/i386/pc.c
Expand Up @@ -1230,6 +1230,12 @@ FWCfgState *pc_memory_init(MemoryRegion *system_memory,
ram_addr_t hotplug_mem_size =
machine->maxram_size - ram_size;

if (machine->ram_slots > ACPI_MAX_RAM_SLOTS) {
error_report("unsupported amount of memory slots: %"PRIu64,
machine->ram_slots);
exit(EXIT_FAILURE);
}

pcms->hotplug_memory_base =
ROUND_UP(0x100000000ULL + above_4g_mem_size, 1ULL << 30);

Expand Down
6 changes: 6 additions & 0 deletions include/hw/acpi/acpi.h
Expand Up @@ -26,6 +26,12 @@
#include "exec/memory.h"
#include "hw/irq.h"

/*
* current device naming scheme supports
* only upto 256 memory devices
*/
#define ACPI_MAX_RAM_SLOTS 256

/* from linux include/acpi/actype.h */
/* Default ACPI register widths */

Expand Down

0 comments on commit a0cc885

Please sign in to comment.