diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2006-09-21 10:47:05 +0100 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2006-09-21 10:47:05 +0100 |
commit | e158d6de5b396c08eb9221669e5fc892a680f0a7 (patch) | |
tree | 1c604663a848b87aae57a764807ce898d37530a1 /xen/include/asm-x86/shadow.h | |
parent | ae8b421d2beb085c8820257c0a7f9c4a02a336ba (diff) | |
download | xen-e158d6de5b396c08eb9221669e5fc892a680f0a7.tar.gz xen-e158d6de5b396c08eb9221669e5fc892a680f0a7.tar.bz2 xen-e158d6de5b396c08eb9221669e5fc892a680f0a7.zip |
[XEN] Shadow mode no longer obtains page type references.
This allows the shadow destructor hook in free_page_type()
to work properly.
Also, move mark_dirty() back to alloc/free_page_type(). It
doesn't matter that this happens before the type count is
modified -- bitmap is extracted by the tools with the domain
paused, so these non-blocking paths are atomic from p.o.v of
the tools.
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/include/asm-x86/shadow.h')
-rw-r--r-- | xen/include/asm-x86/shadow.h | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/xen/include/asm-x86/shadow.h b/xen/include/asm-x86/shadow.h index b7c536477a..94a4ff11fd 100644 --- a/xen/include/asm-x86/shadow.h +++ b/xen/include/asm-x86/shadow.h @@ -325,24 +325,19 @@ void shadow_final_teardown(struct domain *d); void sh_do_mark_dirty(struct domain *d, mfn_t gmfn); static inline void mark_dirty(struct domain *d, unsigned long gmfn) { - int caller_locked; - - if ( unlikely(d == NULL) || likely(!shadow_mode_log_dirty(d)) ) + if ( likely(!shadow_mode_log_dirty(d)) ) return; - caller_locked = shadow_lock_is_acquired(d); - if ( !caller_locked ) - shadow_lock(d); + shadow_lock(d); sh_do_mark_dirty(d, _mfn(gmfn)); - if ( !caller_locked ) - shadow_unlock(d); + shadow_unlock(d); } /* Internal version, for when the shadow lock is already held */ static inline void sh_mark_dirty(struct domain *d, mfn_t gmfn) { ASSERT(shadow_lock_is_acquired(d)); - if ( shadow_mode_log_dirty(d) ) + if ( unlikely(shadow_mode_log_dirty(d)) ) sh_do_mark_dirty(d, gmfn); } |