[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH REPOST v3 31/80] arm/virt: use memdev for RAM
From: |
Igor Mammedov |
Subject: |
[PATCH REPOST v3 31/80] arm/virt: use memdev for RAM |
Date: |
Thu, 23 Jan 2020 12:37:56 +0100 |
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 <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Philippe Mathieu-Daudé <address@hidden>
---
CC: address@hidden
CC: address@hidden
CC: address@hidden
---
hw/arm/virt.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 39ab5f4..e2fbca3 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1512,7 +1512,6 @@ static void machvirt_init(MachineState *machine)
MemoryRegion *sysmem = get_system_memory();
MemoryRegion *secure_sysmem = NULL;
int n, virt_max_cpus;
- MemoryRegion *ram = g_new(MemoryRegion, 1);
bool firmware_loaded;
bool aarch64 = true;
bool has_ged = !vmc->no_ged;
@@ -1701,9 +1700,8 @@ static void machvirt_init(MachineState *machine)
}
}
- memory_region_allocate_system_memory(ram, NULL, "mach-virt.ram",
- machine->ram_size);
- memory_region_add_subregion(sysmem, vms->memmap[VIRT_MEM].base, ram);
+ memory_region_add_subregion(sysmem, vms->memmap[VIRT_MEM].base,
+ machine->ram);
if (machine->device_memory) {
memory_region_add_subregion(sysmem, machine->device_memory->base,
&machine->device_memory->mr);
@@ -2053,6 +2051,7 @@ static void virt_machine_class_init(ObjectClass *oc, void
*data)
hc->unplug_request = virt_machine_device_unplug_request_cb;
mc->numa_mem_supported = true;
mc->auto_enable_numa_with_memhp = true;
+ mc->default_ram_id = "mach-virt.ram";
}
static void virt_instance_init(Object *obj)
--
2.7.4
- [PATCH REPOST v3 25/80] arm/palm: use memdev for RAM, (continued)
- [PATCH REPOST v3 25/80] arm/palm: use memdev for RAM, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 27/80] arm/sabrelite: use memdev for RAM, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 26/80] arm/raspi: use memdev for RAM, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 29/80] arm/versatilepb: use memdev for RAM, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 30/80] arm/vexpress: use memdev for RAM, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 28/80] arm/sbsa-ref: use memdev for RAM, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 34/80] arm/xlnx-versal-virt: use memdev for RAM, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 32/80] arm/xilinx_zynq: drop RAM size fixup, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 31/80] arm/virt: use memdev for RAM,
Igor Mammedov <=
- [PATCH REPOST v3 35/80] arm/xlnx-zcu102: use memdev for RAM, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 33/80] arm/xilinx_zynq: use memdev for RAM, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 37/80] null-machine: use memdev for RAM, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 40/80] hw/hppa/machine: Restrict the total memory size to 3GB, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 41/80] hw/hppa/machine: Map the PDC memory region with higher priority, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 36/80] s390x/s390-virtio-ccw: use memdev for RAM, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 38/80] cris/axis_dev88: use memdev for RAM, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 39/80] hw/hppa/machine: Correctly check the firmware is in PDC range, Igor Mammedov, 2020/01/23