Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-05-05 Thread Auger Eric
Hi Jason, On 4/29/21 10:04 PM, Jason Gunthorpe wrote: > On Thu, Apr 29, 2021 at 03:26:55PM +0200, Auger Eric wrote: >> From the pseudo code, >> >> gpa_ioasid_id = ioctl(ioasid_fd, CREATE_IOASID, ..) >> ioctl(ioasid_fd, SET_IOASID_PAGE_TABLES, ..) >>

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-29 Thread Auger Eric
Hi, On 4/22/21 2:10 PM, Jason Gunthorpe wrote: > On Thu, Apr 22, 2021 at 08:34:32AM +, Tian, Kevin wrote: > >> The shim layer could be considered as a new iommu backend in VFIO, >> which connects VFIO iommu ops to the internal helpers in >> drivers/ioasid. > > It may be the best we can do

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-29 Thread Auger Eric
Hi, On 4/22/21 2:10 PM, Jason Gunthorpe wrote: > On Thu, Apr 22, 2021 at 08:34:32AM +, Tian, Kevin wrote: > >> The shim layer could be considered as a new iommu backend in VFIO, >> which connects VFIO iommu ops to the internal helpers in >> drivers/ioasid. > > It may be the best we can do

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-29 Thread Auger Eric
Hi, On 4/23/21 1:49 PM, Jason Gunthorpe wrote: > On Fri, Apr 23, 2021 at 09:06:44AM +, Tian, Kevin wrote: > >> Or could we still have just one /dev/ioasid but allow userspace to create >> multiple gpa_ioasid_id's each associated to a different iommu domain? >> Then the compatibility check

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-16 Thread Auger Eric
Hi Jason, On 4/16/21 4:34 PM, Jason Gunthorpe wrote: > On Fri, Apr 16, 2021 at 04:26:19PM +0200, Auger Eric wrote: > >> This was largely done during several confs including plumber, KVM forum, >> for several years. Also API docs were shared on the ML. I don't remember >&

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-16 Thread Auger Eric
Hi, On 4/16/21 4:05 PM, Jason Gunthorpe wrote: > On Fri, Apr 16, 2021 at 03:38:02PM +0200, Auger Eric wrote: > >> The redesign requirement came pretty late in the development process. >> The iommu user API is upstream for a while, the VFIO interfaces have >> been s

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-16 Thread Auger Eric
Hi Jason, On 4/16/21 1:07 AM, Jason Gunthorpe wrote: > On Thu, Apr 15, 2021 at 03:11:19PM +0200, Auger Eric wrote: >> Hi Jason, >> >> On 4/1/21 6:03 PM, Jason Gunthorpe wrote: >>> On Thu, Apr 01, 2021 at 02:08:17PM +, Liu, Yi L wrote: >>> >>>>

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-15 Thread Auger Eric
Hi Jason, On 4/1/21 6:03 PM, Jason Gunthorpe wrote: > On Thu, Apr 01, 2021 at 02:08:17PM +, Liu, Yi L wrote: > >> DMA page faults are delivered to root-complex via page request message and >> it is per-device according to PCIe spec. Page request handling flow is: >> >> 1) iommu driver

Re: [RFC PATCH v2 0/8] ACPI/IORT: Support for IORT RMR node

2021-04-15 Thread Auger Eric
Hi Shameer, + Jean-Philippe On 11/19/20 1:11 PM, Shameer Kolothum wrote: > RFC v1 --> v2: >  - Added a generic interface for IOMMU drivers to retrieve all the >    RMR info associated with a given IOMMU. >  - SMMUv3 driver gets the RMR list during probe() and installs >    bypass STEs for all

Re: [RFC PATCH v2 2/8] ACPI/IORT: Add support for RMR node parsing

2021-04-15 Thread Auger Eric
Hi Shameer, On 11/19/20 1:11 PM, Shameer Kolothum wrote: > Add support for parsing RMR node information from ACPI. > Find associated stream ids and smmu node info from the > RMR node and populate a linked list with RMR memory > descriptors. > > Signed-off-by: Shameer Kolothum > --- >

Re: [RFC PATCH v2 1/8] ACPICA: IORT: Update for revision E

2021-04-15 Thread Auger Eric
Hi Shameer, On 11/19/20 1:11 PM, Shameer Kolothum wrote: > IORT revision E contains a few additions like, >     -Added an identifier field in the node descriptors to aid table >      cross-referencing. >     -Introduced the Reserved Memory Range(RMR) node. This is used >     to describe memory

Re: [PATCH v12 01/13] vfio: VFIO_IOMMU_SET_PASID_TABLE

2021-04-11 Thread Auger Eric
Hi Zenghui, On 4/7/21 11:33 AM, Zenghui Yu wrote: > Hi Eric, > > On 2021/2/24 5:06, Eric Auger wrote: >> +/* >> + * VFIO_IOMMU_SET_PASID_TABLE - _IOWR(VFIO_TYPE, VFIO_BASE + 18, >> + *    struct vfio_iommu_type1_set_pasid_table) >> + * >> + * The SET operation passes a PASID table to the

Re: [PATCH v14 08/13] dma-iommu: Implement NESTED_MSI cookie

2021-04-10 Thread Auger Eric
Hi Zenghui, On 4/7/21 9:39 AM, Zenghui Yu wrote: > Hi Eric, > > On 2021/2/24 4:56, Eric Auger wrote: >> Up to now, when the type was UNMANAGED, we used to >> allocate IOVA pages within a reserved IOVA MSI range. >> >> If both the host and the guest are exposed with SMMUs, each >> would allocate

Re: [RFC PATCH v2 0/8] ACPI/IORT: Support for IORT RMR node

2021-04-09 Thread Auger Eric
Hi Shameer, On 11/19/20 1:11 PM, Shameer Kolothum wrote: > RFC v1 --> v2: >  - Added a generic interface for IOMMU drivers to retrieve all the >    RMR info associated with a given IOMMU. >  - SMMUv3 driver gets the RMR list during probe() and installs >    bypass STEs for all the SIDs in the

Re: [PATCH v14 06/13] iommu/smmuv3: Allow stage 1 invalidation with unmanaged ASIDs

2021-04-09 Thread Auger Eric
Hi Kunkun, On 4/9/21 6:48 AM, Kunkun Jiang wrote: > Hi Eric, > > On 2021/4/8 20:30, Auger Eric wrote: >> Hi Kunkun, >> >> On 4/1/21 2:37 PM, Kunkun Jiang wrote: >>> Hi Eric, >>> >>> On 2021/2/24 4:56, Eric Auger wrote: >>>>

Re: [PATCH v14 06/13] iommu/smmuv3: Allow stage 1 invalidation with unmanaged ASIDs

2021-04-08 Thread Auger Eric
Hi Kunkun, On 4/1/21 2:37 PM, Kunkun Jiang wrote: > Hi Eric, > > On 2021/2/24 4:56, Eric Auger wrote: >> With nested stage support, soon we will need to invalidate >> S1 contexts and ranges tagged with an unmanaged asid, this >> latter being managed by the guest. So let's introduce 2 helpers >>

Re: [PATCH v14 13/13] iommu/smmuv3: Accept configs with more than one context descriptor

2021-04-01 Thread Auger Eric
Hi Shameer, On 4/1/21 2:38 PM, Shameerali Kolothum Thodi wrote: > > >> -Original Message----- >> From: Auger Eric [mailto:eric.au...@redhat.com] >> Sent: 01 April 2021 12:49 >> To: yuzenghui >> Cc: eric.auger@gmail.com; iommu@lists.linux-foundation.

Re: [PATCH v14 07/13] iommu/smmuv3: Implement cache_invalidate

2021-04-01 Thread Auger Eric
Hi Zenghui, On 4/1/21 8:11 AM, Zenghui Yu wrote: > Hi Eric, > > On 2021/2/24 4:56, Eric Auger wrote: >> +static int >> +arm_smmu_cache_invalidate(struct iommu_domain *domain, struct device >> *dev, >> +  struct iommu_cache_invalidate_info *inv_info) >> +{ >> +    struct

Re: [PATCH v14 13/13] iommu/smmuv3: Accept configs with more than one context descriptor

2021-04-01 Thread Auger Eric
Hi Zenghui, On 3/30/21 11:23 AM, Zenghui Yu wrote: > Hi Eric, > > On 2021/2/24 4:56, Eric Auger wrote: >> In preparation for vSVA, let's accept userspace provided configs >> with more than one CD. We check the max CD against the host iommu >> capability and also the format (linear versus 2

Re: [PATCH v14 06/13] iommu/smmuv3: Allow stage 1 invalidation with unmanaged ASIDs

2021-04-01 Thread Auger Eric
Hi Zenghui, On 3/30/21 11:17 AM, Zenghui Yu wrote: > On 2021/2/24 4:56, Eric Auger wrote: >> @@ -1936,7 +1950,12 @@ static void >> arm_smmu_tlb_inv_range_domain(unsigned long iova, size_t size, >>   }, >>   }; >>   -    if (smmu_domain->stage == ARM_SMMU_DOMAIN_S1) { >> +    if

Re: [PATCH v13 10/10] iommu/arm-smmu-v3: Add stall support for platform devices

2021-03-26 Thread Auger Eric
Hi Jean, On 3/2/21 10:26 AM, Jean-Philippe Brucker wrote: > The SMMU provides a Stall model for handling page faults in platform > devices. It is similar to PCIe PRI, but doesn't require devices to have > their own translation cache. Instead, faulting transactions are parked > and the OS is given

Re: [Linuxarm] Re: [PATCH v14 07/13] iommu/smmuv3: Implement cache_invalidate

2021-03-22 Thread Auger Eric
Hi Chenxiang, On 3/22/21 7:40 AM, chenxiang (M) wrote: > Hi Eric, > > > 在 2021/3/20 1:36, Auger Eric 写道: >> Hi Chenxiang, >> >> On 3/4/21 8:55 AM, chenxiang (M) wrote: >>> Hi Eric, >>> >>> >>> 在 2021/2/24 4:56, Eric Auger 写道: &

Re: [PATCH v13 10/10] iommu/arm-smmu-v3: Add stall support for platform devices

2021-03-19 Thread Auger Eric
Hi Jean, On 3/2/21 10:26 AM, Jean-Philippe Brucker wrote: > The SMMU provides a Stall model for handling page faults in platform > devices. It is similar to PCIe PRI, but doesn't require devices to have > their own translation cache. Instead, faulting transactions are parked > and the OS is given

Re: [PATCH v14 07/13] iommu/smmuv3: Implement cache_invalidate

2021-03-19 Thread Auger Eric
Hi Chenxiang, On 3/4/21 8:55 AM, chenxiang (M) wrote: > Hi Eric, > > > 在 2021/2/24 4:56, Eric Auger 写道: >> Implement domain-selective, pasid selective and page-selective >> IOTLB invalidations. >> >> Signed-off-by: Eric Auger >> >> --- >> >> v13 -> v14: >> - Add domain invalidation >> - do

Re: [PATCH v14 00/13] SMMUv3 Nested Stage Setup (IOMMU part)

2021-03-19 Thread Auger Eric
Hi Krishna, On 3/18/21 1:16 AM, Krishna Reddy wrote: > Tested-by: Krishna Reddy > > Validated nested translations with NVMe PCI device assigned to Guest VM. > Tested with both v12 and v13 of Jean-Philippe's patches as base. Many thanks for that. > >> This is based on Jean-Philippe's >>

Re: [PATCH v14 05/13] iommu/smmuv3: Implement attach/detach_pasid_table

2021-03-19 Thread Auger Eric
Hi Keqian, On 3/2/21 9:35 AM, Keqian Zhu wrote: > Hi Eric, > > On 2021/2/24 4:56, Eric Auger wrote: >> On attach_pasid_table() we program STE S1 related info set >> by the guest into the actual physical STEs. At minimum >> we need to program the context descriptor GPA and compute >> whether the

Re: [PATCH 0/3] Add support for ACPI VIOT

2021-03-19 Thread Auger Eric
Hi Jean, On 3/16/21 8:16 PM, Jean-Philippe Brucker wrote: > Add a driver for the ACPI VIOT table, which enables virtio-iommu on > non-devicetree platforms, including x86. This series depends on the > ACPICA changes of patch 1, which will be included in next release [1] > and pulled into Linux. >

Re: [PATCH 2/3] ACPI: Add driver for the VIOT table

2021-03-19 Thread Auger Eric
Hi Jean, On 3/16/21 8:16 PM, Jean-Philippe Brucker wrote: > The ACPI Virtual I/O Translation Table describes topology of > para-virtual platforms. For now it describes the relation between > virtio-iommu and the endpoints it manages. Supporting that requires > three steps: > > (1)

Re: [PATCH 1/3] ACPICA: iASL: Add definitions for the VIOT table

2021-03-18 Thread Auger Eric
Hi Jean, On 3/16/21 8:16 PM, Jean-Philippe Brucker wrote: > Just here for reference, don't merge! > > The actual commits will be pulled from the next ACPICA release. > I squashed the three relevant commits: > > ACPICA commit fc4e33319c1ee08f20f5c44853dd8426643f6dfd > ACPICA commit

Re: [PATCH v13 00/15] SMMUv3 Nested Stage Setup (IOMMU part)

2021-03-16 Thread Auger Eric
Hi Krishna, On 3/15/21 7:04 PM, Krishna Reddy wrote: > Tested-by: Krishna Reddy > >> 1) pass the guest stage 1 configuration > > Validated Nested SMMUv3 translations for NVMe PCIe device from Guest VM along > with patch series "v11 SMMUv3 Nested Stage Setup (VFIO part)" and QEMU patch >

Re: [PATCH 15/17] iommu: remove DOMAIN_ATTR_NESTING

2021-03-15 Thread Auger Eric
Hi Christoph, On 3/14/21 4:58 PM, Christoph Hellwig wrote: > On Sun, Mar 14, 2021 at 11:44:52AM +0100, Auger Eric wrote: >> As mentionned by Robin, there are series planning to use >> DOMAIN_ATTR_NESTING to get info about the nested caps of the iommu (ARM >> and Intel):

Re: [PATCH 15/17] iommu: remove DOMAIN_ATTR_NESTING

2021-03-14 Thread Auger Eric
Hi Christoph, On 3/1/21 9:42 AM, Christoph Hellwig wrote: > Signed-off-by: Christoph Hellwig > --- > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 40 ++--- > drivers/iommu/arm/arm-smmu/arm-smmu.c | 30 ++-- > drivers/iommu/intel/iommu.c | 28

Re: [PATCH v12 03/13] vfio: VFIO_IOMMU_SET_MSI_BINDING

2021-03-08 Thread Auger Eric
Hi Jean, On 3/5/21 11:45 AM, Jean-Philippe Brucker wrote: > Hi, > > On Tue, Feb 23, 2021 at 10:06:15PM +0100, Eric Auger wrote: >> This patch adds the VFIO_IOMMU_SET_MSI_BINDING ioctl which aim >> to (un)register the guest MSI binding to the host. This latter >> then can use those stage 1

Re: [PATCH v14 00/13] SMMUv3 Nested Stage Setup (IOMMU part)

2021-02-25 Thread Auger Eric
Hi Shameer, all On 2/23/21 9:56 PM, Eric Auger wrote: > This series brings the IOMMU part of HW nested paging support > in the SMMUv3. The VFIO part is submitted separately. > > This is based on Jean-Philippe's > [PATCH v12 00/10] iommu: I/O page faults for SMMUv3 >

Re: [PATCH v11 04/13] vfio/pci: Add VFIO_REGION_TYPE_NESTED region type

2021-02-23 Thread Auger Eric
Hi Shenming, On 2/23/21 1:45 PM, Shenming Lu wrote: >> +static int vfio_pci_dma_fault_init(struct vfio_pci_device *vdev) >> +{ >> +struct vfio_region_dma_fault *header; >> +struct iommu_domain *domain; >> +size_t size; >> +bool nested; >> +int ret; >> + >> +domain =

Re: [PATCH v11 01/13] vfio: VFIO_IOMMU_SET_PASID_TABLE

2021-02-22 Thread Auger Eric
Hi Keqian, On 2/22/21 1:20 PM, Keqian Zhu wrote: > Hi Eric, > > On 2021/2/22 18:53, Auger Eric wrote: >> Hi Keqian, >> >> On 2/2/21 1:34 PM, Keqian Zhu wrote: >>> Hi Eric, >>> >>> On 2020/11/16 19:00, Eric Auger wr

Re: [PATCH v11 01/13] vfio: VFIO_IOMMU_SET_PASID_TABLE

2021-02-22 Thread Auger Eric
Hi Keqian, On 2/2/21 1:34 PM, Keqian Zhu wrote: > Hi Eric, > > On 2020/11/16 19:00, Eric Auger wrote: >> From: "Liu, Yi L" >> >> This patch adds an VFIO_IOMMU_SET_PASID_TABLE ioctl >> which aims to pass the virtual iommu guest configuration >> to the host. This latter takes the form of the

Re: [PATCH v13 00/15] SMMUv3 Nested Stage Setup (IOMMU part)

2021-02-21 Thread Auger Eric
Hi Shameer, On 1/8/21 6:05 PM, Shameerali Kolothum Thodi wrote: > Hi Eric, > >> -Original Message- >> From: Eric Auger [mailto:eric.au...@redhat.com] >> Sent: 18 November 2020 11:22 >> To: eric.auger@gmail.com; eric.au...@redhat.com; >> iommu@lists.linux-foundation.org;

Re: [PATCH v11 12/13] vfio/pci: Register a DMA fault response region

2021-02-18 Thread Auger Eric
Hi Shameer, On 2/18/21 11:36 AM, Shameerali Kolothum Thodi wrote: > Hi Eric, > >>> -Original Message- >>> From: Eric Auger [mailto:eric.au...@redhat.com] >>> Sent: 16 November 2020 11:00 >>> To: eric.auger@gmail.com; eric.au...@redhat.com; >>> iommu@lists.linux-foundation.org;

Re: [PATCH v13 02/15] iommu: Introduce bind/unbind_guest_msi

2021-02-18 Thread Auger Eric
Hi Keqian, On 2/18/21 9:43 AM, Keqian Zhu wrote: > Hi Eric, > > On 2021/2/12 16:55, Auger Eric wrote: >> Hi Keqian, >> >> On 2/1/21 12:52 PM, Keqian Zhu wrote: >>> Hi Eric, >>> >>> On 2020/11/18 19:21, Eric Auger wrote: >>>

Re: [PATCH v13 07/15] iommu/smmuv3: Allow stage 1 invalidation with unmanaged ASIDs

2021-02-15 Thread Auger Eric
Hi Shameer, On 12/3/20 7:42 PM, Shameerali Kolothum Thodi wrote: > Hi Eric, > >> -Original Message- >> From: kvmarm-boun...@lists.cs.columbia.edu >> [mailto:kvmarm-boun...@lists.cs.columbia.edu] On Behalf Of Auger Eric >> Sent: 01 December 2020 13:59 >>

Re: [PATCH 2/2] iommu: arm-smmu-v3: Report domain nesting info reuqired for stage1

2021-02-12 Thread Auger Eric
Hi Vivek, On 2/12/21 11:58 AM, Vivek Gautam wrote: > Update nested domain information required for stage1 page table. > > Signed-off-by: Vivek Gautam > --- > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 16 ++-- > 1 file changed, 14 insertions(+), 2 deletions(-) > > diff --git

Re: [PATCH 2/2] iommu: arm-smmu-v3: Report domain nesting info reuqired for stage1

2021-02-12 Thread Auger Eric
Hi Vivek, On 2/12/21 11:58 AM, Vivek Gautam wrote: > Update nested domain information required for stage1 page table. s/reuqired/required in the commit title > > Signed-off-by: Vivek Gautam > --- > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 16 ++-- > 1 file changed, 14

Re: [PATCH 1/2] iommu: Report domain nesting info for arm-smmu-v3

2021-02-12 Thread Auger Eric
Hi Vivek, On 2/12/21 11:58 AM, Vivek Gautam wrote: > Add a vendor specific structure for domain nesting info for > arm smmu-v3, and necessary info fields required to populate > stage1 page tables. > > Signed-off-by: Vivek Gautam > --- > include/uapi/linux/iommu.h | 31

Re: [PATCH v7 02/16] iommu/smmu: Report empty domain nesting info

2021-02-12 Thread Auger Eric
Hi Vivek, Yi, On 2/12/21 8:14 AM, Vivek Gautam wrote: > Hi Yi, > > > On Sat, Jan 23, 2021 at 2:29 PM Liu, Yi L wrote: >> >> Hi Eric, >> >>> From: Auger Eric >>> Sent: Tuesday, January 19, 2021 6:03 PM >>> >>> Hi Yi, Vivek,

Re: [PATCH v13 02/15] iommu: Introduce bind/unbind_guest_msi

2021-02-12 Thread Auger Eric
Hi Keqian, On 2/1/21 12:52 PM, Keqian Zhu wrote: > Hi Eric, > > On 2020/11/18 19:21, Eric Auger wrote: >> On ARM, MSI are translated by the SMMU. An IOVA is allocated >> for each MSI doorbell. If both the host and the guest are exposed >> with SMMUs, we end up with 2 different IOVAs allocated by

Re: [PATCH v13 05/15] iommu/smmuv3: Get prepared for nested stage support

2021-02-11 Thread Auger Eric
Hi Keqian, On 2/2/21 8:14 AM, Keqian Zhu wrote: > Hi Eric, > > On 2020/11/18 19:21, Eric Auger wrote: >> When nested stage translation is setup, both s1_cfg and >> s2_cfg are set. >> >> We introduce a new smmu domain abort field that will be set >> upon guest stage1 configuration passing. >> >>

Re: [PATCH v13 06/15] iommu/smmuv3: Implement attach/detach_pasid_table

2021-02-11 Thread Auger Eric
Hi Keqian, On 2/2/21 9:03 AM, Keqian Zhu wrote: > Hi Eric, > > On 2020/11/18 19:21, Eric Auger wrote: >> On attach_pasid_table() we program STE S1 related info set >> by the guest into the actual physical STEs. At minimum >> we need to program the context descriptor GPA and compute >> whether

Re: [PATCH v13 03/15] iommu/arm-smmu-v3: Maintain a SID->device structure

2021-02-01 Thread Auger Eric
Hi Keqian, On 2/1/21 1:26 PM, Keqian Zhu wrote: > Hi Eric, > > On 2020/11/18 19:21, Eric Auger wrote: >> From: Jean-Philippe Brucker >> >> When handling faults from the event or PRI queue, we need to find the >> struct device associated to a SID. Add a rb_tree to keep track of SIDs. >> >>

Re: [PATCH v13 01/15] iommu: Introduce attach/detach_pasid_table API

2021-02-01 Thread Auger Eric
Hi Keqian, On 2/1/21 12:27 PM, Keqian Zhu wrote: > Hi Eric, > > On 2020/11/18 19:21, Eric Auger wrote: >> In virtualization use case, when a guest is assigned >> a PCI host device, protected by a virtual IOMMU on the guest, >> the physical IOMMU must be programmed to be consistent with >> the

Re: [PATCH v12 10/10] iommu/arm-smmu-v3: Add stall support for platform devices

2021-02-01 Thread Auger Eric
Hi Jean, On 2/1/21 12:12 PM, Jean-Philippe Brucker wrote: > On Sun, Jan 31, 2021 at 07:29:09PM +0100, Auger Eric wrote: >> Hi Jean, >> >> Some rather minor comments§questions below that may not justify a respin. >> >> On 1/27/21 4:43 PM, Jean-Philipp

Re: [PATCH v12 03/10] iommu: Separate IOMMU_DEV_FEAT_IOPF from IOMMU_DEV_FEAT_SVA

2021-01-31 Thread Auger Eric
> enable IOMMU_DEV_FEAT_IOPF before enabling IOMMU_DEV_FEAT_SVA. Enabling > IOMMU_DEV_FEAT_IOPF on its own doesn't have any effect visible to the > device driver, it is used in combination with other features. > > Signed-off-by: Jean-Philippe Brucker Reviewed-by: Eric Auger Eric &

Re: [PATCH v12 02/10] iommu/arm-smmu-v3: Use device properties for pasid-num-bits

2021-01-31 Thread Auger Eric
Murphy > Acked-by: Jonathan Cameron > Signed-off-by: Jean-Philippe Brucker Reviewed-by: Eric Auger Eric > --- > include/linux/iommu.h | 2 -- > drivers/acpi/arm64/iort.c | 13 +++-- > drivers/iommu/arm/arm-smmu-v3/arm-sm

Re: [PATCH v12 08/10] dt-bindings: document stall property for IOMMU masters

2021-01-31 Thread Auger Eric
g > Signed-off-by: Jean-Philippe Brucker Reviewed-by: Eric Auger Eric > --- > .../devicetree/bindings/iommu/iommu.txt| 18 ++ > 1 file changed, 18 insertions(+) > > diff --git a/Documentation/devicetree/bindings/iommu/iommu.txt > b/Documentation

Re: [PATCH v12 10/10] iommu/arm-smmu-v3: Add stall support for platform devices

2021-01-31 Thread Auger Eric
Hi Jean, Some rather minor comments§questions below that may not justify a respin. On 1/27/21 4:43 PM, Jean-Philippe Brucker wrote: > The SMMU provides a Stall model for handling page faults in platform > devices. It is similar to PCIe PRI, but doesn't require devices to have > their own

Re: [PATCH v12 06/10] iommu: Add a page fault handler

2021-01-31 Thread Auger Eric
Hi Jean, On 1/27/21 4:43 PM, Jean-Philippe Brucker wrote: > Some systems allow devices to handle I/O Page Faults in the core mm. For > example systems implementing the PCIe PRI extension or Arm SMMU stall > model. Infrastructure for reporting these recoverable page faults was > added to the IOMMU

Re: [PATCH RFC v1 00/15] iommu/virtio: Nested stage support with Arm

2021-01-25 Thread Auger Eric
Hi Vivek, On 1/21/21 6:34 PM, Vivek Kumar Gautam wrote: > Hi Eric, > > > On 1/19/21 2:33 PM, Auger Eric wrote: >> Hi Vivek, >> >> On 1/15/21 1:13 PM, Vivek Gautam wrote: >>> This patch-series aims at enabling Nested stage translation in guests >>>

Re: [PATCH v10 07/10] iommu/arm-smmu-v3: Maintain a SID->device structure

2021-01-22 Thread Auger Eric
Brucker Reviewed-by: Eric Auger Eric > --- > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 13 +- > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 161 > 2 files changed, 144 insertions(+), 30 deletions(-) > > diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-

Re: [PATCH v7 02/16] iommu/smmu: Report empty domain nesting info

2021-01-19 Thread Auger Eric
Hi Yi, Vivek, On 1/13/21 6:56 AM, Liu, Yi L wrote: > Hi Vivek, > >> From: Vivek Gautam >> Sent: Tuesday, January 12, 2021 7:06 PM >> >> Hi Yi, >> >> >> On Tue, Jan 12, 2021 at 2:51 PM Liu, Yi L wrote: >>> >>> Hi Vivek, >>> From: Vivek Gautam Sent: Tuesday, January 12, 2021 2:50 PM

Re: [PATCH RFC v1 00/15] iommu/virtio: Nested stage support with Arm

2021-01-19 Thread Auger Eric
Hi Vivek, On 1/15/21 1:13 PM, Vivek Gautam wrote: > This patch-series aims at enabling Nested stage translation in guests > using virtio-iommu as the paravirtualized iommu. The backend is supported > with Arm SMMU-v3 that provides nested stage-1 and stage-2 translation. > > This series derives

Re: [PATCH v13 07/15] iommu/smmuv3: Allow stage 1 invalidation with unmanaged ASIDs

2021-01-14 Thread Auger Eric
Hi Jean, On 1/14/21 6:33 PM, Jean-Philippe Brucker wrote: > Hi Eric, > > On Thu, Jan 14, 2021 at 05:58:27PM +0100, Auger Eric wrote: >>>> The uacce-devel branches from >>>>> https://github.com/Linaro/linux-kernel-uadk do provide this at the moment >&g

Re: [PATCH v13 07/15] iommu/smmuv3: Allow stage 1 invalidation with unmanaged ASIDs

2021-01-14 Thread Auger Eric
Hi Shameer, Jean-Philippe, On 12/4/20 11:23 AM, Auger Eric wrote: > Hi Shameer, Jean-Philippe, > > On 12/4/20 11:20 AM, Shameerali Kolothum Thodi wrote: >> Hi Jean, >> >>> -Original Message- >>> From: Jean-Philippe Brucker [mailto:jean-phili...@li

Re: [PATCH v13 00/15] SMMUv3 Nested Stage Setup (IOMMU part)

2021-01-13 Thread Auger Eric
Hi Shameer, On 1/8/21 6:05 PM, Shameerali Kolothum Thodi wrote: > Hi Eric, > >> -Original Message- >> From: Eric Auger [mailto:eric.au...@redhat.com] >> Sent: 18 November 2020 11:22 >> To: eric.auger@gmail.com; eric.au...@redhat.com; >> iommu@lists.linux-foundation.org;

Re: [PATCH v13 07/15] iommu/smmuv3: Allow stage 1 invalidation with unmanaged ASIDs

2020-12-04 Thread Auger Eric
Hi Shameer, Jean-Philippe, On 12/4/20 11:20 AM, Shameerali Kolothum Thodi wrote: > Hi Jean, > >> -Original Message- >> From: Jean-Philippe Brucker [mailto:jean-phili...@linaro.org] >> Sent: 04 December 2020 09:54 >> To: Shameerali Kolothum Thodi &

Re: [PATCH v13 05/15] iommu/smmuv3: Get prepared for nested stage support

2020-12-03 Thread Auger Eric
Hi Kunkun, On 12/3/20 1:32 PM, Kunkun Jiang wrote: > Hi Eric, > > On 2020/11/18 19:21, Eric Auger wrote: >> When nested stage translation is setup, both s1_cfg and >> s2_cfg are set. >> >> We introduce a new smmu domain abort field that will be set >> upon guest stage1 configuration passing. >>

Re: [PATCH v13 07/15] iommu/smmuv3: Allow stage 1 invalidation with unmanaged ASIDs

2020-12-01 Thread Auger Eric
Hi Xingang, On 12/1/20 2:33 PM, Xingang Wang wrote: > Hi Eric > > On Wed, 18 Nov 2020 12:21:43, Eric Auger wrote: >> @@ -1710,7 +1710,11 @@ static void arm_smmu_tlb_inv_context(void *cookie) >> * insertion to guarantee those are observed before the TLBI. Do be >> * careful, 007. >>

Re: [PATCH v11 08/13] vfio/pci: Add framework for custom interrupt indices

2020-11-24 Thread Auger Eric
Hi Shameer, Qubingbing On 11/23/20 1:51 PM, Shameerali Kolothum Thodi wrote: > Hi Eric, > >> -Original Message- >> From: Eric Auger [mailto:eric.au...@redhat.com] >> Sent: 16 November 2020 11:00 >> To: eric.auger@gmail.com; eric.au...@redhat.com; >> iommu@lists.linux-foundation.org;

Re: [PATCH v13 01/15] iommu: Introduce attach/detach_pasid_table API

2020-11-19 Thread Auger Eric
Hi Jacob, On 11/18/20 5:19 PM, Jacob Pan wrote: > Hi Eric, > > On Wed, 18 Nov 2020 12:21:37 +0100, Eric Auger > wrote: > >> In virtualization use case, when a guest is assigned >> a PCI host device, protected by a virtual IOMMU on the guest, >> the physical IOMMU must be programmed to be

Re: [PATCH v12 04/15] iommu/smmuv3: Dynamically allocate s1_cfg and s2_cfg

2020-11-17 Thread Auger Eric
Hi Shameer, On 11/17/20 12:39 PM, Shameerali Kolothum Thodi wrote: > Hi Eric, > >> -Original Message- >> From: Eric Auger [mailto:eric.au...@redhat.com] >> Sent: 16 November 2020 10:43 >> To: eric.auger@gmail.com; eric.au...@redhat.com; >> iommu@lists.linux-foundation.org;

Re: [PATCH v11 00/13] SMMUv3 Nested Stage Setup (IOMMU part)

2020-11-17 Thread Auger Eric
Hi Shameer, On 5/13/20 5:57 PM, Shameerali Kolothum Thodi wrote: > Hi Eric, > >> -Original Message----- >> From: Auger Eric [mailto:eric.au...@redhat.com] >> Sent: 13 May 2020 14:29 >> To: Shameerali Kolothum Thodi ; >> Zhangfei Gao ; eric.auger

Re: [PATCH v10 04/11] vfio/pci: Add VFIO_REGION_TYPE_NESTED region type

2020-11-13 Thread Auger Eric
Hi Zenghui, On 9/24/20 10:23 AM, Zenghui Yu wrote: > Hi Eric, > > On 2020/3/21 0:19, Eric Auger wrote: >> Add a new specific DMA_FAULT region aiming to exposed nested mode >> translation faults. >> >> The region has a ring buffer that contains the actual fault >> records plus a header allowing to

Re: [PATCH v10 05/11] vfio/pci: Register an iommu fault handler

2020-11-13 Thread Auger Eric
Hi Zenghui, On 9/24/20 10:49 AM, Zenghui Yu wrote: > Hi Eric, > > On 2020/3/21 0:19, Eric Auger wrote: >> Register an IOMMU fault handler which records faults in >> the DMA FAULT region ring buffer. In a subsequent patch, we >> will add the signaling of a specific eventfd to allow the >>

Re: [PATCH v10 01/11] vfio: VFIO_IOMMU_SET_PASID_TABLE

2020-10-27 Thread Auger Eric
Hi Shameer, On 10/27/20 1:20 PM, Shameerali Kolothum Thodi wrote: > Hi Eric, > >> -Original Message- >> From: iommu [mailto:iommu-boun...@lists.linux-foundation.org] On Behalf Of >> Auger Eric >> Sent: 23 September 2020 12:47 >> To: yuzenghui

Re: [RFC 0/3] iommu: Reserved regions for IOVAs beyond dma_mask and iommu aperture

2020-10-06 Thread Auger Eric
Hi all, On 10/5/20 3:08 PM, Christoph Hellwig wrote: > On Mon, Oct 05, 2020 at 11:44:10AM +0100, Lorenzo Pieralisi wrote: >>> I see that there are both OF and ACPI hooks in pci_dma_configure() and >>> both modify dev->dma_mask, which is what pci-sysfs is exposing here, >>> but I'm not convinced

Re: [PATCH v10 11/11] vfio: Document nested stage control

2020-10-06 Thread Auger Eric
Hi Zenghui, On 9/24/20 3:42 PM, Zenghui Yu wrote: > Hi Eric, > > On 2020/3/21 0:19, Eric Auger wrote: >> The VFIO API was enhanced to support nested stage control: a bunch of >> new iotcls, one DMA FAULT region and an associated specific IRQ. >> >> Let's document the process to follow to set up

Re: [PATCH v3 0/6] Add virtio-iommu built-in topology

2020-10-06 Thread Auger Eric
Hello Al, On 10/2/20 8:23 PM, Al Stone wrote: > On 24 Sep 2020 11:54, Auger Eric wrote: >> Hi, >> >> Adding Al in the loop >> >> On 9/24/20 11:38 AM, Michael S. Tsirkin wrote: >>> On Thu, Sep 24, 2020 at 11:21:29AM +0200, Joerg Roedel wrote: >>>

Re: [RFC 0/3] iommu: Reserved regions for IOVAs beyond dma_mask and iommu aperture

2020-09-30 Thread Auger Eric
Hi Alex, On 9/29/20 8:18 PM, Alex Williamson wrote: > On Tue, 29 Sep 2020 09:18:22 +0200 > Auger Eric wrote: > >> Hi all, >> >> [also correcting some outdated email addresses + adding Lorenzo in cc] >> >> On 9/29/20 12:42 AM, Alex Williamson wrote:

Re: [PATCH v12 6/6] iommu/vt-d: Check UAPI data processed by IOMMU core

2020-09-29 Thread Auger Eric
Hi Jacob, On 9/25/20 6:32 PM, Jacob Pan wrote: > IOMMU generic layer already does sanity checks on UAPI data for version > match and argsz range based on generic information. > > This patch adjusts the following data checking responsibilities: > - removes the redundant version check from VT-d

Re: [PATCH v12 5/6] iommu/uapi: Handle data and argsz filled by users

2020-09-29 Thread Auger Eric
Hi Jacob, On 9/25/20 6:32 PM, Jacob Pan wrote: > IOMMU user APIs are responsible for processing user data. This patch > changes the interface such that user pointers can be passed into IOMMU > code directly. Separate kernel APIs without user pointers are introduced > for in-kernel users of the

Re: [RFC 2/3] iommu: Account for dma_mask and iommu aperture in IOVA reserved regions

2020-09-29 Thread Auger Eric
Hi Christoph, On 9/29/20 8:03 AM, Christoph Hellwig wrote: > On Mon, Sep 28, 2020 at 09:50:36PM +0200, Eric Auger wrote: >> VFIO currently exposes the usable IOVA regions through the >> VFIO_IOMMU_GET_INFO ioctl. However it fails to take into account >> the dma_mask of the devices within the

Re: [RFC 0/3] iommu: Reserved regions for IOVAs beyond dma_mask and iommu aperture

2020-09-29 Thread Auger Eric
Hi all, [also correcting some outdated email addresses + adding Lorenzo in cc] On 9/29/20 12:42 AM, Alex Williamson wrote: > On Mon, 28 Sep 2020 21:50:34 +0200 > Eric Auger wrote: > >> VFIO currently exposes the usable IOVA regions through the >> VFIO_IOMMU_GET_INFO ioctl /

Re: [PATCH v3 0/6] Add virtio-iommu built-in topology

2020-09-24 Thread Auger Eric
Hi, Adding Al in the loop On 9/24/20 11:38 AM, Michael S. Tsirkin wrote: > On Thu, Sep 24, 2020 at 11:21:29AM +0200, Joerg Roedel wrote: >> On Thu, Sep 24, 2020 at 05:00:35AM -0400, Michael S. Tsirkin wrote: >>> OK so this looks good. Can you pls repost with the minor tweak >>> suggested and all

Re: [PATCH v10 01/11] vfio: VFIO_IOMMU_SET_PASID_TABLE

2020-09-23 Thread Auger Eric
Hi Zenghui, On 9/23/20 1:27 PM, Zenghui Yu wrote: > Hi Eric, > > On 2020/3/21 0:19, Eric Auger wrote: >> From: "Liu, Yi L" >> >> This patch adds an VFIO_IOMMU_SET_PASID_TABLE ioctl >> which aims to pass the virtual iommu guest configuration >> to the host. This latter takes the form of the

Re: [PATCH v2] iommu/arm: Add module parameter to set msi iova address

2020-09-23 Thread Auger Eric
Hi Will, On 9/21/20 10:45 PM, Will Deacon wrote: > On Mon, Sep 14, 2020 at 11:13:07AM -0700, Vennila Megavannan wrote: >> From: Srinath Mannam >> >> Add provision to change default value of MSI IOVA base to platform's >> suitable IOVA using module parameter. The present hardcoded MSI IOVA base

Re: [PATCH v7 00/16] vfio: expose virtual Shared Virtual Addressing to VMs

2020-09-16 Thread Auger Eric
Hi, On 9/16/20 6:32 PM, Jason Gunthorpe wrote: > On Wed, Sep 16, 2020 at 06:20:52PM +0200, Jean-Philippe Brucker wrote: >> On Wed, Sep 16, 2020 at 11:51:48AM -0300, Jason Gunthorpe wrote: >>> On Wed, Sep 16, 2020 at 10:32:17AM +0200, Jean-Philippe Brucker wrote: And this is the only PASID

Re: [PATCH v2 5/9] iommu/ioasid: Introduce ioasid_set private ID

2020-09-10 Thread Auger Eric
Hi Jacob, On 9/9/20 12:40 AM, Jacob Pan wrote: > On Tue, 1 Sep 2020 17:38:44 +0200 > Auger Eric wrote: > >> Hi Jacob, >> On 8/22/20 6:35 AM, Jacob Pan wrote: >>> When an IOASID set is used for guest SVA, each VM will acquire its >>> ioasid_set for IOASID

Re: [PATCH v2 6/9] iommu/ioasid: Introduce notification APIs

2020-09-10 Thread Auger Eric
Hi Jacob, On 9/10/20 12:58 AM, Jacob Pan wrote: > On Tue, 1 Sep 2020 18:49:38 +0200 > Auger Eric wrote: > >> Hi Jacob, >> >> On 8/22/20 6:35 AM, Jacob Pan wrote: >>> Relations among IOASID users largely follow a publisher-subscriber >>> pattern. E.

Re: [PATCH RESEND v9 02/13] iommu/ioasid: Add ioasid references

2020-09-08 Thread Auger Eric
Hi Jean, On 8/17/20 7:15 PM, Jean-Philippe Brucker wrote: > Let IOASID users take references to existing ioasids with ioasid_get(). > ioasid_put() drops a reference and only frees the ioasid when its > reference number is zero. It returns true if the ioasid was freed. > For drivers that don't

Re: [PATCH RESEND v9 11/13] iommu/arm-smmu-v3: Add SVA device feature

2020-09-08 Thread Auger Eric
t; + switch (feat) { > + case IOMMU_DEV_FEAT_SVA: > + return arm_smmu_master_disable_sva(dev_iommu_priv_get(dev)); > + default: > + return -EINVAL; > + } > +} > + > static struct iommu_ops arm_smmu_ops = { > .capable

Re: [PATCH RESEND v9 10/13] iommu/arm-smmu-v3: Check for SVA features

2020-09-08 Thread Auger Eric
Hi Jean, On 8/17/20 7:15 PM, Jean-Philippe Brucker wrote: > Aggregate all sanity-checks for sharing CPU page tables with the SMMU > under a single ARM_SMMU_FEAT_SVA bit. For PCIe SVA, users also need to > check FEAT_ATS and FEAT_PRI. For platform SVA, they will have to check > FEAT_STALLS. > >

Re: [PATCH RESEND v9 07/13] iommu/arm-smmu-v3: Move definitions to a header

2020-09-08 Thread Auger Eric
Hi Jean, On 8/17/20 7:15 PM, Jean-Philippe Brucker wrote: > Allow sharing structure definitions with the upcoming SVA support for > Arm SMMUv3, by moving them to a separate header. We could surgically > extract only what is needed but keeping all definitions in one place > looks nicer. > >

Re: [PATCH RESEND v9 03/13] iommu/sva: Add PASID helpers

2020-09-08 Thread Auger Eric
Hi Jean, On 8/17/20 7:15 PM, Jean-Philippe Brucker wrote: > Let IOMMU drivers allocate a single PASID per mm. Store the mm in the > IOASID set to allow refcounting and searching mm by PASID, when handling > an I/O page fault. > > Reviewed-by: Lu Baolu > Signed-off-by: Jean-Philippe Brucker >

Re: [PATCH RESEND v9 08/13] iommu/arm-smmu-v3: Share process page tables

2020-09-08 Thread Auger Eric
Hi Jean, On 8/17/20 7:15 PM, Jean-Philippe Brucker wrote: > With Shared Virtual Addressing (SVA), we need to mirror CPU TTBR, TCR, > MAIR and ASIDs in SMMU contexts. Each SMMU has a single ASID space split > into two sets, shared and private. Shared ASIDs correspond to those > obtained from the

Re: [PATCH RESEND v9 09/13] iommu/arm-smmu-v3: Seize private ASID

2020-09-07 Thread Auger Eric
Hi Jean, On 8/17/20 7:15 PM, Jean-Philippe Brucker wrote: > The SMMU has a single ASID space, the union of shared and private ASID > sets. This means that the SMMU driver competes with the arch allocator > for ASIDs. Shared ASIDs are those of Linux processes, allocated by the > arch, and

Re: [PATCH v2 3/9] iommu/ioasid: Introduce ioasid_set APIs

2020-09-07 Thread Auger Eric
Hi Jacob, On 9/3/20 11:07 PM, Jacob Pan wrote: > On Tue, 1 Sep 2020 13:51:26 +0200 > Auger Eric wrote: > >> Hi Jacob, >> >> On 8/22/20 6:35 AM, Jacob Pan wrote: >>> ioasid_set was introduced as an arbitrary token that are shared by >>> a

Re: [PATCH v2 1/9] docs: Document IO Address Space ID (IOASID) APIs

2020-09-07 Thread Auger Eric
Hi Jacob, On 9/1/20 6:56 PM, Jacob Pan wrote: > Hi Eric, > > On Thu, 27 Aug 2020 18:21:07 +0200 > Auger Eric wrote: > >> Hi Jacob, >> On 8/24/20 12:32 PM, Jean-Philippe Brucker wrote: >>> On Fri, Aug 21, 2020 at 09:35:10PM -0700, Jacob Pan wrote: >

Re: [PATCH v3 0/6] Add virtio-iommu built-in topology

2020-09-04 Thread Auger Eric
Hi, On 8/21/20 3:15 PM, Jean-Philippe Brucker wrote: > Add a topology description to the virtio-iommu driver and enable x86 > platforms. > > Since [v2] we have made some progress on adding ACPI support for > virtio-iommu, which is the preferred boot method on x86. It will be a > new

Re: [PATCH v3 2/6] iommu/virtio: Add topology helpers

2020-09-04 Thread Auger Eric
Hi Jean, On 8/21/20 3:15 PM, Jean-Philippe Brucker wrote: > To support topology description from ACPI and from the builtin > description, add helpers to keep track of I/O topology descriptors. > > To ease re-use of the helpers by other drivers and future ACPI > extensions, use the "virt_" prefix

Re: [PATCH v3 5/6] iommu/virtio: Support topology description in config space

2020-09-04 Thread Auger Eric
if (!(features & BIT(VIRTIO_IOMMU_F_TOPOLOGY))) { > + pci_dbg(dev, "device doesn't have topology description"); > + goto out_reset; > + } > + > + ret = viommu_pci_find_capability(dev, VIRTIO_PCI_CAP_DEVICE_CFG, ); > + if

Re: [PATCH v3 4/6] iommu/virtio: Add topology definitions

2020-09-04 Thread Auger Eric
Hi Jean, On 8/21/20 3:15 PM, Jean-Philippe Brucker wrote: > Add struct definitions for describing endpoints managed by the > virtio-iommu. When VIRTIO_IOMMU_F_TOPOLOGY is offered, an array of > virtio_iommu_topo_* structures in config space describes the endpoints, > identified either by their

  1   2   3   4   5   6   7   >