mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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:
1 parent
b58852fcd8
commit
bc6595da1a
1 file changed
+4
-4
@@ -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 */
|
||||
|
||||