]> git.ipfire.org Git - thirdparty/qemu.git/commit
intel_iommu: Take locks when looking for and creating address spaces
authorCLEMENT MATHIEU--DRIF <clement.mathieu--drif@eviden.com>
Wed, 30 Apr 2025 12:48:06 +0000 (12:48 +0000)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 14 May 2025 11:45:51 +0000 (07:45 -0400)
commit1b85dff5f0be30ddbcb7edbd3c084c9c5ee351ca
tree11ca344f5104cd0e6a298b2a005bea1c7e714ca1
parentb1c84782bfddeaa0070f5ae57ac2e4e3992f9f19
intel_iommu: Take locks when looking for and creating address spaces

vtd_find_add_as can be called by multiple threads which leads to a race
condition. Taking the IOMMU lock ensures we avoid such a race.
Moreover we also need to take the bql to avoid an assert to fail in
memory_region_add_subregion_overlap when actually allocating a new
address space.

Signed-off-by: Clement Mathieu--Drif <clement.mathieu--drif@eviden.com>
Message-Id: <20250430124750.240412-3-clement.mathieu--drif@eviden.com>
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/i386/intel_iommu.c