提交 2774c6d0 编写于 作者: A Avi Kivity

Fix wrong region_offset when overlaying a page with another

cpu_register_physical_memory_log() does not update region_offset
if a page was previously registered for the same address.  This
could cause mmio accesses going to the wrong place, by using the
old region_offset.
Signed-off-by: NAvi Kivity <avi@redhat.com>
Acked-by: NAndreas Färber <afaerber@suse.de>
Reviewed-by: NRichard Henderson <rth@twiddle.net>
上级 26a83ad0
...@@ -2542,6 +2542,7 @@ void cpu_register_physical_memory_log(target_phys_addr_t start_addr, ...@@ -2542,6 +2542,7 @@ void cpu_register_physical_memory_log(target_phys_addr_t start_addr,
p->region_offset = 0; p->region_offset = 0;
} else { } else {
p->phys_offset = phys_offset; p->phys_offset = phys_offset;
p->region_offset = region_offset;
if ((phys_offset & ~TARGET_PAGE_MASK) <= IO_MEM_ROM || if ((phys_offset & ~TARGET_PAGE_MASK) <= IO_MEM_ROM ||
(phys_offset & IO_MEM_ROMD)) (phys_offset & IO_MEM_ROMD))
phys_offset += TARGET_PAGE_SIZE; phys_offset += TARGET_PAGE_SIZE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册