# HG changeset patch # User Tim Deegan # Date 1297690988 0 # Node ID 2af74339b90422fc26ba7aebd7868b1eb802de2f # Parent 20140bcb4c047c5410594b3acc9e8b1f243b8ff9 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 diff -r 20140bcb4c04 -r 2af74339b904 xen/arch/x86/mm/shadow/common.c --- a/xen/arch/x86/mm/shadow/common.c Mon Feb 14 13:40:32 2011 +0000 +++ b/xen/arch/x86/mm/shadow/common.c Mon Feb 14 13:43:08 2011 +0000 @@ -3337,12 +3337,12 @@ static int shadow_one_bit_enable(struct 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 */