Skip to contentSkip to conversation

mips boston/malta: don't have nomigrate RAM regions

PATCH In review Peter Maydell 4 participants 9 messages Jun 4, 2018 – Jun 15, 2018

lore
Share & tools
lore
#0 lore raw

cover mips boston/malta: don't have nomigrate RAM regions

This patchset fixes a a bug in the MIPS boston and malta boards:
they currently use memory_region_init_rom_nomigrate() to create memory regions for their BIOS/flash, and they don't manually register the MR with vmstate_register_ram() either. This currently means that its contents are migrated, but as a RAM block whose name is the empty string; in future (when a patch which is currently in the outstanding migration tree pull request hits master) it will mean they are not migrated at all. Switch to using memory_region_init_ram() instead, so the memory contents are migrated with a reasonable name.

Note that this is a cross-version migration compatibility break for both machines, but:
(a) migration will break anyway due to the "don't migrate unnamed RAM blocks" patch
(b) neither machine is versioned, so we don't really care about maintaining cross-version migration compatibility AFAIK

thanks
-- PMM

Peter Maydell (2):
hw/mips/boston: don't make flash region 'nomigrate' hw/mips/mips_malta: don't make bios region 'nomigrate'

 hw/mips/boston.c     | 3 +--
 hw/mips/mips_malta.c | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/2 hw/mips/boston: don't make flash region 'nomigrate'

Currently we use memory_region_init_rom_nomigrate() to create the "boston.flash" memory region, and we don't manually register it with vmstate_register_ram(). This currently means that its contents are migrated but as a ram block whose name is the empty string; in future it may mean they are not migrated at all. Use memory_region_init_ram() instead.

Note that this is a a cross-version migration compatibility break for the "boston" machine.

---
 hw/mips/boston.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
hw/mips/boston.c +1 -2
index 5302e5c885..1d136529ad 100644
@@ -471,8 +471,7 @@ static void boston_mach_init(MachineState *machine)
     sysbus_mmio_map_overlap(SYS_BUS_DEVICE(s->cps), 0, 0, 1);
 
     flash =  g_new(MemoryRegion, 1);
-    memory_region_init_rom_nomigrate(flash, NULL,
-                                     "boston.flash", 128 * M_BYTE, &err);
+    memory_region_init_rom(flash, NULL, "boston.flash", 128 * M_BYTE, &err);
     memory_region_add_subregion_overlap(sys_mem, 0x18000000, flash, 0);
 
     ddr = g_new(MemoryRegion, 1);
Signature · 1 line
2.17.1
Reviewed-by on v1 1/2
#2 lore raw

Re: [Qemu-devel] [PATCH 1/2] hw/mips/boston: don't make flash region 'nomigrate'

Quoted 11 lines · Peter Maydell

Currently we use memory_region_init_rom_nomigrate() to create the "boston.flash" memory region, and we don't manually register it with vmstate_register_ram(). This currently means that its contents are migrated but as a ram block whose name is the empty string; in future it may mean they are not migrated at all. Use memory_region_init_ram() instead.

Note that this is a a cross-version migration compatibility break for the "boston" machine.

Thanks,

C.

Quoted 19 lines
---
 hw/mips/boston.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
hw/mips/boston.c +1 -2
index 5302e5c885..1d136529ad 100644
@@ -471,8 +471,7 @@ static void boston_mach_init(MachineState *machine)
     sysbus_mmio_map_overlap(SYS_BUS_DEVICE(s->cps), 0, 0, 1);
 
     flash =  g_new(MemoryRegion, 1);
-    memory_region_init_rom_nomigrate(flash, NULL,
-                                     "boston.flash", 128 * M_BYTE, &err);
+    memory_region_init_rom(flash, NULL, "boston.flash", 128 * M_BYTE, &err);
     memory_region_add_subregion_overlap(sys_mem, 0x18000000, flash, 0);
 
     ddr = g_new(MemoryRegion, 1);
Reviewed-by on v1 1/2
#3 lore raw

Re: [Qemu-devel] [PATCH 1/2] hw/mips/boston: don't make flash region 'nomigrate'

In reply to Peter Maydell
Quoted 11 lines · Peter Maydell

Currently we use memory_region_init_rom_nomigrate() to create the "boston.flash" memory region, and we don't manually register it with vmstate_register_ram(). This currently means that its contents are migrated but as a ram block whose name is the empty string; in future it may mean they are not migrated at all. Use memory_region_init_ram() instead.

Note that this is a a cross-version migration compatibility break for the "boston" machine.

Quoted 19 lines
---
 hw/mips/boston.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
hw/mips/boston.c +1 -2
index 5302e5c885..1d136529ad 100644
@@ -471,8 +471,7 @@ static void boston_mach_init(MachineState *machine)
     sysbus_mmio_map_overlap(SYS_BUS_DEVICE(s->cps), 0, 0, 1);
 
     flash =  g_new(MemoryRegion, 1);
-    memory_region_init_rom_nomigrate(flash, NULL,
-                                     "boston.flash", 128 * M_BYTE, &err);
+    memory_region_init_rom(flash, NULL, "boston.flash", 128 * M_BYTE, &err);
     memory_region_add_subregion_overlap(sys_mem, 0x18000000, flash, 0);
 
     ddr = g_new(MemoryRegion, 1);
#4 lore raw

PATCH 2/2 hw/mips/mips_malta: don't make bios region 'nomigrate'

In reply to Peter Maydell

Currently we use memory_region_init_rom_nomigrate() to create the "bios.1fc" memory region, and we don't manually register it with vmstate_register_ram(). This currently means that its contents are migrated but as a ram block whose name is the empty string; in future it may mean they are not migrated at all. Use memory_region_init_ram() instead.

Note that this is a a cross-version migration compatibility break for the "malta" machine.

---
 hw/mips/mips_malta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/mips/mips_malta.c +1 -1
index af70ecffc0..927944899b 100644
@@ -1153,7 +1153,7 @@ void mips_malta_init(MachineState *machine)
      * handled by an overlapping region as the resulting ROM code subpage
      * regions are not executable.
      */
-    memory_region_init_ram_nomigrate(bios_copy, NULL, "bios.1fc", BIOS_SIZE,
+    memory_region_init_ram(bios_copy, NULL, "bios.1fc", BIOS_SIZE,
                            &error_fatal);
     if (!rom_copy(memory_region_get_ram_ptr(bios_copy),
                   FLASH_ADDRESS, BIOS_SIZE)) {
Signature · 1 line
2.17.1
Reviewed-by on v1 2/2
#5 lore raw

Re: [Qemu-devel] [PATCH 2/2] hw/mips/mips_malta: don't make bios region 'nomigrate'

Quoted 11 lines · Peter Maydell

Currently we use memory_region_init_rom_nomigrate() to create the "bios.1fc" memory region, and we don't manually register it with vmstate_register_ram(). This currently means that its contents are migrated but as a ram block whose name is the empty string; in future it may mean they are not migrated at all. Use memory_region_init_ram() instead.

Note that this is a a cross-version migration compatibility break for the "malta" machine.

Thanks,

C.

Quoted 18 lines
---
 hw/mips/mips_malta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/mips/mips_malta.c +1 -1
index af70ecffc0..927944899b 100644
@@ -1153,7 +1153,7 @@ void mips_malta_init(MachineState *machine)
      * handled by an overlapping region as the resulting ROM code subpage
      * regions are not executable.
      */
-    memory_region_init_ram_nomigrate(bios_copy, NULL, "bios.1fc", BIOS_SIZE,
+    memory_region_init_ram(bios_copy, NULL, "bios.1fc", BIOS_SIZE,
                            &error_fatal);
     if (!rom_copy(memory_region_get_ram_ptr(bios_copy),
                   FLASH_ADDRESS, BIOS_SIZE)) {
Reviewed-by on v1 2/2
#6 lore raw

Re: [Qemu-devel] [PATCH 2/2] hw/mips/mips_malta: don't make bios region 'nomigrate'

In reply to Peter Maydell
Quoted 11 lines · Peter Maydell

Currently we use memory_region_init_rom_nomigrate() to create the "bios.1fc" memory region, and we don't manually register it with vmstate_register_ram(). This currently means that its contents are migrated but as a ram block whose name is the empty string; in future it may mean they are not migrated at all. Use memory_region_init_ram() instead.

Note that this is a a cross-version migration compatibility break for the "malta" machine.

Quoted 18 lines
---
 hw/mips/mips_malta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/mips/mips_malta.c +1 -1
index af70ecffc0..927944899b 100644
@@ -1153,7 +1153,7 @@ void mips_malta_init(MachineState *machine)
      * handled by an overlapping region as the resulting ROM code subpage
      * regions are not executable.
      */
-    memory_region_init_ram_nomigrate(bios_copy, NULL, "bios.1fc", BIOS_SIZE,
+    memory_region_init_ram(bios_copy, NULL, "bios.1fc", BIOS_SIZE,
                            &error_fatal);
     if (!rom_copy(memory_region_get_ram_ptr(bios_copy),
                   FLASH_ADDRESS, BIOS_SIZE)) {
#7 lore raw
In reply to Peter Maydell
Quoted 11 lines · Peter Maydell

This patchset fixes a a bug in the MIPS boston and malta boards:
they currently use memory_region_init_rom_nomigrate() to create memory regions for their BIOS/flash, and they don't manually register the MR with vmstate_register_ram() either. This currently means that its contents are migrated, but as a RAM block whose name is the empty string; in future (when a patch which is currently in the outstanding migration tree pull request hits master) it will mean they are not migrated at all. Switch to using memory_region_init_ram() instead, so the memory contents are migrated with a reasonable name.

Quoted 6 lines

Note that this is a cross-version migration compatibility break for both machines, but:
(a) migration will break anyway due to the "don't migrate unnamed RAM blocks" patch
(b) neither machine is versioned, so we don't really care about maintaining cross-version migration compatibility AFAIK

Any comment from the MIPS maintainers?

thanks
-- PMM

Reviewed-by
#8 lore raw

Hi Peter,

Quoted 19 lines · Peter Maydell
Quoted 11 lines · Peter Maydell

This patchset fixes a a bug in the MIPS boston and malta boards:
they currently use memory_region_init_rom_nomigrate() to create memory regions for their BIOS/flash, and they don't manually register the MR with vmstate_register_ram() either. This currently means that its contents are migrated, but as a RAM block whose name is the empty string; in future (when a patch which is currently in the outstanding migration tree pull request hits master) it will mean they are not migrated at all. Switch to using memory_region_init_ram() instead, so the memory contents are migrated with a reasonable name.

Quoted 6 lines

Note that this is a cross-version migration compatibility break for both machines, but:
(a) migration will break anyway due to the "don't migrate unnamed RAM blocks" patch
(b) neither machine is versioned, so we don't really care about maintaining cross-version migration compatibility AFAIK

Quoted 4 lines

Any comment from the MIPS maintainers?

thanks
-- PMM

FWIW, this looks fine to me for both Boston & Malta:

Thanks,
Paul