CPUPhysMemoryClient: Pass guest physical address not region offset
authorAlex Williamson <alex.williamson@redhat.com>
Tue, 3 May 2011 18:36:46 +0000 (12:36 -0600)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 5 May 2011 13:23:12 +0000 (16:23 +0300)
commitb2bf01e00b7cc2cc87a82900f2dee3c070047f4f
tree845c5a98655a79ff9fb7d969418903020f39c323
parentb55fc5f93572cf5354d33b625f8254a6090950c2
CPUPhysMemoryClient: Pass guest physical address not region offset

When we're trying to get a newly registered phys memory client updated
with the current page mappings, we end up passing the region offset
(a ram_addr_t) as the start address rather than the actual guest
physical memory address (target_phys_addr_t).  If your guest has less
than 3.5G of memory, these are coincidentally the same thing.  If
there's more, the region offset for the memory above 4G starts over
at 0, so the set_memory client will overwrite it's lower memory entries.

Instead, keep track of the guest phsyical address as we're walking the
tables and pass that to the set_memory client.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
exec.c