qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Dirk Müller" <dirk@dmllr.de>, qemu-devel@nongnu.org
Cc: Blue Swirl <blauwirbel@gmail.com>,
	Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	Fabien Chouteau <chouteau@adacore.com>
Subject: Re: [Qemu-devel] [PATCH for-2.3] sparc: memory: Replace memory_region_init_ram with memory_region_allocate_system_memory
Date: Wed, 25 Mar 2015 14:36:31 +0100	[thread overview]
Message-ID: <5512B9DF.40408@redhat.com> (raw)
In-Reply-To: <CAL5wTH7o8uA59Ep0n41i0M19VFWa73n9m172j2W3fjz6=PSVBA@mail.gmail.com>



On 24/03/2015 22:30, 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/sparc/leon3.c | 3 +--
>  hw/sparc/sun4m.c | 5 ++---
>  2 files changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c
> index e41ec0b..7f5dcd6 100644
> --- a/hw/sparc/leon3.c
> +++ b/hw/sparc/leon3.c
> @@ -151,8 +151,7 @@ static void leon3_generic_hw_init(MachineState *machine)
>          exit(1);
>      }
> 
> -    memory_region_init_ram(ram, NULL, "leon3.ram", ram_size, &error_abort);
> -    vmstate_register_ram_global(ram);
> +    memory_region_allocate_system_memory(ram, NULL, "leon3.ram", ram_size);
>      memory_region_add_subregion(address_space_mem, 0x40000000, ram);
> 
>      /* Allocate BIOS */
> diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
> index b879aa9..7761321 100644
> --- a/hw/sparc/sun4m.c
> +++ b/hw/sparc/sun4m.c
> @@ -805,9 +805,8 @@ static int ram_init1(SysBusDevice *dev)
>  {
>      RamDevice *d = SUN4M_RAM(dev);
> 
> -    memory_region_init_ram(&d->ram, OBJECT(d), "sun4m.ram", d->size,
> -                           &error_abort);
> -    vmstate_register_ram_global(&d->ram);
> +    memory_region_allocate_system_memory(&d->ram, OBJECT(d), "sun4m.ram",
> +                                         d->size);
>      sysbus_init_mmio(dev, &d->ram);
>      return 0;
>  }
> 

Applied, thanks.

Paolo

      parent reply	other threads:[~2015-03-25 13:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-24 21:30 [Qemu-devel] [PATCH for-2.3] sparc: memory: Replace memory_region_init_ram with memory_region_allocate_system_memory Dirk Müller
2015-03-24 23:08 ` Andreas Färber
2015-03-25 13:36 ` Paolo Bonzini [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5512B9DF.40408@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=chouteau@adacore.com \
    --cc=dirk@dmllr.de \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).