diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2010-05-26 08:26:13 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2010-05-26 08:26:13 +0100 |
commit | b367b23e7f3dcef953250683f77826d9a6885d66 (patch) | |
tree | 95c622c016675bc9be9ce0a76b0b4fcd40e7f1f3 | |
parent | e8bd7b2d8a0b3becdea25e36c8f96de540906371 (diff) | |
download | xen-b367b23e7f3dcef953250683f77826d9a6885d66.tar.gz xen-b367b23e7f3dcef953250683f77826d9a6885d66.tar.bz2 xen-b367b23e7f3dcef953250683f77826d9a6885d66.zip |
x86 shadow: Avoid remove-all-shadows after shadow teardown
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>
xen-unstable changeset: 21453:5addb6cb16fd
xen-unstable date: Wed May 26 08:01:21 2010 +0100
-rw-r--r-- | xen/arch/x86/mm/shadow/common.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c index 36f92760cf..5c3bede888 100644 --- a/xen/arch/x86/mm/shadow/common.c +++ b/xen/arch/x86/mm/shadow/common.c @@ -2173,8 +2173,13 @@ static void hash_foreach(struct vcpu *v, 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; |