Re: [PATCH 05/10] vfio: Use IOMMU_CAP_ENFORCE_CACHE_COHERENCY for vfio_file_enforced_coherent()

2022-11-04 Thread Jason Gunthorpe
On Thu, Nov 03, 2022 at 04:38:16AM +, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Tuesday, November 1, 2022 8:26 PM > > And this: > > > > /* > > * If the device does not have > > IOMMU_CAP_ENFORCE_CACHE_COHERENCY then > > * any domain later attached to it will also

RE: [PATCH 05/10] vfio: Use IOMMU_CAP_ENFORCE_CACHE_COHERENCY for vfio_file_enforced_coherent()

2022-11-02 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Tuesday, November 1, 2022 8:26 PM > And this: > > /* >* If the device does not have > IOMMU_CAP_ENFORCE_CACHE_COHERENCY then >* any domain later attached to it will also not support it. If the cap >* is set then the iommu_domain

Re: [PATCH 05/10] vfio: Use IOMMU_CAP_ENFORCE_CACHE_COHERENCY for vfio_file_enforced_coherent()

2022-11-01 Thread Jason Gunthorpe
On Tue, Nov 01, 2022 at 07:52:23AM +, Tian, Kevin wrote: > > IOMMU_CAP_ENFORCE_CACHE_COHERENCY we know what the > > iommu_domain will be > > capable of without having to create it. Use this to compute > > it's worth noting that the prerequisite is that vfio always enforces > cache coherency

RE: [PATCH 05/10] vfio: Use IOMMU_CAP_ENFORCE_CACHE_COHERENCY for vfio_file_enforced_coherent()

2022-11-01 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, October 26, 2022 2:17 AM > > iommufd doesn't establish the iommu_domains until after the device FD is > opened, even if the container has been set. This design is part of moving > away from the group centric iommu APIs. > > This is fine, except that

[PATCH 05/10] vfio: Use IOMMU_CAP_ENFORCE_CACHE_COHERENCY for vfio_file_enforced_coherent()

2022-10-25 Thread Jason Gunthorpe
iommufd doesn't establish the iommu_domains until after the device FD is opened, even if the container has been set. This design is part of moving away from the group centric iommu APIs. This is fine, except that the normal sequence of establishing the kvm wbindv won't work: group =