]> xenbits.xensource.com Git - people/tklengyel/xen.git/commitdiff
x86/shadow: unconditionally set the p2m/log-dirty allocation functions.
authorTim Deegan <Tim.Deegan@citrix.com>
Wed, 16 Feb 2011 09:48:05 +0000 (09:48 +0000)
committerTim Deegan <Tim.Deegan@citrix.com>
Wed, 16 Feb 2011 09:48:05 +0000 (09:48 +0000)
Otherwise enabling log-dirty mode on a PV guest that already has
a shadow allocation can leave the alloc/free functions pointers NULL,
and later try to dereference them.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen/arch/x86/mm/shadow/common.c

index dd9a1555ae51b5fe7b01fe5ee5d86dd5fd7dda1e..5e5f9c16dce0021603eec123e8a7447270f51292 100644 (file)
@@ -3337,12 +3337,12 @@ static int shadow_one_bit_enable(struct domain *d, u32 mode)
             sh_set_allocation(d, 0, NULL);
             return -ENOMEM;
         }
-
-        /* Allow p2m and log-dirty code to borrow shadow memory */
-        d->arch.paging.alloc_page = shadow_alloc_p2m_page;
-        d->arch.paging.free_page = shadow_free_p2m_page;
     }
 
+    /* Allow p2m and log-dirty code to borrow shadow memory */
+    d->arch.paging.alloc_page = shadow_alloc_p2m_page;
+    d->arch.paging.free_page = shadow_free_p2m_page;
+
     if ( d->arch.paging.mode == 0 )
     {
         /* Init the shadow hash table */