x86/hvm: explicitly mark ioreq server pages dirty
authorPaul Durrant <paul.durrant@citrix.com>
Tue, 10 Feb 2015 12:29:51 +0000 (13:29 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 10 Feb 2015 12:29:51 +0000 (13:29 +0100)
...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 <paul.durrant@citrix.com>
xen/arch/x86/hvm/hvm.c

index 952f9653d8342800b1e90b0c1a6f597e14bd82c4..636876804d1a1202facce68038ca92172b1be4f5 100644 (file)
@@ -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(