exec: fix guest memory access for Xen
authorAnthony PERARD <anthony.perard@citrix.com>
Mon, 19 Mar 2012 15:54:34 +0000 (15:54 +0000)
committerAvi Kivity <avi@redhat.com>
Mon, 19 Mar 2012 17:13:30 +0000 (19:13 +0200)
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 <anthony.perard@citrix.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
exec.c

diff --git a/exec.c b/exec.c
index a3818ffeb705e6750975849dd77b65f7748af5ee..265e89560335e9cb1c55205467a36314cd4f1e16 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -3856,8 +3856,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);
             }