xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Alex Bligh <alex@alex.org.uk>
To: xen-devel <xen-devel@lists.xen.org>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Alex Bligh <alex@alex.org.uk>
Subject: [PATCH 4/5] exec, memory: Call to xen_modified_memory.
Date: Wed, 13 Feb 2013 18:33:44 +0000	[thread overview]
Message-ID: <1360780425-19607-5-git-send-email-alex@alex.org.uk> (raw)
In-Reply-To: <1360780425-19607-1-git-send-email-alex@alex.org.uk>

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@alex.org.uk>
---
 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);
+
     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

  parent reply	other threads:[~2013-02-13 18:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-13 18:33 QEMU: Enabling live-migrate on HVM on qemu-xen device model in 4.2 Alex Bligh
2013-02-13 18:33 ` [PATCH 1/5] QMP, Introduce xen-set-global-dirty-log command Alex Bligh
2013-02-13 18:33 ` [PATCH 2/5] xen: Introduce xen_modified_memory Alex Bligh
2013-02-13 18:33 ` [PATCH 3/5] exec: Introduce helper to set dirty flags Alex Bligh
2013-02-13 18:33 ` Alex Bligh [this message]
2013-02-13 18:33 ` [PATCH 5/5] xen: Set the vram dirty when an error occur Alex Bligh
  -- strict thread matches above, loose matches on Subject: below --
2013-01-19 17:56 QEMU: Enabling live-migrate on HVM on qemu-xen device model in 4.2 Alex Bligh
2013-01-19 17:56 ` [PATCH 4/5] exec, memory: Call to xen_modified_memory Alex Bligh
2012-12-21 19:37 [RFC] QEMU: Enabling live-migrate on HVM on qemu-xen device model in 4.2 Alex Bligh
2012-12-21 19:37 ` [PATCH 4/5] exec, memory: Call to xen_modified_memory Alex Bligh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1360780425-19607-5-git-send-email-alex@alex.org.uk \
    --to=alex@alex.org.uk \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).