If dom0 alters the p2m of a domain that's being destroyed, we can end
up doing a remove-all-shadows after the shadow hash table has been
freed. Since no hash table implies no shadows, just return
immediately.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
struct domain *d = v->domain;
struct page_info *x;
- /* Say we're here, to stop hash-lookups reordering the chains */
ASSERT(shadow_locked_by_me(d));
+
+ /* Can be called via p2m code &c after shadow teardown. */
+ if ( unlikely(!d->arch.paging.shadow.hash_table) )
+ return;
+
+ /* Say we're here, to stop hash-lookups reordering the chains */
ASSERT(d->arch.paging.shadow.hash_walking == 0);
d->arch.paging.shadow.hash_walking = 1;