Re: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-04-30 Thread David Gibson
On Fri, Apr 29, 2022 at 09:54:42AM -0300, Jason Gunthorpe wrote: > On Fri, Apr 29, 2022 at 04:00:14PM +1000, David Gibson wrote: > > > But I don't have a use case in mind? The simplified things I know > > > about want to attach their devices then allocate valid IOVA, they > > > don't really have a

Re: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-04-29 Thread Jason Gunthorpe via iommu
On Fri, Apr 29, 2022 at 04:00:14PM +1000, David Gibson wrote: > > But I don't have a use case in mind? The simplified things I know > > about want to attach their devices then allocate valid IOVA, they > > don't really have a notion about what IOVA regions they are willing to > > accept, or necessa

Re: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-04-28 Thread David Gibson
On Thu, Apr 28, 2022 at 11:22:58AM -0300, Jason Gunthorpe wrote: > On Thu, Apr 28, 2022 at 03:58:30PM +1000, David Gibson wrote: > > On Thu, Mar 31, 2022 at 09:58:41AM -0300, Jason Gunthorpe wrote: > > > On Thu, Mar 31, 2022 at 03:36:29PM +1100, David Gibson wrote: > > > > > > > > +/** > > > > > +

Re: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-04-28 Thread Jason Gunthorpe via iommu
On Thu, Apr 28, 2022 at 03:58:30PM +1000, David Gibson wrote: > On Thu, Mar 31, 2022 at 09:58:41AM -0300, Jason Gunthorpe wrote: > > On Thu, Mar 31, 2022 at 03:36:29PM +1100, David Gibson wrote: > > > > > > +/** > > > > + * struct iommu_ioas_iova_ranges - ioctl(IOMMU_IOAS_IOVA_RANGES) > > > > + *

Re: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-04-27 Thread David Gibson
On Thu, Mar 31, 2022 at 09:58:41AM -0300, Jason Gunthorpe wrote: > On Thu, Mar 31, 2022 at 03:36:29PM +1100, David Gibson wrote: > > > > +/** > > > + * struct iommu_ioas_iova_ranges - ioctl(IOMMU_IOAS_IOVA_RANGES) > > > + * @size: sizeof(struct iommu_ioas_iova_ranges) > > > + * @ioas_id: IOAS ID t

Re: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-04-01 Thread Yi Liu
On 2022/3/31 20:59, Jason Gunthorpe wrote: On Wed, Mar 30, 2022 at 09:35:52PM +0800, Yi Liu wrote: +/** + * struct iommu_ioas_copy - ioctl(IOMMU_IOAS_COPY) + * @size: sizeof(struct iommu_ioas_copy) + * @flags: Combination of enum iommufd_ioas_map_flags + * @dst_ioas_id: IOAS ID to change the

Re: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-03-31 Thread Jason Gunthorpe via iommu
On Wed, Mar 30, 2022 at 09:35:52PM +0800, Yi Liu wrote: > > +/** > > + * struct iommu_ioas_copy - ioctl(IOMMU_IOAS_COPY) > > + * @size: sizeof(struct iommu_ioas_copy) > > + * @flags: Combination of enum iommufd_ioas_map_flags > > + * @dst_ioas_id: IOAS ID to change the mapping of > > + * @src_ioas

Re: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-03-31 Thread Jason Gunthorpe via iommu
On Thu, Mar 31, 2022 at 03:36:29PM +1100, David Gibson wrote: > > +/** > > + * struct iommu_ioas_iova_ranges - ioctl(IOMMU_IOAS_IOVA_RANGES) > > + * @size: sizeof(struct iommu_ioas_iova_ranges) > > + * @ioas_id: IOAS ID to read ranges from > > + * @out_num_iovas: Output total number of ranges in t

RE: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-03-30 Thread Tian, Kevin
> From: David Gibson > Sent: Thursday, March 31, 2022 12:36 PM > > + > > +/** > > + * struct iommu_ioas_iova_ranges - ioctl(IOMMU_IOAS_IOVA_RANGES) > > + * @size: sizeof(struct iommu_ioas_iova_ranges) > > + * @ioas_id: IOAS ID to read ranges from > > + * @out_num_iovas: Output total number of rang

Re: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-03-30 Thread David Gibson
On Fri, Mar 18, 2022 at 02:27:33PM -0300, Jason Gunthorpe wrote: > Connect the IOAS to its IOCTL interface. This exposes most of the > functionality in the io_pagetable to userspace. > > This is intended to be the core of the generic interface that IOMMUFD will > provide. Every IOMMU driver should

Re: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-03-30 Thread Yi Liu
Hi Jason, On 2022/3/19 01:27, Jason Gunthorpe wrote: Connect the IOAS to its IOCTL interface. This exposes most of the functionality in the io_pagetable to userspace. This is intended to be the core of the generic interface that IOMMUFD will provide. Every IOMMU driver should be able to impleme

Re: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-03-28 Thread Alex Williamson
On Mon, 28 Mar 2022 16:47:49 -0300 Jason Gunthorpe wrote: > On Mon, Mar 28, 2022 at 03:57:53PM -0300, Jason Gunthorpe wrote: > > > So, currently AMD and Intel have exactly the same HW feature with a > > different kAPI.. > > I fixed it like below and made the ordering changes Kevin pointed > t

Re: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-03-28 Thread Jason Gunthorpe via iommu
On Mon, Mar 28, 2022 at 03:57:53PM -0300, Jason Gunthorpe wrote: > So, currently AMD and Intel have exactly the same HW feature with a > different kAPI.. I fixed it like below and made the ordering changes Kevin pointed to. Will send next week after the merge window: 527e438a974a06 iommu: Delete

Re: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-03-28 Thread Jason Gunthorpe via iommu
On Mon, Mar 28, 2022 at 11:17:23AM -0600, Alex Williamson wrote: > On Thu, 24 Mar 2022 10:46:22 -0300 > Jason Gunthorpe wrote: > > > On Thu, Mar 24, 2022 at 07:25:03AM +, Tian, Kevin wrote: > > > > > Based on that here is a quick tweak of the force-snoop part (not > > > compiled). > > >

Re: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-03-28 Thread Alex Williamson
On Thu, 24 Mar 2022 10:46:22 -0300 Jason Gunthorpe wrote: > On Thu, Mar 24, 2022 at 07:25:03AM +, Tian, Kevin wrote: > > > Based on that here is a quick tweak of the force-snoop part (not compiled). > > > > I liked your previous idea better, that IOMMU_CAP_CACHE_COHERENCY > started out O

Re: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-03-27 Thread Jason Gunthorpe via iommu
On Sun, Mar 27, 2022 at 02:32:23AM +, Tian, Kevin wrote: > > this looks good to me except that the 2nd patch (eab4b381) should be > > the last one otherwise it affects bisect. and in that case the subject > > would be simply about removing the capability instead of > > restoring... Oh because

RE: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-03-26 Thread Tian, Kevin
> From: Tian, Kevin > Sent: Friday, March 25, 2022 10:16 AM > > > From: Jason Gunthorpe > > Sent: Thursday, March 24, 2022 9:46 PM > > > > On Thu, Mar 24, 2022 at 07:25:03AM +, Tian, Kevin wrote: > > > > > Based on that here is a quick tweak of the force-snoop part (not > compiled). > > > > I

RE: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-03-24 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Thursday, March 24, 2022 9:46 PM > > On Thu, Mar 24, 2022 at 07:25:03AM +, Tian, Kevin wrote: > > > Based on that here is a quick tweak of the force-snoop part (not compiled). > > I liked your previous idea better, that IOMMU_CAP_CACHE_COHERENCY > started out

Re: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-03-24 Thread Jason Gunthorpe via iommu
On Thu, Mar 24, 2022 at 07:25:03AM +, Tian, Kevin wrote: > Based on that here is a quick tweak of the force-snoop part (not compiled). I liked your previous idea better, that IOMMU_CAP_CACHE_COHERENCY started out OK but got weird. So lets fix it back to the way it was. How about this: https

RE: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-03-24 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Thursday, March 24, 2022 6:55 AM > > On Wed, Mar 23, 2022 at 05:34:18PM -0300, Jason Gunthorpe wrote: > > > Stated another way, any platform that wires dev_is_dma_coherent() to > > true, like all x86 does, must support IOMMU_CACHE and report > > IOMMU_CAP_CACHE_CO

RE: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-03-23 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Thursday, March 24, 2022 4:34 AM > > On Wed, Mar 23, 2022 at 02:04:46PM -0600, Alex Williamson wrote: > > On Wed, 23 Mar 2022 16:34:39 -0300 > > Jason Gunthorpe wrote: > > > > > On Wed, Mar 23, 2022 at 01:10:38PM -0600, Alex Williamson wrote: > > > > On Fri, 18 Ma

Re: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-03-23 Thread Jason Gunthorpe via iommu
On Wed, Mar 23, 2022 at 05:34:18PM -0300, Jason Gunthorpe wrote: > Stated another way, any platform that wires dev_is_dma_coherent() to > true, like all x86 does, must support IOMMU_CACHE and report > IOMMU_CAP_CACHE_COHERENCY for every iommu_domain the platform > supports. The platform obviously

Re: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-03-23 Thread Jason Gunthorpe via iommu
On Wed, Mar 23, 2022 at 02:04:46PM -0600, Alex Williamson wrote: > On Wed, 23 Mar 2022 16:34:39 -0300 > Jason Gunthorpe wrote: > > > On Wed, Mar 23, 2022 at 01:10:38PM -0600, Alex Williamson wrote: > > > On Fri, 18 Mar 2022 14:27:33 -0300 > > > Jason Gunthorpe wrote: > > > > > > > +static int

Re: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-03-23 Thread Alex Williamson
On Wed, 23 Mar 2022 16:34:39 -0300 Jason Gunthorpe wrote: > On Wed, Mar 23, 2022 at 01:10:38PM -0600, Alex Williamson wrote: > > On Fri, 18 Mar 2022 14:27:33 -0300 > > Jason Gunthorpe wrote: > > > > > +static int conv_iommu_prot(u32 map_flags) > > > +{ > > > + int iommu_prot; > > > + > > > +

Re: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-03-23 Thread Jason Gunthorpe via iommu
On Wed, Mar 23, 2022 at 01:10:38PM -0600, Alex Williamson wrote: > On Fri, 18 Mar 2022 14:27:33 -0300 > Jason Gunthorpe wrote: > > > +static int conv_iommu_prot(u32 map_flags) > > +{ > > + int iommu_prot; > > + > > + /* > > +* We provide no manual cache coherency ioctls to userspace and m

Re: [PATCH RFC 08/12] iommufd: IOCTLs for the io_pagetable

2022-03-23 Thread Alex Williamson
On Fri, 18 Mar 2022 14:27:33 -0300 Jason Gunthorpe wrote: > +static int conv_iommu_prot(u32 map_flags) > +{ > + int iommu_prot; > + > + /* > + * We provide no manual cache coherency ioctls to userspace and most > + * architectures make the CPU ops for cache flushing privileged.