From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46322) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RhP82-0003sL-5H for qemu-devel@nongnu.org; Sun, 01 Jan 2012 12:23:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RhP81-0004rQ-7f for qemu-devel@nongnu.org; Sun, 01 Jan 2012 12:23:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:27786) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RhP80-0004rG-VK for qemu-devel@nongnu.org; Sun, 01 Jan 2012 12:23:25 -0500 From: Avi Kivity Date: Sun, 1 Jan 2012 19:23:11 +0200 Message-Id: <1325438591-7355-1-git-send-email-avi@redhat.com> Subject: [Qemu-devel] [PATCH] Fix wrong region_offset when overlaying a page with another List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori , qemu-devel@nongnu.org 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: Avi Kivity --- Once qemu-test is merged, remind me to post a testlet for this. exec.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/exec.c b/exec.c index 8a3f621..c366835 100644 --- a/exec.c +++ b/exec.c @@ -2542,6 +2542,7 @@ void cpu_register_physical_memory_log(target_phys_addr_t start_addr, p->region_offset = 0; } else { p->phys_offset = phys_offset; + p->region_offset = region_offset; if ((phys_offset & ~TARGET_PAGE_MASK) <= IO_MEM_ROM || (phys_offset & IO_MEM_ROMD)) phys_offset += TARGET_PAGE_SIZE; -- 1.7.7.1