aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/asm-x86/domain.h
diff options
context:
space:
mode:
authorTim Deegan <Tim.Deegan@citrix.com>2011-06-02 13:16:52 +0100
committerTim Deegan <Tim.Deegan@citrix.com>2011-06-02 13:16:52 +0100
commit301493fb027648db6808b66d1ccf849f524b8422 (patch)
tree39e01927adf67c86b6ae5109f77582ab30ff5781 /xen/include/asm-x86/domain.h
parenteed8876543b558c781de64973778170a003508e8 (diff)
downloadxen-301493fb027648db6808b66d1ccf849f524b8422.tar.gz
xen-301493fb027648db6808b66d1ccf849f524b8422.tar.bz2
xen-301493fb027648db6808b66d1ccf849f524b8422.zip
x86/mm: dedup the various copies of the shadow lock functions
Define the lock and unlock functions once, and list all the locks in one place so (a) it's obvious what the locking discipline is and (b) none of the locks are visible to non-mm code. Automatically enforce that these locks never get taken in the wrong order. Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Diffstat (limited to 'xen/include/asm-x86/domain.h')
-rw-r--r--xen/include/asm-x86/domain.h17
1 files changed, 5 insertions, 12 deletions
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 0488e655bb..2879480b0b 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -91,9 +91,8 @@ void hypercall_page_initialise(struct domain *d, void *);
/* shadow paging extension */
/************************************************/
struct shadow_domain {
- spinlock_t lock; /* shadow domain lock */
- int locker; /* processor which holds the lock */
- const char *locker_function; /* Func that took it */
+ mm_lock_t lock; /* shadow domain lock */
+
unsigned int opt_flags; /* runtime tunable optimizations on/off */
struct page_list_head pinned_shadows;
@@ -159,9 +158,7 @@ struct shadow_vcpu {
/* hardware assisted paging */
/************************************************/
struct hap_domain {
- spinlock_t lock;
- int locker;
- const char *locker_function;
+ mm_lock_t lock;
struct page_list_head freelist;
unsigned int total_pages; /* number of pages allocated */
@@ -174,9 +171,7 @@ struct hap_domain {
/************************************************/
struct log_dirty_domain {
/* log-dirty lock */
- spinlock_t lock;
- int locker; /* processor that holds the lock */
- const char *locker_function; /* func that took it */
+ mm_lock_t lock;
/* log-dirty radix tree to record dirty pages */
mfn_t top;
@@ -280,9 +275,7 @@ struct arch_domain
/* nestedhvm: translate l2 guest physical to host physical */
struct p2m_domain *nested_p2m[MAX_NESTEDP2M];
- spinlock_t nested_p2m_lock;
- int nested_p2m_locker;
- const char *nested_p2m_function;
+ mm_lock_t nested_p2m_lock;
/* NB. protected by d->event_lock and by irq_desc[irq].lock */
struct radix_tree_root irq_pirq;