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

[Xen-ia64-devel] [PATCH][IA64] xencomm: logging a dirty page



Hi Keir,

xencomm_copy_chunk_to() dirties a guest page.
This patch is needed for live-migration on IA64.

Thanks,
Kouya

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>

diff -r f33328217eee xen/arch/ia64/xen/mm.c
--- a/xen/arch/ia64/xen/mm.c    Mon Mar 10 22:51:57 2008 +0000
+++ b/xen/arch/ia64/xen/mm.c    Fri Mar 14 17:53:26 2008 +0900
@@ -2904,6 +2904,15 @@ int is_iomem_page(unsigned long mfn)
     return (!mfn_valid(mfn) || (page_get_owner(mfn_to_page(mfn)) == dom_io));
 }
 
+void
+xencomm_mark_dirty(unsigned long paddr)
+{
+    struct domain *d = current->domain;
+    if (shadow_mode_enabled(d)) {
+        shadow_mark_page_dirty(d, paddr >> PAGE_SHIFT);
+    }
+}
+
 /*
  * Local variables:
  * mode: C
diff -r f33328217eee xen/common/xencomm.c
--- a/xen/common/xencomm.c      Mon Mar 10 22:51:57 2008 +0000
+++ b/xen/common/xencomm.c      Fri Mar 14 17:53:26 2008 +0900
@@ -323,6 +323,7 @@ xencomm_copy_chunk_to(
                (unsigned long)xencomm_vaddr(paddr, page));
 
     memcpy(xencomm_vaddr(paddr, page), (void *)from, len);
+    xencomm_mark_dirty(paddr);
     put_page(page);
 
     return 0;
diff -r f33328217eee xen/include/asm-ia64/config.h
--- a/xen/include/asm-ia64/config.h     Mon Mar 10 22:51:57 2008 +0000
+++ b/xen/include/asm-ia64/config.h     Fri Mar 14 17:53:26 2008 +0900
@@ -291,4 +291,6 @@ struct screen_info { };
 /* Define CONFIG_PRIVIFY to support privified OS (deprecated).  */
 #undef CONFIG_PRIVIFY
 
+#define CONFIG_XENCOMM_LOG_DIRTY 1
+
 #endif /* _IA64_CONFIG_H_ */
diff -r f33328217eee xen/include/xen/xencomm.h
--- a/xen/include/xen/xencomm.h Mon Mar 10 22:51:57 2008 +0000
+++ b/xen/include/xen/xencomm.h Fri Mar 14 17:53:26 2008 +0900
@@ -114,4 +114,12 @@ static inline unsigned long xencomm_inli
     xencomm_copy_from_guest(_d, _s, sizeof(*_d), _off);             \
 })
 
+#ifdef CONFIG_XENCOMM_LOG_DIRTY
+extern void xencomm_mark_dirty(unsigned long paddr);
+#else
+static inline void xencomm_mark_dirty(unsigned long paddr)
+{
+}
+#endif
+
 #endif /* __XENCOMM_H__ */
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel

 


Rackspace

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