[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH REPOST v3 67/80] ppc/spapr: use memdev for RAM
From: |
Igor Mammedov |
Subject: |
[PATCH REPOST v3 67/80] ppc/spapr: use memdev for RAM |
Date: |
Thu, 23 Jan 2020 12:38:32 +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 using MachineState::ram instead of manually initializing
RAM memory region.
Signed-off-by: Igor Mammedov <address@hidden>
Acked-by: David Gibson <address@hidden>
---
CC: address@hidden
CC: address@hidden
---
hw/ppc/spapr.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 02cf53f..ff0343b 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2587,7 +2587,6 @@ static void spapr_machine_init(MachineState *machine)
PCIHostState *phb;
int i;
MemoryRegion *sysmem = get_system_memory();
- MemoryRegion *ram = g_new(MemoryRegion, 1);
hwaddr node0_size = spapr_node0_size(machine);
long load_limit, fw_size;
char *filename;
@@ -2766,10 +2765,8 @@ static void spapr_machine_init(MachineState *machine)
kvmppc_enable_h_page_init();
}
- /* allocate RAM */
- memory_region_allocate_system_memory(ram, NULL, "ppc_spapr.ram",
- machine->ram_size);
- memory_region_add_subregion(sysmem, 0, ram);
+ /* map RAM */
+ memory_region_add_subregion(sysmem, 0, machine->ram);
/* always allocate the device memory information */
machine->device_memory = g_malloc0(sizeof(*machine->device_memory));
@@ -4344,6 +4341,7 @@ static void spapr_machine_class_init(ObjectClass *oc,
void *data)
mc->no_parallel = 1;
mc->default_boot_order = "";
mc->default_ram_size = 512 * MiB;
+ mc->default_ram_id = "ppc_spapr.ram";
mc->default_display = "std";
mc->kvm_type = spapr_kvm_type;
machine_class_allow_dynamic_sysbus_dev(mc, TYPE_SPAPR_PCI_HOST_BRIDGE);
--
2.7.4
- [PATCH REPOST v3 65/80] ppc/{ppc440_bamboo, sam460ex}: use memdev for RAM, (continued)
- [PATCH REPOST v3 65/80] ppc/{ppc440_bamboo, sam460ex}: use memdev for RAM, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 68/80] ppc/virtex_ml507: remove unused arguments, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 64/80] ppc/{ppc440_bamboo, sam460ex}: drop RAM size fixup, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 66/80] ppc/prep: use memdev for RAM, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 70/80] sparc/leon3: use memdev for RAM, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 67/80] ppc/spapr: use memdev for RAM,
Igor Mammedov <=
- [PATCH REPOST v3 71/80] sparc/sun4m: use memdev for RAM, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 72/80] sparc/niagara: use memdev for RAM, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 69/80] ppc/virtex_ml507: use memdev for RAM, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 74/80] exec: cleanup qemu_minrampagesize()/qemu_maxrampagesize(), Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 75/80] exec: drop bogus mem_path from qemu_ram_alloc_from_fd(), Igor Mammedov, 2020/01/23