aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Deegan <Tim.Deegan@citrix.com>2011-02-16 09:48:05 +0000
committerTim Deegan <Tim.Deegan@citrix.com>2011-02-16 09:48:05 +0000
commitbc6595da1a5cacee189bc83ea972a125f76f65e9 (patch)
tree9f772c9e7dc13c0cf3b5d405ee1fcc5a242cb161
parentb58852fcd8b447ed5bef3a6c7c0476454ade0b16 (diff)
downloadxen-bc6595da1a5cacee189bc83ea972a125f76f65e9.tar.gz
xen-bc6595da1a5cacee189bc83ea972a125f76f65e9.tar.bz2
xen-bc6595da1a5cacee189bc83ea972a125f76f65e9.zip
x86/shadow: unconditionally set the p2m/log-dirty allocation functions.
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>
-rw-r--r--xen/arch/x86/mm/shadow/common.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index dd9a1555ae..5e5f9c16dc 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -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 */