Patchwork xen: only track the linear framebuffer

login
register
mail settings
Submitter Stefano Stabellini
Date June 15, 2011, 4:29 p.m.
Message ID <alpine.DEB.2.00.1106151728230.12963@kaball-desktop>
Download mbox | patch
Permalink /patch/100554/
State New
Headers show

Comments

Stefano Stabellini - June 15, 2011, 4:29 p.m.
Xen can only do dirty bit tracking for one memory region, so we should
explicitly avoid trying to track anything but the vga vram region.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Patch

diff --git a/xen-all.c b/xen-all.c
index 9a5c3ec..fa1d2e1 100644
--- a/xen-all.c
+++ b/xen-all.c
@@ -214,6 +214,7 @@  static int xen_add_to_physmap(XenIOState *state,
     unsigned long i = 0;
     int rc = 0;
     XenPhysmap *physmap = NULL;
+    RAMBlock *block;
 
     if (get_physmapping(state, start_addr, size)) {
         return 0;
@@ -221,7 +222,19 @@  static int xen_add_to_physmap(XenIOState *state,
     if (size <= 0) {
         return -1;
     }
+    /* Xen can only handle a single dirty log region for now and we want
+     * the linear framebuffer to be that region.
+     * Avoid tracking any regions that is not videoram and avoid tracking
+     * the legacy vga region. */
+    QLIST_FOREACH(block, &ram_list.blocks, next) {
+        if (!strcmp(block->idstr, "vga.vram") && block->offset == phys_offset
+                && start_addr > 0xbffff) {
+            goto go_physmap;
+        }
+    }
+    return -1;
 
+go_physmap:
     DPRINTF("mapping vram to %llx - %llx, from %llx\n", start_addr, start_addr + size, phys_offset);
     for (i = 0; i < size >> TARGET_PAGE_BITS; i++) {
         unsigned long idx = (phys_offset >> TARGET_PAGE_BITS) + i;