Mailing List Archive

[PATCH 9 of 9] x86/mm: Allow pages typed as log dirty to also be shared
xen/arch/x86/mm/mem_sharing.c | 3 +++
xen/include/asm-x86/p2m.h | 3 ++-
2 files changed, 5 insertions(+), 1 deletions(-)


Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>

diff -r 3489152b3a56 -r 4ee6d40edc2c xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -697,6 +697,9 @@ private_page_found:
/* Update m2p entry */
set_gpfn_from_mfn(mfn_x(page_to_mfn(page)), gfn);

+ /* Now that the gfn<->mfn map is properly established,
+ * marking dirty is feasible */
+ paging_mark_dirty(d, mfn_x(page_to_mfn(page)));
put_gfn(d, gfn);
shr_unlock();
return 0;
diff -r 3489152b3a56 -r 4ee6d40edc2c xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -163,7 +163,8 @@ typedef enum {
/* Shared types */
/* XXX: Sharable types could include p2m_ram_ro too, but we would need to
* reinit the type correctly after fault */
-#define P2M_SHARABLE_TYPES (p2m_to_mask(p2m_ram_rw))
+#define P2M_SHARABLE_TYPES (p2m_to_mask(p2m_ram_rw) \
+ | p2m_to_mask(p2m_ram_logdirty) )
#define P2M_SHARED_TYPES (p2m_to_mask(p2m_ram_shared))

/* Broken type: the frame backing this pfn has failed in hardware

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel