Skip to contentSkip to conversation

Fix vmstate_register_ram() for rom/device regions

PATCH In review Avi Kivity 3 participants 4 messages Jan 8, 2012

lore
Share & tools
lore

Avi Kivity

author
#0 lore raw

PATCH 1/1 Fix vmstate_register_ram() for rom/device regions

rom/device regions have a ram_addr that is composed of both an I/O handler (low bits) and RAM region (high bits); but qemu_ram_set_idstr() excepts just a RAM region. Mask the I/O handler to make it happy.

---
 savevm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
savevm.c +1 -1
index 88c4bd8..80be1ff 100644
@@ -2284,7 +2284,7 @@ void do_info_snapshots(Monitor *mon)
 
 void vmstate_register_ram(MemoryRegion *mr, DeviceState *dev)
 {
-    qemu_ram_set_idstr(memory_region_get_ram_addr(mr),
+    qemu_ram_set_idstr(memory_region_get_ram_addr(mr) & TARGET_PAGE_MASK,
                        memory_region_name(mr), dev);
 }
 
Signature · 1 line
1.7.7.1
Tested-by on v1 1/1
#1 lore raw

Am 08.01.2012 13:31, schrieb Avi Kivity:

Quoted 14 lines

rom/device regions have a ram_addr that is composed of both an I/O handler (low bits) and RAM region (high bits); but qemu_ram_set_idstr() excepts just a RAM region. Mask the I/O handler to make it happy.

---
savevm.c | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
savevm.c +0 -0
index 88c4bd8..80be1ff 100644

savevm.c void do_info_snapshots(Monitor *mon) · line 2290

Quoted 8 lines
savevm.c +1 -1
@@ -2284,7 +2284,7 @@ void do_info_snapshots(Monitor *mon)
 
 void vmstate_register_ram(MemoryRegion *mr, DeviceState *dev)
 {
- qemu_ram_set_idstr(memory_region_get_ram_addr(mr),
+ qemu_ram_set_idstr(memory_region_get_ram_addr(mr) & TARGET_PAGE_MASK,
 memory_region_name(mr), dev);
 }
 

This patch fixes the assertion with flash memory (for example Mips Malta).

#2 lore raw
In reply to Avi Kivity

Am 08.01.2012 13:31, schrieb Avi Kivity:

Quoted 2 lines

rom/device regions have a ram_addr that is composed of both an I/O handler (low bits) and RAM region (high bits); but qemu_ram_set_idstr() excepts just

expects :) - if you can still change it on your branch.

Andreas

Quoted 20 lines

a RAM region. Mask the I/O handler to make it happy.

---
 savevm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
savevm.c +1 -1
index 88c4bd8..80be1ff 100644
@@ -2284,7 +2284,7 @@ void do_info_snapshots(Monitor *mon)
 
 void vmstate_register_ram(MemoryRegion *mr, DeviceState *dev)
 {
-    qemu_ram_set_idstr(memory_region_get_ram_addr(mr),
+    qemu_ram_set_idstr(memory_region_get_ram_addr(mr) & TARGET_PAGE_MASK,
                        memory_region_name(mr), dev);
 }
 
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
author
#3 lore raw
Quoted 6 lines · Andreas Färber

Am 08.01.2012 13:31, schrieb Avi Kivity:

Quoted 2 lines

rom/device regions have a ram_addr that is composed of both an I/O handler (low bits) and RAM region (high bits); but qemu_ram_set_idstr() excepts just

expects :) - if you can still change it on your branch.

Did so, hopefully Anthony will see the updated ref.

Signature · 1 line
error compiling committee.c: too many arguments to function