x86/mm: Fix deadlock between p2m and event channel locks.
authorAndres Lagar-Cavilla <andres@lagarcavilla.org>
Wed, 14 Mar 2012 15:07:40 +0000 (11:07 -0400)
committerAndres Lagar-Cavilla <andres@lagarcavilla.org>
Wed, 14 Mar 2012 15:07:40 +0000 (11:07 -0400)
commit9f3c3bd33a1cb934a5065ff5b3f6cdc319d2bb81
tree6d309f5e456bc499326eb4fa9ffa43c40be9d0d1
parentde0f8c7cc2a266f4ad569e0202464a8870d3a318
x86/mm: Fix deadlock between p2m and event channel locks.

The hvm io emulation code holds the p2m lock for the duration of the
emulation, which may include sending an event to qemu. On a separate path,
map_domain_pirq grabs the event channel and p2m locks in opposite order.

Fix this by ensuring liveness of the ram_gfn used by io emulation, with a
page ref.

Reported-by: "Hao, Xudong" <xudong.hao@intel.com>
Signed-off-by: "Hao, Xudong" <xudong.hao@intel.com>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/hvm/emulate.c