[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GIT PULL 03/21] hw/arm/virt: Use machine_memory_devices_init()
From: |
David Hildenbrand |
Subject: |
[GIT PULL 03/21] hw/arm/virt: Use machine_memory_devices_init() |
Date: |
Wed, 12 Jul 2023 10:17:32 +0200 |
Let's use our new helper. We'll add the subregion to system RAM now
earlier. That shouldn't matter, because the system RAM memory region should
already be alive at that point.
Cc: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20230623124553.400585-4-david@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
---
hw/arm/virt.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 8a4c663735..0546e43448 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1813,10 +1813,7 @@ static void virt_set_memmap(VirtMachineState *vms, int
pa_bits)
virt_set_high_memmap(vms, base, pa_bits);
if (device_memory_size > 0) {
- ms->device_memory = g_malloc0(sizeof(*ms->device_memory));
- ms->device_memory->base = device_memory_base;
- memory_region_init(&ms->device_memory->mr, OBJECT(vms),
- "device-memory", device_memory_size);
+ machine_memory_devices_init(ms, device_memory_base,
device_memory_size);
}
}
@@ -2257,10 +2254,6 @@ static void machvirt_init(MachineState *machine)
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);
- }
virt_flash_fdt(vms, sysmem, secure_sysmem ?: sysmem);
--
2.41.0
- [GIT PULL 00/21] Host Memory Backends and Memory devices queue 2023-07-12, David Hildenbrand, 2023/07/12
- [GIT PULL 03/21] hw/arm/virt: Use machine_memory_devices_init(),
David Hildenbrand <=
- [GIT PULL 01/21] memory-device: Unify enabled vs. supported error messages, David Hildenbrand, 2023/07/12
- [GIT PULL 02/21] memory-device: Introduce machine_memory_devices_init(), David Hildenbrand, 2023/07/12
- [GIT PULL 04/21] hw/ppc/spapr: Use machine_memory_devices_init(), David Hildenbrand, 2023/07/12
- [GIT PULL 05/21] hw/loongarch/virt: Use machine_memory_devices_init(), David Hildenbrand, 2023/07/12
- [GIT PULL 06/21] hw/i386/pc: Use machine_memory_devices_init(), David Hildenbrand, 2023/07/12
- [GIT PULL 07/21] hw/i386/acpi-build: Rely on machine->device_memory when building SRAT, David Hildenbrand, 2023/07/12
- [GIT PULL 09/21] memory-device: Refactor memory_device_pre_plug(), David Hildenbrand, 2023/07/12
- [GIT PULL 08/21] hw/i386/pc: Remove PC_MACHINE_DEVMEM_REGION_SIZE, David Hildenbrand, 2023/07/12
- [GIT PULL 10/21] memory-device: Track used region size in DeviceMemoryState, David Hildenbrand, 2023/07/12
- [GIT PULL 11/21] softmmu/physmem: Warn with ram_block_discard_range() on MAP_PRIVATE file mapping, David Hildenbrand, 2023/07/12