mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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:
1 parent
daf20794ed
commit
ad6c917d7d
1 file changed
+2
-2
@@ -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)) )
|
||||
|
||||