]> git.ipfire.org Git - thirdparty/qemu.git/commit
virtio-iommu: Use recursive lock to avoid deadlock
authorZhenzhong Duan <zhenzhong.duan@intel.com>
Mon, 13 Jun 2022 06:10:09 +0000 (14:10 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 16 Jun 2022 16:54:58 +0000 (12:54 -0400)
commit08f2030a2e46f1e93d186b3a683e5caef1df562b
tree9fbf3e5b3fa30a34c0994673e596754b53aca7a1
parent90519b90539b16258d1d52b908b199f44877dc18
virtio-iommu: Use recursive lock to avoid deadlock

When switching address space with mutex lock hold, mapping will be
replayed for assigned device. This will trigger relock deadlock.

Also release the mutex resource in unrealize routine.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Message-Id: <20220613061010.2674054-3-zhenzhong.duan@intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio/virtio-iommu.c
include/hw/virtio/virtio-iommu.h