[PATCH] iommu: Remove functions that support private domain

Joerg Roedel joro at 8bytes.org
Fri May 15 15:46:16 UTC 2020


On Fri, May 15, 2020 at 08:55:42PM +0800, Lu Baolu wrote:
> It seems that we can do like this:
> 
> [1] mutex_lock(&group->lock)
> [2] for_each_group_device(device_lock())
> [3] if (for_each_group_device(!device_is_bound()))
> 	change_default_domain()
> [4] for_each_group_device_reverse(device_unlock())
> [5] mutex_unlock(&group->lock)

The problem here is that I am pretty sure we also have:

	device_lock() /* from device/driver core code */
	-> bus_notifier()
	  -> iommu_bus_notifier()
	    -> ...
	      -> mutex_lock(&group->lock)

Which would cause lock-inversion with the above code.


	Joerg


More information about the iommu mailing list