summaryrefslogtreecommitdiffstats
path: root/include/hw/virtio
diff options
context:
space:
mode:
authorZhenzhong Duan2022-06-13 08:10:09 +0200
committerMichael S. Tsirkin2022-06-16 18:54:58 +0200
commit08f2030a2e46f1e93d186b3a683e5caef1df562b (patch)
tree9fbf3e5b3fa30a34c0994673e596754b53aca7a1 /include/hw/virtio
parentvirtio-iommu: Add bypass mode support to assigned device (diff)
downloadqemu-08f2030a2e46f1e93d186b3a683e5caef1df562b.tar.gz
qemu-08f2030a2e46f1e93d186b3a683e5caef1df562b.tar.xz
qemu-08f2030a2e46f1e93d186b3a683e5caef1df562b.zip
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>
Diffstat (limited to 'include/hw/virtio')
-rw-r--r--include/hw/virtio/virtio-iommu.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/hw/virtio/virtio-iommu.h b/include/hw/virtio/virtio-iommu.h
index 102eeefa73..2ad5ee320b 100644
--- a/include/hw/virtio/virtio-iommu.h
+++ b/include/hw/virtio/virtio-iommu.h
@@ -58,7 +58,7 @@ struct VirtIOIOMMU {
ReservedRegion *reserved_regions;
uint32_t nb_reserved_regions;
GTree *domains;
- QemuMutex mutex;
+ QemuRecMutex mutex;
GTree *endpoints;
bool boot_bypass;
};