ia64/xen-unstable
changeset 13875:3fbe12560ffe
[XEN] When removing pages, drop shadow refs before complaining about refcount.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
author | Tim Deegan <Tim.Deegan@xensource.com> |
---|---|
date | Thu Feb 08 10:44:53 2007 +0000 (2007-02-08) |
parents | 6524e02edbeb |
children | b50350fb0fde 6e74932c9a64 |
files | xen/common/memory.c xen/include/asm-x86/shadow.h |
line diff
1.1 --- a/xen/common/memory.c Wed Feb 07 16:53:01 2007 -0800 1.2 +++ b/xen/common/memory.c Thu Feb 08 10:44:53 2007 +0000 1.3 @@ -175,11 +175,13 @@ int guest_remove_page(struct domain *d, 1.4 1.5 if ( unlikely(!page_is_removable(page)) ) 1.6 { 1.7 + shadow_drop_references(d, page); 1.8 /* We'll make this a guest-visible error in future, so take heed! */ 1.9 - gdprintk(XENLOG_INFO, "Dom%d freeing in-use page %lx (pseudophys %lx):" 1.10 - " count=%lx type=%lx\n", 1.11 - d->domain_id, mfn, get_gpfn_from_mfn(mfn), 1.12 - (unsigned long)page->count_info, page->u.inuse.type_info); 1.13 + if ( !page_is_removable(page) ) 1.14 + gdprintk(XENLOG_INFO, "Dom%d freeing in-use page %lx " 1.15 + "(pseudophys %lx): count=%lx type=%lx\n", 1.16 + d->domain_id, mfn, get_gpfn_from_mfn(mfn), 1.17 + (unsigned long)page->count_info, page->u.inuse.type_info); 1.18 } 1.19 1.20 guest_physmap_remove_page(d, gmfn, mfn);
2.1 --- a/xen/include/asm-x86/shadow.h Wed Feb 07 16:53:01 2007 -0800 2.2 +++ b/xen/include/asm-x86/shadow.h Thu Feb 08 10:44:53 2007 +0000 2.3 @@ -355,8 +355,9 @@ int sh_remove_all_mappings(struct vcpu * 2.4 static inline void 2.5 shadow_drop_references(struct domain *d, struct page_info *p) 2.6 { 2.7 - /* See the comment about locking in sh_remove_all_mappings */ 2.8 - sh_remove_all_mappings(d->vcpu[0], _mfn(page_to_mfn(p))); 2.9 + if ( unlikely(shadow_mode_enabled(d)) ) 2.10 + /* See the comment about locking in sh_remove_all_mappings */ 2.11 + sh_remove_all_mappings(d->vcpu[0], _mfn(page_to_mfn(p))); 2.12 } 2.13 2.14 /* Remove all shadows of the guest mfn. */