Skip to contentSkip to conversation

xen/arm: p2m: Add an ASSERT to check that p2m lock is taken in __p2m_lookup

PATCH In review Julien Grall 2 participants 2 messages Apr 27, 2015 – May 5, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/arm: p2m: Add an ASSERT to check that p2m lock is taken in __p2m_lookup

__p2m_lookup should be called with the p2m lock taken. Add an ASSERT in order to catch wrong caller in debug build.

---
 xen/arch/arm/p2m.c | 1 +
 1 file changed, 1 insertion(+)
xen/arch/arm/p2m.c +1 -0
index 8dfee24..65efa94 100644
@@ -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 */
Signature · 1 line
2.1.4