[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 69/86] ppc:spapr: use memdev for RAM
From: |
Igor Mammedov |
Subject: |
[PATCH 69/86] ppc:spapr: use memdev for RAM |
Date: |
Tue, 31 Dec 2019 14:03:53 +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>
---
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 f11422f..915e36a 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2589,7 +2589,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;
@@ -2768,10 +2767,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));
@@ -4346,6 +4343,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 59/86] ppc:e500: drop RAM size fixup, (continued)
- [PATCH 59/86] ppc:e500: drop RAM size fixup, Igor Mammedov, 2019/12/31
- [PATCH 51/86] m68k:next-cube: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 56/86] mips:mips_malta: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 63/86] ppc:pnv: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 57/86] mips:mips_mipssim: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 49/86] m68k:an5206: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 58/86] mips:mips_r4k: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 62/86] ppc:mac_oldworld: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 67/86] ppc:ppc440_bamboo/sam460ex: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 70/86] ppc:virtex_ml507: remove unused arguments, Igor Mammedov, 2019/12/31
- [PATCH 69/86] ppc:spapr: use memdev for RAM,
Igor Mammedov <=
- [PATCH 64/86] ppc:ppc405_boards: add RAM size checks, Igor Mammedov, 2019/12/31
- [PATCH 71/86] ppc:virtex_ml507: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 72/86] sparc:leon3: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 44/86] hppa: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 50/86] m68k:mcf5208: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 61/86] ppc:mac_newworld: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 65/86] ppc:ppc405_boards: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 60/86] ppc:e500: use memdev for RAM, Igor Mammedov, 2019/12/31