[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 13/31] pc: exit QEMU if number of slots more than
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH v2 13/31] pc: exit QEMU if number of slots more than supported 256 |
Date: |
Tue, 20 May 2014 17:15:16 +0200 |
... which is imposed by current naming scheme of ACPI memory devices.
Signed-off-by: Igor Mammedov <address@hidden>
---
v2:
* use define for amount of supported slots, requested by Eduardo Habkost
---
hw/i386/pc.c | 6 ++++++
include/hw/acpi/acpi.h | 6 ++++++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index f94cfd9..5522503 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1234,6 +1234,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);
diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h
index a9fae9d..e93de6c 100644
--- a/include/hw/acpi/acpi.h
+++ b/include/hw/acpi/acpi.h
@@ -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 */
--
1.7.1
- [Qemu-devel] [PATCH v2 04/31] add memdev backend infrastructure, (continued)
- [Qemu-devel] [PATCH v2 04/31] add memdev backend infrastructure, Igor Mammedov, 2014/05/20
- [Qemu-devel] [PATCH v2 03/31] vl.c: daemonize before guest memory allocation, Igor Mammedov, 2014/05/20
- [Qemu-devel] [PATCH v2 06/31] pc: create custom generic PC machine type, Igor Mammedov, 2014/05/20
- [Qemu-devel] [PATCH v2 05/31] vl.c: extend -m option to support options for memory hotplug, Igor Mammedov, 2014/05/20
- [Qemu-devel] [PATCH v2 07/31] qdev: hotplug for buss-less devices, Igor Mammedov, 2014/05/20
- [Qemu-devel] [PATCH v2 08/31] qdev: expose DeviceState.hotplugged field as a property, Igor Mammedov, 2014/05/20
- [Qemu-devel] [PATCH v2 09/31] dimm: implement dimm device abstraction, Igor Mammedov, 2014/05/20
- [Qemu-devel] [PATCH v2 10/31] memory: add memory_region_is_mapped() API, Igor Mammedov, 2014/05/20
- [Qemu-devel] [PATCH v2 11/31] dimm: do not allow to set already used memdev, Igor Mammedov, 2014/05/20
- [Qemu-devel] [PATCH v2 13/31] pc: exit QEMU if number of slots more than supported 256,
Igor Mammedov <=
- [Qemu-devel] [PATCH v2 14/31] pc: add 'etc/reserved-memory-end' fw_cfg interface for SeaBIOS, Igor Mammedov, 2014/05/20
- [Qemu-devel] [PATCH v2 15/31] pc: add memory hotplug handler to PC_MACHINE, Igor Mammedov, 2014/05/20
- [Qemu-devel] [PATCH v2 16/31] dimm: add busy address check and address auto-allocation, Igor Mammedov, 2014/05/20
- [Qemu-devel] [PATCH v2 17/31] dimm: add busy slot check and slot auto-allocation, Igor Mammedov, 2014/05/20
- [Qemu-devel] [PATCH v2 18/31] acpi: rename cpu_hotplug_defs.h to acpi_defs.h, Igor Mammedov, 2014/05/20
- [Qemu-devel] [PATCH v2 19/31] acpi: memory hotplug ACPI hardware implementation, Igor Mammedov, 2014/05/20
- [Qemu-devel] [PATCH v2 21/31] trace: pc: add DIMM slot & address allocation, Igor Mammedov, 2014/05/20
- [Qemu-devel] [PATCH v2 24/31] pc: ich9 lpc: make it work with global/compat properties, Igor Mammedov, 2014/05/20