From: Andres Lagar-Cavilla Subject: [PATCH 9 of 9] x86/mm: Allow pages typed as log dirty to also be shared Date: Tue, 29 Nov 2011 15:21:46 -0500 Message-ID: <4ee6d40edc2cc6592450.1322598106@xdev.gridcentric.ca> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: ian.campbell@citrix.com, andres@gridcentric.ca, tim@xen.org, keir.xen@gmail.com, JBeulich@suse.com, ian.jackson@citrix.com, adin@gridcentric.ca List-Id: xen-devel@lists.xenproject.org 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 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