[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 13/35] pc: initialize memory hotplug address spa
From: |
Hu Tao |
Subject: |
Re: [Qemu-devel] [PATCH 13/35] pc: initialize memory hotplug address space |
Date: |
Wed, 16 Apr 2014 16:59:25 +0800 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Fri, Apr 04, 2014 at 03:36:38PM +0200, Igor Mammedov wrote:
> initialize and map hotplug memory address space container
> into guest's RAM address space.
>
> Signed-off-by: Igor Mammedov <address@hidden>
> ---
> hw/i386/pc.c | 19 +++++++++++++++++--
> include/hw/i386/pc.h | 10 ++++++++++
> 2 files changed, 27 insertions(+), 2 deletions(-)
>
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 32b4003..69e4225 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -1171,6 +1171,9 @@ FWCfgState *pc_memory_init(MemoryRegion *system_memory,
> MemoryRegion *ram, *option_rom_mr;
> MemoryRegion *ram_below_4g, *ram_above_4g;
> FWCfgState *fw_cfg;
> + ram_addr_t ram_size = below_4g_mem_size + above_4g_mem_size;
> + MachineState *machine = MACHINE(qdev_get_machine());
> + PCMachineState *pcms = PC_MACHINE(machine);
>
> linux_boot = (kernel_filename != NULL);
>
> @@ -1179,8 +1182,7 @@ FWCfgState *pc_memory_init(MemoryRegion *system_memory,
> * with older qemus that used qemu_ram_alloc().
> */
> ram = g_malloc(sizeof(*ram));
> - memory_region_init_ram(ram, NULL, "pc.ram",
> - below_4g_mem_size + above_4g_mem_size);
> + memory_region_init_ram(ram, NULL, "pc.ram", ram_size);
> vmstate_register_ram_global(ram);
> *ram_memory = ram;
> ram_below_4g = g_malloc(sizeof(*ram_below_4g));
> @@ -1197,6 +1199,19 @@ FWCfgState *pc_memory_init(MemoryRegion *system_memory,
> e820_add_entry(0x100000000ULL, above_4g_mem_size, E820_RAM);
> }
>
> + /* initialize hotplug memory address space */
> + if (ram_size < machine->init_args.maxram_size) {
> + ram_addr_t hotplug_mem_size =
> + machine->init_args.maxram_size - ram_size;
> +
> + pcms->hotplug_memory_base =
> + ROUND_UP(0x100000000ULL + above_4g_mem_size, 1ULL << 30);
-m maxmem should be limited otherwise hotplug_memory_base + maxmem can
overflow(in dimm_get_free_addr()).
- Re: [Qemu-devel] [PATCH 08/35] qdev: hotplug for buss-less devices, (continued)
- [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
- Re: [Qemu-devel] [PATCH 13/35] pc: initialize memory hotplug address space,
Hu Tao <=
[Qemu-devel] [PATCH 14/35] pc: exit QEMU if slots > 256, Igor Mammedov, 2014/04/04
[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