[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCHv4 4/5] exec, memory: Call to xen_modified_memory.



On Tue, 19 Feb 2013, Alex Bligh wrote:
> This patch add some calls to xen_modified_memory to notify Xen about dirtybits
> during migration.
> 
> Backport of e226939de5814527a21396903b08c3d0ed989558
> 
> Signed-off-by: Alex Bligh <alex@xxxxxxxxxxx>
>
>  exec.c   |    4 ++++
>  memory.c |    4 ++++
>  2 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/exec.c b/exec.c
> index 511777b..401f9bc 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -2988,6 +2988,9 @@ ram_addr_t qemu_ram_alloc_from_ptr(DeviceState *dev, 
> const char *name,
>      memset(ram_list.phys_dirty + (new_block->offset >> TARGET_PAGE_BITS),
>             0xff, size >> TARGET_PAGE_BITS);
>  
> +    if (xen_enabled())
> +        xen_modified_memory(new_block->offset, size);
> +

e226939de5814527a21396903b08c3d0ed989558 adds two calls to
xen_modified_memory, one in cpu_physical_memory_set_dirty_range, the
other in invalidate_and_set_dirty.

Where does this one come from?

If something is missing you need to backport that patch too, rather than
trying to adapt this patch.
In this case I believe you need to backport
1720aeee72888f80b974c33b6eb39922a0bea992.


>      if (kvm_enabled())
>          kvm_setup_guest_memory(new_block->host, size);
>  
> @@ -3961,6 +3964,7 @@ static void invalidate_and_set_dirty(target_phys_addr_t 
> addr,
>          /* set dirty bit */
>          cpu_physical_memory_set_dirty_flags(addr, (0xff & ~CODE_DIRTY_FLAG));
>      }
> +    xen_modified_memory(addr, length);
>  }
>  
>  void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf,
> diff --git a/memory.c b/memory.c
> index 7c20a07..6e0c596 100644
> --- a/memory.c
> +++ b/memory.c
> @@ -16,6 +16,7 @@
>  #include "ioport.h"
>  #include "bitops.h"
>  #include "kvm.h"
> +#include "hw/xen.h"
>  #include <assert.h>
>  
>  unsigned memory_region_transaction_depth = 0;
> @@ -1065,6 +1066,9 @@ bool memory_region_get_dirty(MemoryRegion *mr, 
> target_phys_addr_t addr,
>  void memory_region_set_dirty(MemoryRegion *mr, target_phys_addr_t addr)
>  {
>      assert(mr->terminates);
> +    if (xen_enabled())
> +        xen_modified_memory((mr->ram_addr + addr) & TARGET_PAGE_MASK,
> +                            TARGET_PAGE_SIZE);
>      return cpu_physical_memory_set_dirty(mr->ram_addr + addr);
>  }
>  
> -- 
> 1.7.4.1
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.