x86/mm: Fix p2m teardown locking

Holding the p2m lock during a p2m teardown, while unsharing entries pointing to
shared frames, causes a locking inversion and deadlock panic.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
This commit is contained in:
Andres Lagar-Cavilla committed 2012-01-26 13:21:27 +00:00
1 parent daf20794ed
commit ad6c917d7d
1 file changed
+2 -2
+2 -2
View File
@@ -343,8 +343,6 @@ void p2m_teardown(struct p2m_domain *p2m)
if (p2m == NULL)
return;
p2m_lock(p2m);
#ifdef __x86_64__
for ( gfn=0; gfn < p2m->max_mapped_pfn; gfn++ )
{
@@ -358,6 +356,8 @@ void p2m_teardown(struct p2m_domain *p2m)
}
#endif
p2m_lock(p2m);
p2m->phys_table = pagetable_null();
while ( (pg = page_list_remove_head(&p2m->pages)) )
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.