Skip to contentSkip to conversation

Xen VGA dirtybit support

PATCH Applied [email protected] 2 participants 4 messages May 24, 2011 – May 27, 2011

lore
Share & tools
lore
#0 lore raw

v3 cover Xen VGA dirtybit support

From: Anthony PERARD <[email protected]>

Hi,

This two patches provides the support for sync dirty bitmap, especially useful for the VGA output. The sync dirty bitmap is not provided for Xen 3.3.

Change v2 -> v3:
* use the new log_dirty parameter of set_memory clients.
* fix some mistakes related to the use of TARGET_PAGE_MASK and TARGET_PAGE_ALIGN macro in xen_client_set_memory.
* The patch that provide log_start/log_stop in CPUPhysMemoryClient as already been applied.

Change v1 -> v2:
* Introduce a patch to put log_start/log_stop in CPUPhysMemoryClient;
* There are now only one function to get/check for old physmapping

    (get_physmapping);
  * The function xen_sync_dirty_bitmap only do a sync on range that are
    physmapped and only on one range;

* Physmapping list and CPUPhysMemoryClient is now in XenIOState structure;
* Introduce log_for_dirtybit that hold the range for dirty bit tracking.

Anthony PERARD (2):
xen: Add xc_domain_add_to_physmap to xen_interface.
xen: Introduce VGA sync dirty bitmap support

 configure       |   29 ++++++-
 hw/xen_common.h |   14 +++
 trace-events    |    1 +
 xen-all.c       |  267 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 310 insertions(+), 1 deletions(-)
Signature · 1 line
1.7.2.5
#1 lore raw

PATCH v3 1/2 xen: Add xc_domain_add_to_physmap to xen_interface.

From: Anthony PERARD <[email protected]>

This function will be used to support sync dirty bitmap.

This come with a check against every Xen release, and special implementation for Xen version that doesn't have this specific call.

This function will not be usable with Xen 3.3 because the behavior is different.

---
 configure       |   29 ++++++++++++++++++++++++++++-
 hw/xen_common.h |   14 ++++++++++++++
 2 files changed, 42 insertions(+), 1 deletions(-)
configure +28 -1
index a318d37..7886d3f 100755
@@ -1206,6 +1206,7 @@ int main(void) {
   xc = xc_interface_open(0, 0, 0);
   xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
   xc_gnttab_open(NULL, 0);
+  xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0);
   return 0;
 }
 EOF
@@ -1224,10 +1225,14 @@ EOF
 # error HVM_MAX_VCPUS not defined
 #endif
 int main(void) {
+  struct xen_add_to_physmap xatp = {
+    .domid = 0, .space = XENMAPSPACE_gmfn, .idx = 0, .gpfn = 0,
+  };
   xs_daemon_open();
   xc_interface_open();
   xc_gnttab_open();
   xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
+  xc_memory_op(0, XENMEM_add_to_physmap, &xatp);
   return 0;
 }
 EOF
@@ -1236,7 +1241,29 @@ EOF
     xen_ctrl_version=400
     xen=yes
 
-  # Xen 3.3.0, 3.4.0
+  # Xen 3.4.0
+  elif (
+      cat > $TMPC <<EOF
+#include <xenctrl.h>
+#include <xs.h>
+int main(void) {
+  struct xen_add_to_physmap xatp = {
+    .domid = 0, .space = XENMAPSPACE_gmfn, .idx = 0, .gpfn = 0,
+  };
+  xs_daemon_open();
+  xc_interface_open();
+  xc_gnttab_open();
+  xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
+  xc_memory_op(0, XENMEM_add_to_physmap, &xatp);
+  return 0;
+}
+EOF
+      compile_prog "" "$xen_libs"
+    ) ; then
+    xen_ctrl_version=340
+    xen=yes
+
+  # Xen 3.3.0
   elif (
       cat > $TMPC <<EOF
 #include <xenctrl.h>
hw/xen_common.h +14 -0
index a1958a0..2c79af6 100644
@@ -71,6 +71,20 @@ static inline int xc_domain_populate_physmap_exact
         (xc_handle, domid, nr_extents, extent_order, mem_flags, extent_start);
 }
 
+static inline int xc_domain_add_to_physmap(int xc_handle, uint32_t domid,
+                                           unsigned int space, unsigned long idx,
+                                           xen_pfn_t gpfn)
+{
+    struct xen_add_to_physmap xatp = {
+        .domid = domid,
+        .space = space,
+        .idx = idx,
+        .gpfn = gpfn,
+    };
+
+    return xc_memory_op(xc_handle, XENMEM_add_to_physmap, &xatp);
+}
+
 
 /* Xen 4.1 */
 #else
Signature · 1 line
1.7.2.5
#2 lore raw

PATCH v3 2/2 xen: Introduce VGA sync dirty bitmap support

In reply to [email protected]

From: Anthony PERARD <[email protected]>

This patch introduces phys memory client for Xen.

Only sync dirty_bitmap and set_memory are actually implemented. migration_log will stay empty for the moment.

Xen can only log one range for bit change, so only the range in the first call will be synced.

---
 trace-events |    1 +
 xen-all.c    |  267 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 268 insertions(+), 0 deletions(-)
trace-events +1 -0
index 385cb00..31875c3 100644
@@ -367,6 +367,7 @@ disable milkymist_vgafb_memory_write(uint32_t addr, uint32_t value) "addr %08x v
 
 # xen-all.c
 disable xen_ram_alloc(unsigned long ram_addr, unsigned long size) "requested: %#lx, size %#lx"
+disable xen_client_set_memory(uint64_t start_addr, unsigned long size, unsigned long phys_offset, bool log_dirty) "%#"PRIx64" size %#lx, offset %#lx, log_dirty %i"
 
 # xen-mapcache.c
 disable qemu_map_cache(uint64_t phys_addr) "want %#"PRIx64""
xen-all.c +267 -0

297 lines not on this page · raw message

Signature · 1 line
1.7.2.5