Re: [PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function

2018-06-07 Thread Jean-Philippe Brucker
On 06/06/18 22:22, Jacob Pan wrote: > On Wed, 6 Jun 2018 12:20:51 +0100 > Jean-Philippe Brucker wrote: > >> On 05/06/18 18:32, Jacob Pan wrote: "bytes" could be passed by VFIO as argument to bind_pasid_table, since it can deduce it from argsz >>> Are you suggesting we wrap this s

Re: [PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function

2018-06-06 Thread Jacob Pan
On Wed, 6 Jun 2018 12:20:51 +0100 Jean-Philippe Brucker wrote: > On 05/06/18 18:32, Jacob Pan wrote: > >> "bytes" could be passed by VFIO as argument to bind_pasid_table, > >> since it can deduce it from argsz > >> > > Are you suggesting we wrap this struct in a vfio struct with argsz? > > or w

Re: [PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function

2018-06-06 Thread Jean-Philippe Brucker
On 05/06/18 18:32, Jacob Pan wrote: >> "bytes" could be passed by VFIO as argument to bind_pasid_table, since >> it can deduce it from argsz >> > Are you suggesting we wrap this struct in a vfio struct with argsz? or > we directly use this struct? > > I need to clarify how vfio will use this. Rig

Re: [PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function

2018-06-05 Thread Jacob Pan
On Thu, 31 May 2018 10:09:46 +0100 Jean-Philippe Brucker wrote: > On 30/05/18 20:52, Jacob Pan wrote: > >> However I think the model number should be added to > >> pasid_table_config. For one thing it gives us a simple > >> sanity-check, but it also tells which other fields are valid in > >> pasi

Re: [PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function

2018-05-31 Thread Jean-Philippe Brucker
On 30/05/18 20:52, Jacob Pan wrote: >> However I think the model number should be added to >> pasid_table_config. For one thing it gives us a simple sanity-check, >> but it also tells which other fields are valid in pasid_table_config. >> Arm-smmu-v3 needs at least two additional 8-bit fields descr

Re: [PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function

2018-05-30 Thread Jacob Pan
On Wed, 30 May 2018 12:53:53 +0100 Jean-Philippe Brucker wrote: > On 30/05/18 04:45, Tian, Kevin wrote: > >> On SMMUv3 the minimum alignment for base_ptr is 64 bytes, so > >> a > guest > >> under a vSMMU might pass a pointer that's not aligned on 4k. > >> > > PASID

Re: [PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function

2018-05-30 Thread Jean-Philippe Brucker
On 30/05/18 04:45, Tian, Kevin wrote: >> On SMMUv3 the minimum alignment for base_ptr is 64 bytes, so a guest >> under a vSMMU might pass a pointer that's not aligned on 4k. >> > PASID table pointer for VT-d is 4K aligned. >> Maybe this information could be part of the data

RE: [PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function

2018-05-29 Thread Tian, Kevin
> From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Wednesday, May 30, 2018 11:18 AM > > On Wed, 30 May 2018 01:41:43 + > "Tian, Kevin" wrote: > > > > From: Alex Williamson [mailto:alex.william...@redhat.com] > > > Sent: Wednesday, May 30, 2018 4:09 AM > > > > > > On Fri, 20

Re: [PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function

2018-05-29 Thread Alex Williamson
On Wed, 30 May 2018 01:41:43 + "Tian, Kevin" wrote: > > From: Alex Williamson [mailto:alex.william...@redhat.com] > > Sent: Wednesday, May 30, 2018 4:09 AM > > > > On Fri, 20 Apr 2018 16:42:51 -0700 > > Jacob Pan wrote: > > > > > On Fri, 20 Apr 2018 19:25:34 +0100 > > > Jean-Philippe Bru

RE: [PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function

2018-05-29 Thread Tian, Kevin
> From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Wednesday, May 30, 2018 4:09 AM > > On Fri, 20 Apr 2018 16:42:51 -0700 > Jacob Pan wrote: > > > On Fri, 20 Apr 2018 19:25:34 +0100 > > Jean-Philippe Brucker wrote: > > > > > On Tue, Apr 17, 2018 at 08:10:47PM +0100, Alex Willia

Re: [PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function

2018-05-29 Thread Alex Williamson
On Fri, 20 Apr 2018 16:42:51 -0700 Jacob Pan wrote: > On Fri, 20 Apr 2018 19:25:34 +0100 > Jean-Philippe Brucker wrote: > > > On Tue, Apr 17, 2018 at 08:10:47PM +0100, Alex Williamson wrote: > > [...] > > > > + /* Assign guest PASID table pointer and size order */ > > > > + ctx_lo

Re: [PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function

2018-04-20 Thread Jacob Pan
On Fri, 20 Apr 2018 19:25:34 +0100 Jean-Philippe Brucker wrote: > On Tue, Apr 17, 2018 at 08:10:47PM +0100, Alex Williamson wrote: > [...] > > > + /* Assign guest PASID table pointer and size order */ > > > + ctx_lo = (pasidt_binfo->base_ptr & VTD_PAGE_MASK) | > > > + (pasidt_binfo->pasid

Re: [PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function

2018-04-20 Thread Jacob Pan
On Tue, 17 Apr 2018 13:10:47 -0600 Alex Williamson wrote: > On Mon, 16 Apr 2018 14:48:53 -0700 > Jacob Pan wrote: > > > Add Intel VT-d ops to the generic iommu_bind_pasid_table API > > functions. > > > > The primary use case is for direct assignment of SVM capable > > device. Originated from e

Re: [PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function

2018-04-20 Thread Jean-Philippe Brucker
On Tue, Apr 17, 2018 at 08:10:47PM +0100, Alex Williamson wrote: [...] > > + /* Assign guest PASID table pointer and size order */ > > + ctx_lo = (pasidt_binfo->base_ptr & VTD_PAGE_MASK) | > > + (pasidt_binfo->pasid_bits - MIN_NR_PASID_BITS); > > Where does this IOMMU API interface d

Re: [PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function

2018-04-17 Thread Alex Williamson
On Mon, 16 Apr 2018 14:48:53 -0700 Jacob Pan wrote: > Add Intel VT-d ops to the generic iommu_bind_pasid_table API > functions. > > The primary use case is for direct assignment of SVM capable > device. Originated from emulated IOMMU in the guest, the request goes > through many layers (e.g. VF

[PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function

2018-04-16 Thread Jacob Pan
Add Intel VT-d ops to the generic iommu_bind_pasid_table API functions. The primary use case is for direct assignment of SVM capable device. Originated from emulated IOMMU in the guest, the request goes through many layers (e.g. VFIO). Upon calling host IOMMU driver, caller passes guest PASID tabl

[PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function

2018-03-22 Thread Jacob Pan
Add Intel VT-d ops to the generic iommu_bind_pasid_table API functions. The primary use case is for direct assignment of SVM capable device. Originated from emulated IOMMU in the guest, the request goes through many layers (e.g. VFIO). Upon calling host IOMMU driver, caller passes guest PASID tabl