qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] xen: only track the linear framebuffer


From: Stefano Stabellini
Subject: [Qemu-devel] [PATCH] xen: only track the linear framebuffer
Date: Wed, 15 Jun 2011 17:29:27 +0100
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)

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 <address@hidden>

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;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]