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>
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 */