]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
pc: exit QEMU if number of slots more than supported 256
authorIgor Mammedov <imammedo@redhat.com>
Mon, 2 Jun 2014 13:25:09 +0000 (15:25 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 19 Jun 2014 13:41:48 +0000 (16:41 +0300)
... 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>
hw/i386/pc.c
include/hw/acpi/acpi.h

index 6cdcb0048d6439e40fffc6f22f80bb1234a82ede..366e799bb07d7c90ee3e464dd4ab7594af9b2aec 100644 (file)
@@ -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);
 
index a9fae9d5c5e7c19174600b4a396ed9ca4d37e262..e93de6cab1cd9a56a616a1f4169ca17f8099e38e 100644 (file)
 #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 */