From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34290) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9evU-0006XM-Fi for qemu-devel@nongnu.org; Mon, 19 Mar 2012 11:55:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S9ev7-0001zu-9r for qemu-devel@nongnu.org; Mon, 19 Mar 2012 11:55:16 -0400 Received: from smtp.citrix.com ([66.165.176.89]:60538) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9ev7-0001za-52 for qemu-devel@nongnu.org; Mon, 19 Mar 2012 11:54:53 -0400 From: Anthony PERARD Date: Mon, 19 Mar 2012 15:54:34 +0000 Message-ID: <1332172474-17567-1-git-send-email-anthony.perard@citrix.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH] exec, Fix guest memory access. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU-devel , qemu-trivial@nongnu.org Cc: Anthony PERARD , Anthony Liguori , Xen Devel , Avi Kivity , Stefano Stabellini In cpu_physical_memory_rw, a change has been introduced and qemu_get_ram_ptr is no longuer called with the ram addr we want to access, but only with the section address. This patch fixes this. (All other call to qemu_get_ram_ptr are already called with the right address.) This patch fixes Xen guest. Signed-off-by: Anthony PERARD --- exec.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/exec.c b/exec.c index be392e2..be08930 100644 --- a/exec.c +++ b/exec.c @@ -3851,8 +3851,8 @@ void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf, } } else { /* RAM case */ - ptr = qemu_get_ram_ptr(section->mr->ram_addr) - + section_addr(section, addr); + ptr = qemu_get_ram_ptr(section->mr->ram_addr + + section_addr(section, addr)); memcpy(buf, ptr, l); qemu_put_ram_ptr(ptr); } -- tg: (30f51d7..) fix/memory_access (depends on: master)