Re: [PATCH v3 1/4] iommu: Introduce device_iommu_capable()

Christoph Hellwig
2022-04-06T07:13:10Z

On Tue, Apr 05, 2022 at 11:41:01AM +0100, Robin Murphy wrote:
> iommu_capable() only really works for systems where all IOMMU instances
> are completely homogeneous, and all devices are IOMMU-mapped. Implement
> the new variant which can give an accurate answer for whichever device
> the caller is actually interested in.
>
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
> ---
>
> v3: New patch; now that the dev_iommu_ops() work has landed we can go
> straight to a proper implementation. Also s/dev/device/ to match
> the precedent of device_iommu_mapped() for the public API.

I'm a little worrited about a method with a parameter than can be
NULL.

Also usnic, vmd, and vdpa really want to use your new
device_iommu_capable as they check based on a device. Just VFIO
is special as usual..