* [Qemu-devel] [PATCH] ppc: memory: Replace memory_region_init_ram with memory_region_allocate_system_memory
@ 2014-07-10 7:01 Shreyas B. Prabhu
2014-07-10 10:26 ` Alexander Graf
0 siblings, 1 reply; 5+ messages in thread
From: Shreyas B. Prabhu @ 2014-07-10 7:01 UTC (permalink / raw)
To: qemu-devel, qemu-ppc
Cc: Shreyas B. Prabhu, Alexander Graf, andreas.faerber, Paolo Bonzini,
bharata, Scott Wood, Edgar E. Iglesias
Commit 0b183fc871:"memory: move mem_path handling to
memory_region_allocate_system_memory" split memory_region_init_ram and
memory_region_init_ram_from_file. Also it moved mem-path handling a step
up from memory_region_init_ram to memory_region_allocate_system_memory.
Therefore for any board that uses memory_region_init_ram directly,
-mem-path is not supported.
Fix this by replacing memory_region_init_ram with
memory_region_allocate_system_memory.
Signed-off-by: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com>
---
hw/ppc/e500.c | 3 +--
hw/ppc/mac_newworld.c | 7 +++----
hw/ppc/mac_oldworld.c | 8 ++++----
hw/ppc/ppc405_boards.c | 21 +++++++++------------
hw/ppc/ppc405_uc.c | 5 +++--
hw/ppc/ppc4xx_devs.c | 5 +++--
hw/ppc/prep.c | 3 +--
hw/ppc/spapr.c | 4 ++--
hw/ppc/virtex_ml507.c | 3 +--
9 files changed, 27 insertions(+), 32 deletions(-)
diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index bb2e75f..1a5b30d 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -701,8 +701,7 @@ void ppce500_init(MachineState *machine, PPCE500Params *params)
machine->ram_size = ram_size;
/* Register Memory */
- memory_region_init_ram(ram, NULL, "mpc8544ds.ram", ram_size);
- vmstate_register_ram_global(ram);
+ memory_region_allocate_system_memory(ram, NULL, "mpc8544ds.ram", ram_size);
memory_region_add_subregion(address_space_mem, 0, ram);
dev = qdev_create(NULL, "e500-ccsr");
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index 89d3cad..7e97af4 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -200,13 +200,12 @@ static void ppc_core99_init(MachineState *machine)
}
/* allocate RAM */
- memory_region_init_ram(ram, NULL, "ppc_core99.ram", ram_size);
- vmstate_register_ram_global(ram);
+ memory_region_allocate_system_memory(ram, NULL, "ppc_core99.ram", ram_size);
memory_region_add_subregion(get_system_memory(), 0, ram);
/* allocate and load BIOS */
- memory_region_init_ram(bios, NULL, "ppc_core99.bios", BIOS_SIZE);
- vmstate_register_ram_global(bios);
+ memory_region_allocate_system_memory(bios, NULL, "ppc_core99.bios",
+ BIOS_SIZE);
if (bios_name == NULL)
bios_name = PROM_FILENAME;
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
index 4b5e905..afae825 100644
--- a/hw/ppc/mac_oldworld.c
+++ b/hw/ppc/mac_oldworld.c
@@ -130,13 +130,13 @@ static void ppc_heathrow_init(MachineState *machine)
exit(1);
}
- memory_region_init_ram(ram, NULL, "ppc_heathrow.ram", ram_size);
- vmstate_register_ram_global(ram);
+ memory_region_allocate_system_memory(ram, NULL, "ppc_heathrow.ram",
+ ram_size);
memory_region_add_subregion(sysmem, 0, ram);
/* allocate and load BIOS */
- memory_region_init_ram(bios, NULL, "ppc_heathrow.bios", BIOS_SIZE);
- vmstate_register_ram_global(bios);
+ memory_region_allocate_system_memory(bios, NULL, "ppc_heathrow.bios",
+ BIOS_SIZE);
if (bios_name == NULL)
bios_name = PROM_FILENAME;
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c
index 98ad2d7..6b566cd 100644
--- a/hw/ppc/ppc405_boards.c
+++ b/hw/ppc/ppc405_boards.c
@@ -199,8 +199,8 @@ static void ref405ep_init(MachineState *machine)
MemoryRegion *sysmem = get_system_memory();
/* XXX: fix this */
- memory_region_init_ram(&ram_memories[0], NULL, "ef405ep.ram", 0x08000000);
- vmstate_register_ram_global(&ram_memories[0]);
+ memory_region_allocate_system_memory(&ram_memories[0], NULL, "ef405ep.ram",
+ 0x08000000);
ram_bases[0] = 0;
ram_sizes[0] = 0x08000000;
memory_region_init(&ram_memories[1], NULL, "ef405ep.ram1", 0);
@@ -214,8 +214,7 @@ static void ref405ep_init(MachineState *machine)
33333333, &pic, kernel_filename == NULL ? 0 : 1);
/* allocate SRAM */
sram_size = 512 * 1024;
- memory_region_init_ram(sram, NULL, "ef405ep.sram", sram_size);
- vmstate_register_ram_global(sram);
+ memory_region_allocate_system_memory(sram, NULL, "ef405ep.sram", sram_size);
memory_region_add_subregion(sysmem, 0xFFF00000, sram);
/* allocate and load BIOS */
#ifdef DEBUG_BOARD_INIT
@@ -246,8 +245,8 @@ static void ref405ep_init(MachineState *machine)
printf("Load BIOS from file\n");
#endif
bios = g_new(MemoryRegion, 1);
- memory_region_init_ram(bios, NULL, "ef405ep.bios", BIOS_SIZE);
- vmstate_register_ram_global(bios);
+ memory_region_allocate_system_memory(bios, NULL, "ef405ep.bios",
+ BIOS_SIZE);
if (bios_name == NULL)
bios_name = BIOS_FILENAME;
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
@@ -518,14 +517,12 @@ static void taihu_405ep_init(MachineState *machine)
DriveInfo *dinfo;
/* RAM is soldered to the board so the size cannot be changed */
- memory_region_init_ram(&ram_memories[0], NULL,
+ memory_region_allocate_system_memory(&ram_memories[0], NULL,
"taihu_405ep.ram-0", 0x04000000);
- vmstate_register_ram_global(&ram_memories[0]);
ram_bases[0] = 0;
ram_sizes[0] = 0x04000000;
- memory_region_init_ram(&ram_memories[1], NULL,
+ memory_region_allocate_system_memory(&ram_memories[1], NULL,
"taihu_405ep.ram-1", 0x04000000);
- vmstate_register_ram_global(&ram_memories[1]);
ram_bases[1] = 0x04000000;
ram_sizes[1] = 0x04000000;
ram_size = 0x08000000;
@@ -567,8 +564,8 @@ static void taihu_405ep_init(MachineState *machine)
if (bios_name == NULL)
bios_name = BIOS_FILENAME;
bios = g_new(MemoryRegion, 1);
- memory_region_init_ram(bios, NULL, "taihu_405ep.bios", BIOS_SIZE);
- vmstate_register_ram_global(bios);
+ memory_region_allocate_system_memory(bios, NULL, "taihu_405ep.bios",
+ BIOS_SIZE);
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
if (filename) {
bios_size = load_image(filename, memory_region_get_ram_ptr(bios));
diff --git a/hw/ppc/ppc405_uc.c b/hw/ppc/ppc405_uc.c
index 54ba59e..fcd5f2d 100644
--- a/hw/ppc/ppc405_uc.c
+++ b/hw/ppc/ppc405_uc.c
@@ -23,6 +23,7 @@
*/
#include "hw/hw.h"
#include "hw/ppc/ppc.h"
+#include "hw/boards.h"
#include "ppc405.h"
#include "hw/char/serial.h"
#include "qemu/timer.h"
@@ -973,8 +974,8 @@ static void ppc405_ocm_init(CPUPPCState *env)
ocm = g_malloc0(sizeof(ppc405_ocm_t));
/* XXX: Size is 4096 or 0x04000000 */
- memory_region_init_ram(&ocm->isarc_ram, NULL, "ppc405.ocm", 4096);
- vmstate_register_ram_global(&ocm->isarc_ram);
+ memory_region_allocate_system_memory(&ocm->isarc_ram, NULL, "ppc405.ocm",
+ 4096);
memory_region_init_alias(&ocm->dsarc_ram, NULL, "ppc405.dsarc", &ocm->isarc_ram,
0, 4096);
qemu_register_reset(&ocm_reset, ocm);
diff --git a/hw/ppc/ppc4xx_devs.c b/hw/ppc/ppc4xx_devs.c
index 8a43111..07f9d00 100644
--- a/hw/ppc/ppc4xx_devs.c
+++ b/hw/ppc/ppc4xx_devs.c
@@ -24,6 +24,7 @@
#include "hw/hw.h"
#include "hw/ppc/ppc.h"
#include "hw/ppc/ppc4xx.h"
+#include "hw/boards.h"
#include "qemu/log.h"
#include "exec/address-spaces.h"
@@ -694,8 +695,8 @@ ram_addr_t ppc4xx_sdram_adjust(ram_addr_t ram_size, int nr_banks,
if (bank_size <= size_left) {
char name[32];
snprintf(name, sizeof(name), "ppc4xx.sdram%d", i);
- memory_region_init_ram(&ram_memories[i], NULL, name, bank_size);
- vmstate_register_ram_global(&ram_memories[i]);
+ memory_region_allocate_system_memory(&ram_memories[i], NULL,
+ name, bank_size);
ram_bases[i] = base;
ram_sizes[i] = bank_size;
base += bank_size;
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index aa8717d..f0ef1af 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -417,8 +417,7 @@ static void ppc_prep_init(MachineState *machine)
}
/* allocate RAM */
- memory_region_init_ram(ram, NULL, "ppc_prep.ram", ram_size);
- vmstate_register_ram_global(ram);
+ memory_region_allocate_system_memory(ram, NULL, "ppc_prep.ram", ram_size);
memory_region_add_subregion(sysmem, 0, ram);
if (linux_boot) {
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index a23c0f0..8fa9f7e 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1337,8 +1337,8 @@ static void ppc_spapr_init(MachineState *machine)
ram_addr_t nonrma_base = rma_alloc_size;
ram_addr_t nonrma_size = spapr->ram_limit - rma_alloc_size;
- memory_region_init_ram(ram, NULL, "ppc_spapr.ram", nonrma_size);
- vmstate_register_ram_global(ram);
+ memory_region_allocate_system_memory(ram, NULL, "ppc_spapr.ram",
+ nonrma_size);
memory_region_add_subregion(sysmem, nonrma_base, ram);
}
diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c
index 02b4f82..0de5148 100644
--- a/hw/ppc/virtex_ml507.c
+++ b/hw/ppc/virtex_ml507.c
@@ -222,8 +222,7 @@ static void virtex_init(MachineState *machine)
env = &cpu->env;
qemu_register_reset(main_cpu_reset, cpu);
- memory_region_init_ram(phys_ram, NULL, "ram", ram_size);
- vmstate_register_ram_global(phys_ram);
+ memory_region_allocate_system_memory(phys_ram, NULL, "ram", ram_size);
memory_region_add_subregion(address_space_mem, ram_base, phys_ram);
dinfo = drive_get(IF_PFLASH, 0, 0);
--
1.9.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] ppc: memory: Replace memory_region_init_ram with memory_region_allocate_system_memory
2014-07-10 7:01 [Qemu-devel] [PATCH] ppc: memory: Replace memory_region_init_ram with memory_region_allocate_system_memory Shreyas B. Prabhu
@ 2014-07-10 10:26 ` Alexander Graf
2014-07-10 12:01 ` [Qemu-devel] [PATCH v2] " Shreyas B. Prabhu
0 siblings, 1 reply; 5+ messages in thread
From: Alexander Graf @ 2014-07-10 10:26 UTC (permalink / raw)
To: Shreyas B. Prabhu, qemu-devel, qemu-ppc
Cc: Scott Wood, Edgar E. Iglesias, andreas.faerber, bharata,
Paolo Bonzini
On 10.07.14 09:01, Shreyas B. Prabhu wrote:
> Commit 0b183fc871:"memory: move mem_path handling to
> memory_region_allocate_system_memory" split memory_region_init_ram and
> memory_region_init_ram_from_file. Also it moved mem-path handling a step
> up from memory_region_init_ram to memory_region_allocate_system_memory.
>
> Therefore for any board that uses memory_region_init_ram directly,
> -mem-path is not supported.
>
> Fix this by replacing memory_region_init_ram with
> memory_region_allocate_system_memory.
>
> Signed-off-by: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com>
It think it's reasonable to do this for all targets, except for spapr
where Alexey is already working on a bigger patch. Could you please
remove the spapr change so I can apply the rest to ppc-next already?
Alex
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH v2] ppc: memory: Replace memory_region_init_ram with memory_region_allocate_system_memory
2014-07-10 10:26 ` Alexander Graf
@ 2014-07-10 12:01 ` Shreyas B. Prabhu
2014-07-10 12:04 ` Alexander Graf
0 siblings, 1 reply; 5+ messages in thread
From: Shreyas B. Prabhu @ 2014-07-10 12:01 UTC (permalink / raw)
To: qemu-devel, qemu-ppc, Alexander Graf
Cc: Shreyas B. Prabhu, andreas.faerber, Paolo Bonzini, bharata,
Scott Wood, Edgar E. Iglesias
Commit 0b183fc871:"memory: move mem_path handling to
memory_region_allocate_system_memory" split memory_region_init_ram and
memory_region_init_ram_from_file. Also it moved mem-path handling a step
up from memory_region_init_ram to memory_region_allocate_system_memory.
Therefore for any board that uses memory_region_init_ram directly,
-mem-path is not supported.
Fix this by replacing memory_region_init_ram with
memory_region_allocate_system_memory.
Signed-off-by: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com>
---
Changes in v2:
Dropping changes from hw/ppc/spapr.c based on the comment.
hw/ppc/e500.c | 3 +--
hw/ppc/mac_newworld.c | 7 +++----
hw/ppc/mac_oldworld.c | 8 ++++----
hw/ppc/ppc405_boards.c | 21 +++++++++------------
hw/ppc/ppc405_uc.c | 5 +++--
hw/ppc/ppc4xx_devs.c | 5 +++--
hw/ppc/prep.c | 3 +--
hw/ppc/virtex_ml507.c | 3 +--
8 files changed, 25 insertions(+), 30 deletions(-)
diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index bb2e75f..1a5b30d 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -701,8 +701,7 @@ void ppce500_init(MachineState *machine, PPCE500Params *params)
machine->ram_size = ram_size;
/* Register Memory */
- memory_region_init_ram(ram, NULL, "mpc8544ds.ram", ram_size);
- vmstate_register_ram_global(ram);
+ memory_region_allocate_system_memory(ram, NULL, "mpc8544ds.ram", ram_size);
memory_region_add_subregion(address_space_mem, 0, ram);
dev = qdev_create(NULL, "e500-ccsr");
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index 89d3cad..7e97af4 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -200,13 +200,12 @@ static void ppc_core99_init(MachineState *machine)
}
/* allocate RAM */
- memory_region_init_ram(ram, NULL, "ppc_core99.ram", ram_size);
- vmstate_register_ram_global(ram);
+ memory_region_allocate_system_memory(ram, NULL, "ppc_core99.ram", ram_size);
memory_region_add_subregion(get_system_memory(), 0, ram);
/* allocate and load BIOS */
- memory_region_init_ram(bios, NULL, "ppc_core99.bios", BIOS_SIZE);
- vmstate_register_ram_global(bios);
+ memory_region_allocate_system_memory(bios, NULL, "ppc_core99.bios",
+ BIOS_SIZE);
if (bios_name == NULL)
bios_name = PROM_FILENAME;
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
index 4b5e905..afae825 100644
--- a/hw/ppc/mac_oldworld.c
+++ b/hw/ppc/mac_oldworld.c
@@ -130,13 +130,13 @@ static void ppc_heathrow_init(MachineState *machine)
exit(1);
}
- memory_region_init_ram(ram, NULL, "ppc_heathrow.ram", ram_size);
- vmstate_register_ram_global(ram);
+ memory_region_allocate_system_memory(ram, NULL, "ppc_heathrow.ram",
+ ram_size);
memory_region_add_subregion(sysmem, 0, ram);
/* allocate and load BIOS */
- memory_region_init_ram(bios, NULL, "ppc_heathrow.bios", BIOS_SIZE);
- vmstate_register_ram_global(bios);
+ memory_region_allocate_system_memory(bios, NULL, "ppc_heathrow.bios",
+ BIOS_SIZE);
if (bios_name == NULL)
bios_name = PROM_FILENAME;
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c
index 98ad2d7..6b566cd 100644
--- a/hw/ppc/ppc405_boards.c
+++ b/hw/ppc/ppc405_boards.c
@@ -199,8 +199,8 @@ static void ref405ep_init(MachineState *machine)
MemoryRegion *sysmem = get_system_memory();
/* XXX: fix this */
- memory_region_init_ram(&ram_memories[0], NULL, "ef405ep.ram", 0x08000000);
- vmstate_register_ram_global(&ram_memories[0]);
+ memory_region_allocate_system_memory(&ram_memories[0], NULL, "ef405ep.ram",
+ 0x08000000);
ram_bases[0] = 0;
ram_sizes[0] = 0x08000000;
memory_region_init(&ram_memories[1], NULL, "ef405ep.ram1", 0);
@@ -214,8 +214,7 @@ static void ref405ep_init(MachineState *machine)
33333333, &pic, kernel_filename == NULL ? 0 : 1);
/* allocate SRAM */
sram_size = 512 * 1024;
- memory_region_init_ram(sram, NULL, "ef405ep.sram", sram_size);
- vmstate_register_ram_global(sram);
+ memory_region_allocate_system_memory(sram, NULL, "ef405ep.sram", sram_size);
memory_region_add_subregion(sysmem, 0xFFF00000, sram);
/* allocate and load BIOS */
#ifdef DEBUG_BOARD_INIT
@@ -246,8 +245,8 @@ static void ref405ep_init(MachineState *machine)
printf("Load BIOS from file\n");
#endif
bios = g_new(MemoryRegion, 1);
- memory_region_init_ram(bios, NULL, "ef405ep.bios", BIOS_SIZE);
- vmstate_register_ram_global(bios);
+ memory_region_allocate_system_memory(bios, NULL, "ef405ep.bios",
+ BIOS_SIZE);
if (bios_name == NULL)
bios_name = BIOS_FILENAME;
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
@@ -518,14 +517,12 @@ static void taihu_405ep_init(MachineState *machine)
DriveInfo *dinfo;
/* RAM is soldered to the board so the size cannot be changed */
- memory_region_init_ram(&ram_memories[0], NULL,
+ memory_region_allocate_system_memory(&ram_memories[0], NULL,
"taihu_405ep.ram-0", 0x04000000);
- vmstate_register_ram_global(&ram_memories[0]);
ram_bases[0] = 0;
ram_sizes[0] = 0x04000000;
- memory_region_init_ram(&ram_memories[1], NULL,
+ memory_region_allocate_system_memory(&ram_memories[1], NULL,
"taihu_405ep.ram-1", 0x04000000);
- vmstate_register_ram_global(&ram_memories[1]);
ram_bases[1] = 0x04000000;
ram_sizes[1] = 0x04000000;
ram_size = 0x08000000;
@@ -567,8 +564,8 @@ static void taihu_405ep_init(MachineState *machine)
if (bios_name == NULL)
bios_name = BIOS_FILENAME;
bios = g_new(MemoryRegion, 1);
- memory_region_init_ram(bios, NULL, "taihu_405ep.bios", BIOS_SIZE);
- vmstate_register_ram_global(bios);
+ memory_region_allocate_system_memory(bios, NULL, "taihu_405ep.bios",
+ BIOS_SIZE);
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
if (filename) {
bios_size = load_image(filename, memory_region_get_ram_ptr(bios));
diff --git a/hw/ppc/ppc405_uc.c b/hw/ppc/ppc405_uc.c
index 54ba59e..fcd5f2d 100644
--- a/hw/ppc/ppc405_uc.c
+++ b/hw/ppc/ppc405_uc.c
@@ -23,6 +23,7 @@
*/
#include "hw/hw.h"
#include "hw/ppc/ppc.h"
+#include "hw/boards.h"
#include "ppc405.h"
#include "hw/char/serial.h"
#include "qemu/timer.h"
@@ -973,8 +974,8 @@ static void ppc405_ocm_init(CPUPPCState *env)
ocm = g_malloc0(sizeof(ppc405_ocm_t));
/* XXX: Size is 4096 or 0x04000000 */
- memory_region_init_ram(&ocm->isarc_ram, NULL, "ppc405.ocm", 4096);
- vmstate_register_ram_global(&ocm->isarc_ram);
+ memory_region_allocate_system_memory(&ocm->isarc_ram, NULL, "ppc405.ocm",
+ 4096);
memory_region_init_alias(&ocm->dsarc_ram, NULL, "ppc405.dsarc", &ocm->isarc_ram,
0, 4096);
qemu_register_reset(&ocm_reset, ocm);
diff --git a/hw/ppc/ppc4xx_devs.c b/hw/ppc/ppc4xx_devs.c
index 8a43111..07f9d00 100644
--- a/hw/ppc/ppc4xx_devs.c
+++ b/hw/ppc/ppc4xx_devs.c
@@ -24,6 +24,7 @@
#include "hw/hw.h"
#include "hw/ppc/ppc.h"
#include "hw/ppc/ppc4xx.h"
+#include "hw/boards.h"
#include "qemu/log.h"
#include "exec/address-spaces.h"
@@ -694,8 +695,8 @@ ram_addr_t ppc4xx_sdram_adjust(ram_addr_t ram_size, int nr_banks,
if (bank_size <= size_left) {
char name[32];
snprintf(name, sizeof(name), "ppc4xx.sdram%d", i);
- memory_region_init_ram(&ram_memories[i], NULL, name, bank_size);
- vmstate_register_ram_global(&ram_memories[i]);
+ memory_region_allocate_system_memory(&ram_memories[i], NULL,
+ name, bank_size);
ram_bases[i] = base;
ram_sizes[i] = bank_size;
base += bank_size;
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index aa8717d..f0ef1af 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -417,8 +417,7 @@ static void ppc_prep_init(MachineState *machine)
}
/* allocate RAM */
- memory_region_init_ram(ram, NULL, "ppc_prep.ram", ram_size);
- vmstate_register_ram_global(ram);
+ memory_region_allocate_system_memory(ram, NULL, "ppc_prep.ram", ram_size);
memory_region_add_subregion(sysmem, 0, ram);
if (linux_boot) {
diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c
index 02b4f82..0de5148 100644
--- a/hw/ppc/virtex_ml507.c
+++ b/hw/ppc/virtex_ml507.c
@@ -222,8 +222,7 @@ static void virtex_init(MachineState *machine)
env = &cpu->env;
qemu_register_reset(main_cpu_reset, cpu);
- memory_region_init_ram(phys_ram, NULL, "ram", ram_size);
- vmstate_register_ram_global(phys_ram);
+ memory_region_allocate_system_memory(phys_ram, NULL, "ram", ram_size);
memory_region_add_subregion(address_space_mem, ram_base, phys_ram);
dinfo = drive_get(IF_PFLASH, 0, 0);
--
1.9.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH v2] ppc: memory: Replace memory_region_init_ram with memory_region_allocate_system_memory
2014-07-10 12:01 ` [Qemu-devel] [PATCH v2] " Shreyas B. Prabhu
@ 2014-07-10 12:04 ` Alexander Graf
2014-07-10 12:11 ` Shreyas B Prabhu
0 siblings, 1 reply; 5+ messages in thread
From: Alexander Graf @ 2014-07-10 12:04 UTC (permalink / raw)
To: Shreyas B. Prabhu, qemu-devel, qemu-ppc
Cc: Scott Wood, Edgar E. Iglesias, andreas.faerber, bharata,
Paolo Bonzini
On 10.07.14 14:01, Shreyas B. Prabhu wrote:
> Commit 0b183fc871:"memory: move mem_path handling to
> memory_region_allocate_system_memory" split memory_region_init_ram and
> memory_region_init_ram_from_file. Also it moved mem-path handling a step
> up from memory_region_init_ram to memory_region_allocate_system_memory.
>
> Therefore for any board that uses memory_region_init_ram directly,
> -mem-path is not supported.
>
> Fix this by replacing memory_region_init_ram with
> memory_region_allocate_system_memory.
>
> Signed-off-by: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com>
Thanks, applied to ppc-next (for 2.1 - it's a regression after all).
Alex
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH v2] ppc: memory: Replace memory_region_init_ram with memory_region_allocate_system_memory
2014-07-10 12:04 ` Alexander Graf
@ 2014-07-10 12:11 ` Shreyas B Prabhu
0 siblings, 0 replies; 5+ messages in thread
From: Shreyas B Prabhu @ 2014-07-10 12:11 UTC (permalink / raw)
To: Alexander Graf, qemu-devel, qemu-ppc
Cc: Scott Wood, Edgar E. Iglesias, andreas.faerber, bharata,
Paolo Bonzini
On Thursday 10 July 2014 05:34 PM, Alexander Graf wrote:
>
> On 10.07.14 14:01, Shreyas B. Prabhu wrote:
>> Commit 0b183fc871:"memory: move mem_path handling to
>> memory_region_allocate_system_memory" split memory_region_init_ram and
>> memory_region_init_ram_from_file. Also it moved mem-path handling a step
>> up from memory_region_init_ram to memory_region_allocate_system_memory.
>>
>> Therefore for any board that uses memory_region_init_ram directly,
>> -mem-path is not supported.
>>
>> Fix this by replacing memory_region_init_ram with
>> memory_region_allocate_system_memory.
>>
>> Signed-off-by: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com>
>
> Thanks, applied to ppc-next (for 2.1 - it's a regression after all).
>
Thanks!
>
> Alex
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-07-10 12:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-10 7:01 [Qemu-devel] [PATCH] ppc: memory: Replace memory_region_init_ram with memory_region_allocate_system_memory Shreyas B. Prabhu
2014-07-10 10:26 ` Alexander Graf
2014-07-10 12:01 ` [Qemu-devel] [PATCH v2] " Shreyas B. Prabhu
2014-07-10 12:04 ` Alexander Graf
2014-07-10 12:11 ` Shreyas B Prabhu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).