diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2017-07-07 15:42:53 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2017-07-14 17:59:42 +0100 |
commit | 98a99ce0840991ed28fd4c570ae549c371e89970 (patch) | |
tree | 8e437a7afbf94d498d0579550c0ce6d6d2faed01 /hw/arm | |
parent | 96d851a64b42aea4974f2c25a56cd2a05f34905d (diff) |
hw: Use new memory_region_init_{ram, rom, rom_device}() functions
Use the new functions memory_region_init_{ram,rom,rom_device}()
instead of manually calling the _nomigrate() version and then
vmstate_register_ram_global().
Patch automatically created using coccinelle script:
spatch --in-place -sp_file scripts/coccinelle/memory-region-init-ram.cocci -dir hw
(As it turns out, there are no instances of the rom and
rom_device functions that are caught by this script.)
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1499438577-7674-8-git-send-email-peter.maydell@linaro.org
Diffstat (limited to 'hw/arm')
-rw-r--r-- | hw/arm/exynos4210.c | 6 | ||||
-rw-r--r-- | hw/arm/exynos4_boards.c | 6 | ||||
-rw-r--r-- | hw/arm/fsl-imx25.c | 3 | ||||
-rw-r--r-- | hw/arm/fsl-imx31.c | 3 | ||||
-rw-r--r-- | hw/arm/fsl-imx6.c | 3 | ||||
-rw-r--r-- | hw/arm/mainstone.c | 3 | ||||
-rw-r--r-- | hw/arm/musicpal.c | 3 | ||||
-rw-r--r-- | hw/arm/omap1.c | 3 | ||||
-rw-r--r-- | hw/arm/omap2.c | 3 | ||||
-rw-r--r-- | hw/arm/omap_sx1.c | 8 | ||||
-rw-r--r-- | hw/arm/palm.c | 3 | ||||
-rw-r--r-- | hw/arm/pxa2xx.c | 12 | ||||
-rw-r--r-- | hw/arm/realview.c | 9 | ||||
-rw-r--r-- | hw/arm/spitz.c | 3 | ||||
-rw-r--r-- | hw/arm/stellaris.c | 6 | ||||
-rw-r--r-- | hw/arm/stm32f205_soc.c | 7 | ||||
-rw-r--r-- | hw/arm/tosa.c | 3 | ||||
-rw-r--r-- | hw/arm/vexpress.c | 9 | ||||
-rw-r--r-- | hw/arm/virt.c | 4 | ||||
-rw-r--r-- | hw/arm/xilinx_zynq.c | 3 | ||||
-rw-r--r-- | hw/arm/xlnx-zynqmp.c | 3 |
21 files changed, 35 insertions, 68 deletions
diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c index f9a701d8f4..f9e79f3ebb 100644 --- a/hw/arm/exynos4210.c +++ b/hw/arm/exynos4210.c @@ -279,9 +279,8 @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem) &s->chipid_mem); /* Internal ROM */ - memory_region_init_ram_nomigrate(&s->irom_mem, NULL, "exynos4210.irom", + memory_region_init_ram(&s->irom_mem, NULL, "exynos4210.irom", EXYNOS4210_IROM_SIZE, &error_fatal); - vmstate_register_ram_global(&s->irom_mem); memory_region_set_readonly(&s->irom_mem, true); memory_region_add_subregion(system_mem, EXYNOS4210_IROM_BASE_ADDR, &s->irom_mem); @@ -295,9 +294,8 @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem) &s->irom_alias_mem); /* Internal RAM */ - memory_region_init_ram_nomigrate(&s->iram_mem, NULL, "exynos4210.iram", + memory_region_init_ram(&s->iram_mem, NULL, "exynos4210.iram", EXYNOS4210_IRAM_SIZE, &error_fatal); - vmstate_register_ram_global(&s->iram_mem); memory_region_add_subregion(system_mem, EXYNOS4210_IRAM_BASE_ADDR, &s->iram_mem); diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c index c3b0d2e63a..7c03ed32b7 100644 --- a/hw/arm/exynos4_boards.c +++ b/hw/arm/exynos4_boards.c @@ -110,18 +110,16 @@ static void exynos4_boards_init_ram(Exynos4BoardState *s, unsigned long mem_size = ram_size; if (mem_size > EXYNOS4210_DRAM_MAX_SIZE) { - memory_region_init_ram_nomigrate(&s->dram1_mem, NULL, "exynos4210.dram1", + memory_region_init_ram(&s->dram1_mem, NULL, "exynos4210.dram1", mem_size - EXYNOS4210_DRAM_MAX_SIZE, &error_fatal); - vmstate_register_ram_global(&s->dram1_mem); memory_region_add_subregion(system_mem, EXYNOS4210_DRAM1_BASE_ADDR, &s->dram1_mem); mem_size = EXYNOS4210_DRAM_MAX_SIZE; } - memory_region_init_ram_nomigrate(&s->dram0_mem, NULL, "exynos4210.dram0", mem_size, + memory_region_init_ram(&s->dram0_mem, NULL, "exynos4210.dram0", mem_size, &error_fatal); - vmstate_register_ram_global(&s->dram0_mem); memory_region_add_subregion(system_mem, EXYNOS4210_DRAM0_BASE_ADDR, &s->dram0_mem); } diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl-imx25.c index cebe0ec5e8..8cff3c1f7b 100644 --- a/hw/arm/fsl-imx25.c +++ b/hw/arm/fsl-imx25.c @@ -267,7 +267,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp) &s->rom[1]); /* initialize internal RAM (128 KB) */ - memory_region_init_ram_nomigrate(&s->iram, NULL, "imx25.iram", FSL_IMX25_IRAM_SIZE, + memory_region_init_ram(&s->iram, NULL, "imx25.iram", FSL_IMX25_IRAM_SIZE, &err); if (err) { error_propagate(errp, err); @@ -275,7 +275,6 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp) } memory_region_add_subregion(get_system_memory(), FSL_IMX25_IRAM_ADDR, &s->iram); - vmstate_register_ram_global(&s->iram); /* internal RAM (128 KB) is aliased over 128 MB - 128 KB */ memory_region_init_alias(&s->iram_alias, NULL, "imx25.iram_alias", diff --git a/hw/arm/fsl-imx31.c b/hw/arm/fsl-imx31.c index 6c2823a27f..90278758f9 100644 --- a/hw/arm/fsl-imx31.c +++ b/hw/arm/fsl-imx31.c @@ -239,7 +239,7 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp) &s->rom); /* initialize internal RAM (16 KB) */ - memory_region_init_ram_nomigrate(&s->iram, NULL, "imx31.iram", FSL_IMX31_IRAM_SIZE, + memory_region_init_ram(&s->iram, NULL, "imx31.iram", FSL_IMX31_IRAM_SIZE, &err); if (err) { error_propagate(errp, err); @@ -247,7 +247,6 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp) } memory_region_add_subregion(get_system_memory(), FSL_IMX31_IRAM_ADDR, &s->iram); - vmstate_register_ram_global(&s->iram); /* internal RAM (16 KB) is aliased over 256 MB - 16 KB */ memory_region_init_alias(&s->iram_alias, NULL, "imx31.iram_alias", diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c index e00b2f9f10..576c6631a1 100644 --- a/hw/arm/fsl-imx6.c +++ b/hw/arm/fsl-imx6.c @@ -419,7 +419,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp) &s->caam); /* OCRAM memory */ - memory_region_init_ram_nomigrate(&s->ocram, NULL, "imx6.ocram", FSL_IMX6_OCRAM_SIZE, + memory_region_init_ram(&s->ocram, NULL, "imx6.ocram", FSL_IMX6_OCRAM_SIZE, &err); if (err) { error_propagate(errp, err); @@ -427,7 +427,6 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp) } memory_region_add_subregion(get_system_memory(), FSL_IMX6_OCRAM_ADDR, &s->ocram); - vmstate_register_ram_global(&s->ocram); /* internal OCRAM (256 KB) is aliased over 1 MB */ memory_region_init_alias(&s->ocram_alias, NULL, "imx6.ocram_alias", diff --git a/hw/arm/mainstone.c b/hw/arm/mainstone.c index 4ade8a23eb..fb268e691e 100644 --- a/hw/arm/mainstone.c +++ b/hw/arm/mainstone.c @@ -128,9 +128,8 @@ static void mainstone_common_init(MemoryRegion *address_space_mem, /* Setup CPU & memory */ mpu = pxa270_init(address_space_mem, mainstone_binfo.ram_size, cpu_model); - memory_region_init_ram_nomigrate(rom, NULL, "mainstone.rom", MAINSTONE_ROM, + memory_region_init_ram(rom, NULL, "mainstone.rom", MAINSTONE_ROM, &error_fatal); - vmstate_register_ram_global(rom); memory_region_set_readonly(rom, true); memory_region_add_subregion(address_space_mem, 0, rom); diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c index ee5dfed3a9..7e8ab3184c 100644 --- a/hw/arm/musicpal.c +++ b/hw/arm/musicpal.c @@ -1604,9 +1604,8 @@ static void musicpal_init(MachineState *machine) MP_RAM_DEFAULT_SIZE); memory_region_add_subregion(address_space_mem, 0, ram); - memory_region_init_ram_nomigrate(sram, NULL, "musicpal.sram", MP_SRAM_SIZE, + memory_region_init_ram(sram, NULL, "musicpal.sram", MP_SRAM_SIZE, &error_fatal); - vmstate_register_ram_global(sram); memory_region_add_subregion(address_space_mem, MP_SRAM_BASE, sram); dev = sysbus_create_simple(TYPE_MV88W8618_PIC, MP_PIC_BASE, diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c index f4afb88e68..3d15ff6779 100644 --- a/hw/arm/omap1.c +++ b/hw/arm/omap1.c @@ -3880,9 +3880,8 @@ struct omap_mpu_state_s *omap310_mpu_init(MemoryRegion *system_memory, memory_region_allocate_system_memory(&s->emiff_ram, NULL, "omap1.dram", s->sdram_size); memory_region_add_subregion(system_memory, OMAP_EMIFF_BASE, &s->emiff_ram); - memory_region_init_ram_nomigrate(&s->imif_ram, NULL, "omap1.sram", s->sram_size, + memory_region_init_ram(&s->imif_ram, NULL, "omap1.sram", s->sram_size, &error_fatal); - vmstate_register_ram_global(&s->imif_ram); memory_region_add_subregion(system_memory, OMAP_IMIF_BASE, &s->imif_ram); omap_clkm_init(system_memory, 0xfffece00, 0xe1008000, s); diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c index 504bfe10e1..bbf0b7e188 100644 --- a/hw/arm/omap2.c +++ b/hw/arm/omap2.c @@ -2278,9 +2278,8 @@ struct omap_mpu_state_s *omap2420_mpu_init(MemoryRegion *sysmem, memory_region_allocate_system_memory(&s->sdram, NULL, "omap2.dram", s->sdram_size); memory_region_add_subregion(sysmem, OMAP2_Q2_BASE, &s->sdram); - memory_region_init_ram_nomigrate(&s->sram, NULL, "omap2.sram", s->sram_size, + memory_region_init_ram(&s->sram, NULL, "omap2.sram", s->sram_size, &error_fatal); - vmstate_register_ram_global(&s->sram); memory_region_add_subregion(sysmem, OMAP2_SRAM_BASE, &s->sram); s->l4 = omap_l4_init(sysmem, OMAP2_L4_BASE, 54); diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c index d70c6b60dd..9809106617 100644 --- a/hw/arm/omap_sx1.c +++ b/hw/arm/omap_sx1.c @@ -123,9 +123,8 @@ static void sx1_init(MachineState *machine, const int version) machine->cpu_model); /* External Flash (EMIFS) */ - memory_region_init_ram_nomigrate(flash, NULL, "omap_sx1.flash0-0", flash_size, + memory_region_init_ram(flash, NULL, "omap_sx1.flash0-0", flash_size, &error_fatal); - vmstate_register_ram_global(flash); memory_region_set_readonly(flash, true); memory_region_add_subregion(address_space, OMAP_CS0_BASE, flash); @@ -167,9 +166,8 @@ static void sx1_init(MachineState *machine, const int version) if ((version == 1) && (dinfo = drive_get(IF_PFLASH, 0, fl_idx)) != NULL) { MemoryRegion *flash_1 = g_new(MemoryRegion, 1); - memory_region_init_ram_nomigrate(flash_1, NULL, "omap_sx1.flash1-0", flash1_size, - &error_fatal); - vmstate_register_ram_global(flash_1); + memory_region_init_ram(flash_1, NULL, "omap_sx1.flash1-0", + flash1_size, &error_fatal); memory_region_set_readonly(flash_1, true); memory_region_add_subregion(address_space, OMAP_CS1_BASE, flash_1); diff --git a/hw/arm/palm.c b/hw/arm/palm.c index abacdff582..64cf8ca921 100644 --- a/hw/arm/palm.c +++ b/hw/arm/palm.c @@ -214,9 +214,8 @@ static void palmte_init(MachineState *machine) mpu = omap310_mpu_init(address_space_mem, sdram_size, cpu_model); /* External Flash (EMIFS) */ - memory_region_init_ram_nomigrate(flash, NULL, "palmte.flash", flash_size, + memory_region_init_ram(flash, NULL, "palmte.flash", flash_size, &error_fatal); - vmstate_register_ram_global(flash); memory_region_set_readonly(flash, true); memory_region_add_subregion(address_space_mem, OMAP_CS0_BASE, flash); diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c index 6fcdd36a82..194b0bc808 100644 --- a/hw/arm/pxa2xx.c +++ b/hw/arm/pxa2xx.c @@ -2074,13 +2074,11 @@ PXA2xxState *pxa270_init(MemoryRegion *address_space, s->reset = qemu_allocate_irq(pxa2xx_reset, s, 0); /* SDRAM & Internal Memory Storage */ - memory_region_init_ram_nomigrate(&s->sdram, NULL, "pxa270.sdram", sdram_size, + memory_region_init_ram(&s->sdram, NULL, "pxa270.sdram", sdram_size, &error_fatal); - vmstate_register_ram_global(&s->sdram); memory_region_add_subregion(address_space, PXA2XX_SDRAM_BASE, &s->sdram); - memory_region_init_ram_nomigrate(&s->internal, NULL, "pxa270.internal", 0x40000, + memory_region_init_ram(&s->internal, NULL, "pxa270.internal", 0x40000, &error_fatal); - vmstate_register_ram_global(&s->internal); memory_region_add_subregion(address_space, PXA2XX_INTERNAL_BASE, &s->internal); @@ -2206,13 +2204,11 @@ PXA2xxState *pxa255_init(MemoryRegion *address_space, unsigned int sdram_size) s->reset = qemu_allocate_irq(pxa2xx_reset, s, 0); /* SDRAM & Internal Memory Storage */ - memory_region_init_ram_nomigrate(&s->sdram, NULL, "pxa255.sdram", sdram_size, + memory_region_init_ram(&s->sdram, NULL, "pxa255.sdram", sdram_size, &error_fatal); - vmstate_register_ram_global(&s->sdram); memory_region_add_subregion(address_space, PXA2XX_SDRAM_BASE, &s->sdram); - memory_region_init_ram_nomigrate(&s->internal, NULL, "pxa255.internal", + memory_region_init_ram(&s->internal, NULL, "pxa255.internal", PXA2XX_INTERNAL_SIZE, &error_fatal); - vmstate_register_ram_global(&s->internal); memory_region_add_subregion(address_space, PXA2XX_INTERNAL_BASE, &s->internal); diff --git a/hw/arm/realview.c b/hw/arm/realview.c index a5e8f86e17..76ff5579bc 100644 --- a/hw/arm/realview.c +++ b/hw/arm/realview.c @@ -143,15 +143,13 @@ static void realview_init(MachineState *machine, ram_lo = g_new(MemoryRegion, 1); low_ram_size = ram_size - 0x20000000; ram_size = 0x20000000; - memory_region_init_ram_nomigrate(ram_lo, NULL, "realview.lowmem", low_ram_size, + memory_region_init_ram(ram_lo, NULL, "realview.lowmem", low_ram_size, &error_fatal); - vmstate_register_ram_global(ram_lo); memory_region_add_subregion(sysmem, 0x20000000, ram_lo); } - memory_region_init_ram_nomigrate(ram_hi, NULL, "realview.highmem", ram_size, + memory_region_init_ram(ram_hi, NULL, "realview.highmem", ram_size, &error_fatal); - vmstate_register_ram_global(ram_hi); low_ram_size = ram_size; if (low_ram_size > 0x10000000) low_ram_size = 0x10000000; @@ -345,9 +343,8 @@ static void realview_init(MachineState *machine, startup code. I guess this works on real hardware because the BootROM happens to be in ROM/flash or in memory that isn't clobbered until after Linux boots the secondary CPUs. */ - memory_region_init_ram_nomigrate(ram_hack, NULL, "realview.hack", 0x1000, + memory_region_init_ram(ram_hack, NULL, "realview.hack", 0x1000, &error_fatal); - vmstate_register_ram_global(ram_hack); memory_region_add_subregion(sysmem, SMP_BOOT_ADDR, ram_hack); realview_binfo.ram_size = ram_size; diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c index f89584c9b8..7f588cea21 100644 --- a/hw/arm/spitz.c +++ b/hw/arm/spitz.c @@ -919,8 +919,7 @@ static void spitz_common_init(MachineState *machine, sl_flash_register(mpu, (model == spitz) ? FLASH_128M : FLASH_1024M); - memory_region_init_ram_nomigrate(rom, NULL, "spitz.rom", SPITZ_ROM, &error_fatal); - vmstate_register_ram_global(rom); + memory_region_init_ram(rom, NULL, "spitz.rom", SPITZ_ROM, &error_fatal); memory_region_set_readonly(rom, true); memory_region_add_subregion(address_space_mem, 0, rom); diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index ce23f3680b..408c1a14d3 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -1288,15 +1288,13 @@ static void stellaris_init(const char *kernel_filename, const char *cpu_model, sram_size = ((board->dc0 >> 18) + 1) * 1024; /* Flash programming is done via the SCU, so pretend it is ROM. */ - memory_region_init_ram_nomigrate(flash, NULL, "stellaris.flash", flash_size, + memory_region_init_ram(flash, NULL, "stellaris.flash", flash_size, &error_fatal); - vmstate_register_ram_global(flash); memory_region_set_readonly(flash, true); memory_region_add_subregion(system_memory, 0, flash); - memory_region_init_ram_nomigrate(sram, NULL, "stellaris.sram", sram_size, + memory_region_init_ram(sram, NULL, "stellaris.sram", sram_size, &error_fatal); - vmstate_register_ram_global(sram); memory_region_add_subregion(system_memory, 0x20000000, sram); nvic = armv7m_init(system_memory, flash_size, NUM_IRQ_LINES, diff --git a/hw/arm/stm32f205_soc.c b/hw/arm/stm32f205_soc.c index 2e9dff1a7a..f61e735f0f 100644 --- a/hw/arm/stm32f205_soc.c +++ b/hw/arm/stm32f205_soc.c @@ -95,22 +95,19 @@ static void stm32f205_soc_realize(DeviceState *dev_soc, Error **errp) MemoryRegion *flash = g_new(MemoryRegion, 1); MemoryRegion *flash_alias = g_new(MemoryRegion, 1); - memory_region_init_ram_nomigrate(flash, NULL, "STM32F205.flash", FLASH_SIZE, + memory_region_init_ram(flash, NULL, "STM32F205.flash", FLASH_SIZE, &error_fatal); memory_region_init_alias(flash_alias, NULL, "STM32F205.flash.alias", flash, 0, FLASH_SIZE); - vmstate_register_ram_global(flash); - memory_region_set_readonly(flash, true); memory_region_set_readonly(flash_alias, true); memory_region_add_subregion(system_memory, FLASH_BASE_ADDRESS, flash); memory_region_add_subregion(system_memory, 0, flash_alias); - memory_region_init_ram_nomigrate(sram, NULL, "STM32F205.sram", SRAM_SIZE, + memory_region_init_ram(sram, NULL, "STM32F205.sram", SRAM_SIZE, &error_fatal); - vmstate_register_ram_global(sram); memory_region_add_subregion(system_memory, SRAM_BASE_ADDRESS, sram); armv7m = DEVICE(&s->armv7m); diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c index bfd11537c5..8b757ff6a3 100644 --- a/hw/arm/tosa.c +++ b/hw/arm/tosa.c @@ -234,8 +234,7 @@ static void tosa_init(MachineState *machine) mpu = pxa255_init(address_space_mem, tosa_binfo.ram_size); - memory_region_init_ram_nomigrate(rom, NULL, "tosa.rom", TOSA_ROM, &error_fatal); - vmstate_register_ram_global(rom); + memory_region_init_ram(rom, NULL, "tosa.rom", TOSA_ROM, &error_fatal); memory_region_set_readonly(rom, true); memory_region_add_subregion(address_space_mem, 0, rom); diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index 874d88500e..528c65ddb6 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -390,9 +390,8 @@ static void a15_daughterboard_init(const VexpressMachineState *vms, /* 0x2b060000: SP805 watchdog: not modelled */ /* 0x2b0a0000: PL341 dynamic memory controller: not modelled */ /* 0x2e000000: system SRAM */ - memory_region_init_ram_nomigrate(sram, NULL, "vexpress.a15sram", 0x10000, + memory_region_init_ram(sram, NULL, "vexpress.a15sram", 0x10000, &error_fatal); - vmstate_register_ram_global(sram); memory_region_add_subregion(sysmem, 0x2e000000, sram); /* 0x7ffb0000: DMA330 DMA controller: not modelled */ @@ -673,15 +672,13 @@ static void vexpress_common_init(MachineState *machine) } sram_size = 0x2000000; - memory_region_init_ram_nomigrate(sram, NULL, "vexpress.sram", sram_size, + memory_region_init_ram(sram, NULL, "vexpress.sram", sram_size, &error_fatal); - vmstate_register_ram_global(sram); memory_region_add_subregion(sysmem, map[VE_SRAM], sram); vram_size = 0x800000; - memory_region_init_ram_nomigrate(vram, NULL, "vexpress.vram", vram_size, + memory_region_init_ram(vram, NULL, "vexpress.vram", vram_size, &error_fatal); - vmstate_register_ram_global(vram); memory_region_add_subregion(sysmem, map[VE_VIDEORAM], vram); /* 0x4e000000 LAN9118 Ethernet */ diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 30f010af70..31739d75a3 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1155,8 +1155,8 @@ static void create_secure_ram(VirtMachineState *vms, hwaddr base = vms->memmap[VIRT_SECURE_MEM].base; hwaddr size = vms->memmap[VIRT_SECURE_MEM].size; - memory_region_init_ram_nomigrate(secram, NULL, "virt.secure-ram", size, &error_fatal); - vmstate_register_ram_global(secram); + memory_region_init_ram(secram, NULL, "virt.secure-ram", size, + &error_fatal); memory_region_add_subregion(secure_sysmem, base, secram); nodename = g_strdup_printf("/secram@%" PRIx64, base); diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c index 8ae6535381..6b11a75e67 100644 --- a/hw/arm/xilinx_zynq.c +++ b/hw/arm/xilinx_zynq.c @@ -204,9 +204,8 @@ static void zynq_init(MachineState *machine) memory_region_add_subregion(address_space_mem, 0, ext_ram); /* 256K of on-chip memory */ - memory_region_init_ram_nomigrate(ocm_ram, NULL, "zynq.ocm_ram", 256 << 10, + memory_region_init_ram(ocm_ram, NULL, "zynq.ocm_ram", 256 << 10, &error_fatal); - vmstate_register_ram_global(ocm_ram); memory_region_add_subregion(address_space_mem, 0xFFFC0000, ocm_ram); DriveInfo *dinfo = drive_get(IF_PFLASH, 0, 0); diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c index d6f73d7a52..9eceadbdc8 100644 --- a/hw/arm/xlnx-zynqmp.c +++ b/hw/arm/xlnx-zynqmp.c @@ -226,9 +226,8 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp) for (i = 0; i < XLNX_ZYNQMP_NUM_OCM_BANKS; i++) { char *ocm_name = g_strdup_printf("zynqmp.ocm_ram_bank_%d", i); - memory_region_init_ram_nomigrate(&s->ocm_ram[i], NULL, ocm_name, + memory_region_init_ram(&s->ocm_ram[i], NULL, ocm_name, XLNX_ZYNQMP_OCM_RAM_SIZE, &error_fatal); - vmstate_register_ram_global(&s->ocm_ram[i]); memory_region_add_subregion(get_system_memory(), XLNX_ZYNQMP_OCM_RAM_0_ADDRESS + i * XLNX_ZYNQMP_OCM_RAM_SIZE, |