Skip to contentSkip to conversation

memory: fix rom_device I/O mode

PATCH New Avi Kivity 1 participant 1 message Aug 29, 2011

lore
Share & tools
lore

Avi Kivity

author
#0 lore raw

PATCH 1/1 memory: fix rom_device I/O mode

When adding a rom_device in I/O mode, we incorrectly masked off the low bits, resulting in a pure RAM map. Fix my masking off the high bits and IO_MEM_ROMD, yielding a pure I/O map.

---
 memory.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
memory.c +1 -1
index 1491a39..eb31fa8 100644
@@ -304,7 +304,7 @@ static void as_memory_range_add(AddressSpace *as, FlatRange *fr)
     }
 
     if (!fr->readable) {
-        phys_offset &= TARGET_PAGE_MASK;
+        phys_offset &= ~TARGET_PAGE_MASK & ~IO_MEM_ROMD;
     }
 
     cpu_register_physical_memory_log(fr->addr.start,
Signature · 1 line
1.7.6.1