xen/arm: p2m: Add an ASSERT to check that p2m lock is taken in __p2m_lookup
authorJulien Grall <julien.grall@citrix.com>
Mon, 27 Apr 2015 14:58:33 +0000 (15:58 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 5 May 2015 11:32:52 +0000 (12:32 +0100)
__p2m_lookup should be called with the p2m lock taken. Add an ASSERT in
order to catch wrong caller in debug build.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/p2m.c

index 8dfee246b873f4269a16dae4fae49f907532c27c..65efa949e564c68525c8684794cf3fef1db11420 100644 (file)
@@ -160,6 +160,7 @@ static paddr_t __p2m_lookup(struct domain *d, paddr_t paddr, p2m_type_t *t)
     p2m_type_t _t;
     unsigned int level, root_table;
 
+    ASSERT(spin_is_locked(&p2m->lock));
     BUILD_BUG_ON(THIRD_MASK != PAGE_MASK);
 
     /* Allow t to be NULL */