From: Paul Durrant Subject: [PATCH] x86/hvm: explicitly mark ioreq server pages dirty... Date: Fri, 6 Feb 2015 15:57:20 +0000 Message-ID: <1423238240-5822-1-git-send-email-paul.durrant@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Andrew Cooper , Stefano Stabellini , Paul Durrant , Keir Fraser , Jan Beulich List-Id: xen-devel@lists.xenproject.org ...when they are added back into the guest physmap, when an ioreq server is disabled. If this is not done then the pages are missed during migration, causing ioreq server creation to fail on the remote end. This problem only manifests if the ioreq server is non-default because in the default case the pages are never removed from the guest physmap. Signed-off-by: Paul Durrant Cc: Keir Fraser Cc: Jan Beulich Cc: Andrew Cooper Cc: Stefano Stabellini --- xen/arch/x86/hvm/hvm.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 2e78d1b..ab0a450 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -543,9 +543,16 @@ static void hvm_remove_ioreq_gmfn( static int hvm_add_ioreq_gmfn( struct domain *d, struct hvm_ioreq_page *iorp) { + int rc; + clear_page(iorp->va); - return guest_physmap_add_page(d, iorp->gmfn, - page_to_mfn(iorp->page), 0); + + rc = guest_physmap_add_page(d, iorp->gmfn, + page_to_mfn(iorp->page), 0); + if (rc == 0) + paging_mark_dirty(d, page_to_mfn(iorp->page)); + + return rc; } static int hvm_print_line( -- 1.7.10.4