Patchwork memory: fix rom_device I/O mode

login
register
mail settings
Submitter Avi Kivity
Date Aug. 29, 2011, 9 a.m.
Message ID <1314608408-23079-1-git-send-email-avi@redhat.com>
Download mbox | patch
Permalink /patch/112002/
State New
Headers show

Comments

Avi Kivity - Aug. 29, 2011, 9 a.m.
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.

Signed-off-by: Avi Kivity <avi@redhat.com>
---
 memory.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/memory.c b/memory.c
index 1491a39..eb31fa8 100644
--- a/memory.c
+++ b/memory.c
@@ -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,