[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 14/35] pc: exit QEMU if slots > 256
From: |
Eduardo Habkost |
Subject: |
Re: [Qemu-devel] [PATCH 14/35] pc: exit QEMU if slots > 256 |
Date: |
Fri, 4 Apr 2014 14:14:04 -0300 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Fri, Apr 04, 2014 at 03:36:39PM +0200, Igor Mammedov wrote:
> ... which is current ACPI implementation limit.
>
> Signed-off-by: Igor Mammedov <address@hidden>
With this we will have yet another hardcoded limit/assumption scattererd
in different places around the code, which we won't know how/if it can
be changed in the future.
I would prefer to have a #define and an explanation on the code for the
specific limit, so people know if/when/how it is safe to change it a few
years from now.
Something like:
hw/acpi/acpi.h:
/* current device naming scheme dosen't support
* more that 256 memory devices
*/
#define ACPI_MAX_RAM_SLOTS 256
hw/acpi/acpi-build.c:build_ssdt():
assert(nr_mem <= ACPI_MAX_RAM_SLOTS)
hw/i386/pc.c:
if (machine->init_args.ram_slots > ACPI_MAX_RAM_SLOTS) {
error_report("unsupported amount of memory slots: %"PRIu64,
machine->init_args.ram_slots);
exit(EXIT_FAILURE);
}
> ---
> hw/i386/pc.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 69e4225..6fe1803 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -1204,6 +1204,12 @@ FWCfgState *pc_memory_init(MemoryRegion *system_memory,
> ram_addr_t hotplug_mem_size =
> machine->init_args.maxram_size - ram_size;
>
> + if (machine->init_args.ram_slots > 256) {
> + error_report("unsupported amount of memory slots: %"PRIu64,
> + machine->init_args.ram_slots);
> + exit(EXIT_FAILURE);
> + }
> +
> pcms->hotplug_memory_base =
> ROUND_UP(0x100000000ULL + above_4g_mem_size, 1ULL << 30);
>
> --
> 1.9.0
>
--
Eduardo
- [Qemu-devel] [PATCH 03/35] object_add: allow completion handler to get canonical path, (continued)
- [Qemu-devel] [PATCH 03/35] object_add: allow completion handler to get canonical path, Igor Mammedov, 2014/04/04
- [Qemu-devel] [PATCH 08/35] qdev: hotplug for buss-less devices, Igor Mammedov, 2014/04/04
- [Qemu-devel] [PATCH 09/35] qdev: expose DeviceState.hotplugged field as a property, Igor Mammedov, 2014/04/04
- [Qemu-devel] [PATCH 12/35] dimm: do not allow to set already busy memdev, Igor Mammedov, 2014/04/04
- [Qemu-devel] [PATCH 11/35] memory: add memory_region_is_mapped() API, Igor Mammedov, 2014/04/04
- [Qemu-devel] [PATCH 02/35] vl: convert -m to QemuOpts, Igor Mammedov, 2014/04/04
- [Qemu-devel] [PATCH 13/35] pc: initialize memory hotplug address space, Igor Mammedov, 2014/04/04
- [Qemu-devel] [PATCH 14/35] pc: exit QEMU if slots > 256, Igor Mammedov, 2014/04/04
- Re: [Qemu-devel] [PATCH 14/35] pc: exit QEMU if slots > 256,
Eduardo Habkost <=
- [Qemu-devel] [PATCH 15/35] pc: add 'etc/reserved-memory-end' fw_cfg interface for SeaBIOS, Igor Mammedov, 2014/04/04
- [Qemu-devel] [PATCH 17/35] dimm: add busy address check and address auto-allocation, Igor Mammedov, 2014/04/04
- [Qemu-devel] [PATCH 07/35] pc: create custom generic PC machine type, Igor Mammedov, 2014/04/04
- [Qemu-devel] [PATCH 18/35] dimm: add busy slot check and slot auto-allocation, Igor Mammedov, 2014/04/04
- [Qemu-devel] [PATCH 20/35] acpi: memory hotplug ACPI hardware implementation, Igor Mammedov, 2014/04/04
- [Qemu-devel] [PATCH 10/35] dimm: implement dimm device abstraction, Igor Mammedov, 2014/04/04
- [Qemu-devel] [PATCH 19/35] acpi: rename cpu_hotplug_defs.h to acpi_defs.h, Igor Mammedov, 2014/04/04
- [Qemu-devel] [PATCH 23/35] acpi:piix4: make plug/unlug callbacks generic, Igor Mammedov, 2014/04/04