[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH 3/3] hw/arm/aspeed_soc: don't use vmstate_register
From: |
Cédric Le Goater |
Subject: |
Re: [Qemu-arm] [PATCH 3/3] hw/arm/aspeed_soc: don't use vmstate_register_ram_global for SRAM |
Date: |
Sat, 21 Apr 2018 11:07:21 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 |
On 04/20/2018 02:48 PM, Peter Maydell wrote:
> Currently we use vmstate_register_ram_global() for the SRAM;
> this is not a good idea for devices, because it means that
> you can only ever create one instance of the device, as
> the second instance would get a RAM block name clash.
> Instead, use memory_region_init_ram(), which automatically
> registers the RAM block with a local-to-the-device name.
>
> Note that this is a cross-version migration compatibility break
> for the "palmetto-bmc", "ast2500-evb" and "romulus-bmc" machines.
>
> Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Cédric Le Goater <address@hidden>
Tested-by: Cédric Le Goater <address@hidden>
On palmetto, romulus and ast2500-evb boards
Thanks
C.> ---
> hw/arm/aspeed_soc.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c
> index 30d25f8b06..407f10d0d4 100644
> --- a/hw/arm/aspeed_soc.c
> +++ b/hw/arm/aspeed_soc.c
> @@ -186,13 +186,12 @@ static void aspeed_soc_realize(DeviceState *dev, Error
> **errp)
> }
>
> /* SRAM */
> - memory_region_init_ram_nomigrate(&s->sram, OBJECT(dev), "aspeed.sram",
> + memory_region_init_ram(&s->sram, OBJECT(dev), "aspeed.sram",
> sc->info->sram_size, &err);
> if (err) {
> error_propagate(errp, err);
> return;
> }
> - vmstate_register_ram_global(&s->sram);
> memory_region_add_subregion(get_system_memory(), ASPEED_SOC_SRAM_BASE,
> &s->sram);
>
>