* [Qemu-devel] [PATCH v2 for-2.3] m68k: memory: Replace memory_region_init_ram with memory_region_allocate_system_memory
@ 2015-03-24 22:11 Dirk Müller
2015-03-24 23:05 ` Andreas Färber
2015-03-25 13:35 ` Paolo Bonzini
0 siblings, 2 replies; 3+ messages in thread
From: Dirk Müller @ 2015-03-24 22:11 UTC (permalink / raw)
To: qemu-devel
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: Dirk Mueller <dmueller@suse.com>
---
hw/m68k/an5206.c | 3 +--
hw/m68k/dummy_m68k.c | 4 ++--
hw/m68k/mcf5208.c | 3 +--
3 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/hw/m68k/an5206.c b/hw/m68k/an5206.c
index f1f1350..f63ab2b 100644
--- a/hw/m68k/an5206.c
+++ b/hw/m68k/an5206.c
@@ -50,8 +50,7 @@ static void an5206_init(MachineState *machine)
env->rambar0 = AN5206_RAMBAR_ADDR | 1;
/* DRAM at address zero */
- memory_region_init_ram(ram, NULL, "an5206.ram", ram_size, &error_abort);
- vmstate_register_ram_global(ram);
+ memory_region_allocate_system_memory(ram, NULL, "an5206.ram", ram_size);
memory_region_add_subregion(address_space_mem, 0, ram);
/* Internal SRAM. */
diff --git a/hw/m68k/dummy_m68k.c b/hw/m68k/dummy_m68k.c
index 278f4c0..5b77d93 100644
--- a/hw/m68k/dummy_m68k.c
+++ b/hw/m68k/dummy_m68k.c
@@ -42,8 +42,8 @@ static void dummy_m68k_init(MachineState *machine)
env->vbr = 0;
/* RAM at address zero */
- memory_region_init_ram(ram, NULL, "dummy_m68k.ram", ram_size,
&error_abort);
- vmstate_register_ram_global(ram);
+ memory_region_allocate_system_memory(ram, NULL, "dummy_m68k.ram",
+ ram_size);
memory_region_add_subregion(address_space_mem, 0, ram);
/* Load kernel. */
diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c
index a01a445..326a42d 100644
--- a/hw/m68k/mcf5208.c
+++ b/hw/m68k/mcf5208.c
@@ -218,8 +218,7 @@ static void mcf5208evb_init(MachineState *machine)
/* TODO: Configure BARs. */
/* DRAM at 0x40000000 */
- memory_region_init_ram(ram, NULL, "mcf5208.ram", ram_size, &error_abort);
- vmstate_register_ram_global(ram);
+ memory_region_allocate_system_memory(ram, NULL, "mcf5208.ram", ram_size);
memory_region_add_subregion(address_space_mem, 0x40000000, ram);
/* Internal SRAM. */
--
2.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH v2 for-2.3] m68k: memory: Replace memory_region_init_ram with memory_region_allocate_system_memory
2015-03-24 22:11 [Qemu-devel] [PATCH v2 for-2.3] m68k: memory: Replace memory_region_init_ram with memory_region_allocate_system_memory Dirk Müller
@ 2015-03-24 23:05 ` Andreas Färber
2015-03-25 13:35 ` Paolo Bonzini
1 sibling, 0 replies; 3+ messages in thread
From: Andreas Färber @ 2015-03-24 23:05 UTC (permalink / raw)
To: Dirk Müller, qemu-devel; +Cc: Paolo Bonzini
Am 24.03.2015 um 23:11 schrieb Dirk Müller:
> 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: Dirk Mueller <dmueller@suse.com>
> ---
> hw/m68k/an5206.c | 3 +--
> hw/m68k/dummy_m68k.c | 4 ++--
> hw/m68k/mcf5208.c | 3 +--
> 3 files changed, 4 insertions(+), 6 deletions(-)
Reviewed-by: Andreas Färber <afaerber@suse.de>
Andreas
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu,
Graham Norton; HRB 21284 (AG Nürnberg)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH v2 for-2.3] m68k: memory: Replace memory_region_init_ram with memory_region_allocate_system_memory
2015-03-24 22:11 [Qemu-devel] [PATCH v2 for-2.3] m68k: memory: Replace memory_region_init_ram with memory_region_allocate_system_memory Dirk Müller
2015-03-24 23:05 ` Andreas Färber
@ 2015-03-25 13:35 ` Paolo Bonzini
1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2015-03-25 13:35 UTC (permalink / raw)
To: Dirk Müller, qemu-devel
On 24/03/2015 23:11, Dirk Müller 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: Dirk Mueller <dmueller@suse.com>
> ---
> hw/m68k/an5206.c | 3 +--
> hw/m68k/dummy_m68k.c | 4 ++--
> hw/m68k/mcf5208.c | 3 +--
> 3 files changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/hw/m68k/an5206.c b/hw/m68k/an5206.c
> index f1f1350..f63ab2b 100644
> --- a/hw/m68k/an5206.c
> +++ b/hw/m68k/an5206.c
> @@ -50,8 +50,7 @@ static void an5206_init(MachineState *machine)
> env->rambar0 = AN5206_RAMBAR_ADDR | 1;
>
> /* DRAM at address zero */
> - memory_region_init_ram(ram, NULL, "an5206.ram", ram_size, &error_abort);
> - vmstate_register_ram_global(ram);
> + memory_region_allocate_system_memory(ram, NULL, "an5206.ram", ram_size);
> memory_region_add_subregion(address_space_mem, 0, ram);
>
> /* Internal SRAM. */
> diff --git a/hw/m68k/dummy_m68k.c b/hw/m68k/dummy_m68k.c
> index 278f4c0..5b77d93 100644
> --- a/hw/m68k/dummy_m68k.c
> +++ b/hw/m68k/dummy_m68k.c
> @@ -42,8 +42,8 @@ static void dummy_m68k_init(MachineState *machine)
> env->vbr = 0;
>
> /* RAM at address zero */
> - memory_region_init_ram(ram, NULL, "dummy_m68k.ram", ram_size,
> &error_abort);
> - vmstate_register_ram_global(ram);
> + memory_region_allocate_system_memory(ram, NULL, "dummy_m68k.ram",
> + ram_size);
> memory_region_add_subregion(address_space_mem, 0, ram);
>
> /* Load kernel. */
> diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c
> index a01a445..326a42d 100644
> --- a/hw/m68k/mcf5208.c
> +++ b/hw/m68k/mcf5208.c
> @@ -218,8 +218,7 @@ static void mcf5208evb_init(MachineState *machine)
> /* TODO: Configure BARs. */
>
> /* DRAM at 0x40000000 */
> - memory_region_init_ram(ram, NULL, "mcf5208.ram", ram_size, &error_abort);
> - vmstate_register_ram_global(ram);
> + memory_region_allocate_system_memory(ram, NULL, "mcf5208.ram", ram_size);
> memory_region_add_subregion(address_space_mem, 0x40000000, ram);
>
> /* Internal SRAM. */
>
Applied, thanks.
Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-03-25 13:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-24 22:11 [Qemu-devel] [PATCH v2 for-2.3] m68k: memory: Replace memory_region_init_ram with memory_region_allocate_system_memory Dirk Müller
2015-03-24 23:05 ` Andreas Färber
2015-03-25 13:35 ` Paolo Bonzini
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).