aboutsummaryrefslogtreecommitdiff
path: root/memory.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2016-03-01 10:44:50 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2016-05-23 16:53:45 +0200
commite4e697940dff612b789b0858270c20a8b680f78d (patch)
treea45241d86e8f4078279d2dfc9ba420eb8f1655b9 /memory.c
parent5b5660adf1fdb61db14ec681b10463b8cba633f1 (diff)
memory: remove unnecessary masking of MemoryRegion ram_addr
mr->ram_block->offset is already aligned to both host and target size (see qemu_ram_alloc_internal). Remove further masking as it is unnecessary. Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'memory.c')
-rw-r--r--memory.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/memory.c b/memory.c
index 9d00dc5e7e..4e3cda8a12 100644
--- a/memory.c
+++ b/memory.c
@@ -1628,7 +1628,7 @@ int memory_region_get_fd(MemoryRegion *mr)
assert(mr->ram_block);
- return qemu_get_ram_fd(memory_region_get_ram_addr(mr) & TARGET_PAGE_MASK);
+ return qemu_get_ram_fd(memory_region_get_ram_addr(mr));
}
void *memory_region_get_ram_ptr(MemoryRegion *mr)
@@ -1642,8 +1642,7 @@ void *memory_region_get_ram_ptr(MemoryRegion *mr)
mr = mr->alias;
}
assert(mr->ram_block);
- ptr = qemu_get_ram_ptr(mr->ram_block,
- memory_region_get_ram_addr(mr) & TARGET_PAGE_MASK);
+ ptr = qemu_get_ram_ptr(mr->ram_block, memory_region_get_ram_addr(mr));
rcu_read_unlock();
return ptr + offset;