mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-25 20:49:49 +00:00
arm/virt: use memdev for RAM
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and then map memory region provided by MachineState::ram_memdev Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20200219160953.13771-34-imammedo@redhat.com>
This commit is contained in:
parent
08b8ba04c9
commit
a72f6805f3
@ -1512,7 +1512,6 @@ static void machvirt_init(MachineState *machine)
|
|||||||
MemoryRegion *sysmem = get_system_memory();
|
MemoryRegion *sysmem = get_system_memory();
|
||||||
MemoryRegion *secure_sysmem = NULL;
|
MemoryRegion *secure_sysmem = NULL;
|
||||||
int n, virt_max_cpus;
|
int n, virt_max_cpus;
|
||||||
MemoryRegion *ram = g_new(MemoryRegion, 1);
|
|
||||||
bool firmware_loaded;
|
bool firmware_loaded;
|
||||||
bool aarch64 = true;
|
bool aarch64 = true;
|
||||||
bool has_ged = !vmc->no_ged;
|
bool has_ged = !vmc->no_ged;
|
||||||
@ -1706,9 +1705,8 @@ static void machvirt_init(MachineState *machine)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
memory_region_allocate_system_memory(ram, NULL, "mach-virt.ram",
|
memory_region_add_subregion(sysmem, vms->memmap[VIRT_MEM].base,
|
||||||
machine->ram_size);
|
machine->ram);
|
||||||
memory_region_add_subregion(sysmem, vms->memmap[VIRT_MEM].base, ram);
|
|
||||||
if (machine->device_memory) {
|
if (machine->device_memory) {
|
||||||
memory_region_add_subregion(sysmem, machine->device_memory->base,
|
memory_region_add_subregion(sysmem, machine->device_memory->base,
|
||||||
&machine->device_memory->mr);
|
&machine->device_memory->mr);
|
||||||
@ -2058,6 +2056,7 @@ static void virt_machine_class_init(ObjectClass *oc, void *data)
|
|||||||
hc->unplug_request = virt_machine_device_unplug_request_cb;
|
hc->unplug_request = virt_machine_device_unplug_request_cb;
|
||||||
mc->numa_mem_supported = true;
|
mc->numa_mem_supported = true;
|
||||||
mc->auto_enable_numa_with_memhp = true;
|
mc->auto_enable_numa_with_memhp = true;
|
||||||
|
mc->default_ram_id = "mach-virt.ram";
|
||||||
}
|
}
|
||||||
|
|
||||||
static void virt_instance_init(Object *obj)
|
static void virt_instance_init(Object *obj)
|
||||||
|
Loading…
Reference in New Issue
Block a user