Patchwork exec, Fix guest memory access.

login
register
mail settings
Submitter Anthony PERARD
Date March 19, 2012, 3:54 p.m.
Message ID <1332172474-17567-1-git-send-email-anthony.perard@citrix.com>
Download mbox | patch
Permalink /patch/147564/
State New
Headers show

Comments

Anthony PERARD - March 19, 2012, 3:54 p.m.
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>

---
 exec.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Avi Kivity - March 19, 2012, 5:13 p.m.
On 03/19/2012 05:54 PM, Anthony PERARD wrote:
> 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.
>

Thanks, applied to memory/urgent, will push shortly.

Patch

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);
             }