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>
This commit is contained in:
Tim Deegan committed 2011-02-16 09:48:05 +00:00
1 parent b58852fcd8
commit bc6595da1a
1 file changed
+4 -4
+4 -4
View 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 */
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.