From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YalU8-0002cN-Pw for qemu-devel@nongnu.org; Wed, 25 Mar 2015 09:36:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YalU4-0001Cs-NZ for qemu-devel@nongnu.org; Wed, 25 Mar 2015 09:36:40 -0400 Received: from mail-wg0-x22d.google.com ([2a00:1450:400c:c00::22d]:33119) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YalU4-0001Co-Gp for qemu-devel@nongnu.org; Wed, 25 Mar 2015 09:36:36 -0400 Received: by wgbcc7 with SMTP id cc7so27725191wgb.0 for ; Wed, 25 Mar 2015 06:36:35 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <5512B9DF.40408@redhat.com> Date: Wed, 25 Mar 2015 14:36:31 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH for-2.3] sparc: memory: Replace memory_region_init_ram with memory_region_allocate_system_memory List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?RGlyayBNw7xsbGVy?= , qemu-devel@nongnu.org Cc: Blue Swirl , Mark Cave-Ayland , Fabien Chouteau 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 > --- > 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