Re: [PATCH RFC 03/11] iommu: Add attach/detach_dev_pasid domain ops

Jason Gunthorpe
2022-03-21T11:53:54Z

On Mon, Mar 21, 2022 at 07:13:49AM +0000, Tian, Kevin wrote:

> /*
> * To keep things simple, SVA currently doesn't support IOMMU groups
> * with more than one device. Existing SVA-capable systems are not
> * affected by the problems that required IOMMU groups (lack of ACS
> * isolation, device ID aliasing and other hardware issues).
> */
> if (iommu_group_device_count(group) != 1)
> goto out_unlock;
>
> btw I didn't see any safeguard on above assumption in device hotplug path
> to a group which already has SVA enabled...

This is because using device_count is always wrong for these kinds of
tests.

The exclusion needs to be built up from the new owner mechanism. Once
the device is in SVA mode it is the same as having exclusive ownership
against any other probes()

Jason