Re: [PATCH v11 05/10] iommu/vt-d: Add bind guest PASID support

2020-04-16 Thread Auger Eric
Hi Jacob, On 4/10/20 11:06 PM, Jacob Pan wrote: > Hi Eric, > > Missed a few things in the last reply. > > On Thu, 9 Apr 2020 09:41:32 +0200 > Auger Eric wrote: > >>> + intel_pasid_tear_down_entry(iommu, dev, >>> svm-&g

Re: [PATCH v11 05/10] iommu/vt-d: Add bind guest PASID support

2020-04-16 Thread Auger Eric
Hi Jacob, On 4/10/20 9:45 PM, Jacob Pan wrote: > Hi Eric, > > On Thu, 9 Apr 2020 09:41:32 +0200 > Auger Eric wrote: > >> Hi Jacob, >> >> On 4/3/20 8:42 PM, Jacob Pan wrote: >>> When supporting guest SVA with emulated IOMMU, the guest PASID >>>

Re: [PATCH v11 07/10] iommu/vt-d: Add svm/sva invalidate function

2020-04-16 Thread Auger Eric
Hi Jacob, On 4/10/20 11:56 PM, Jacob Pan wrote: > On Thu, 9 Apr 2020 10:50:34 +0200 > Auger Eric wrote: > >> Hi Jacob, >> >> On 4/3/20 8:42 PM, Jacob Pan wrote: >>> When Shared Virtual Address (SVA) is enabled for a guest OS via >>> vIOMMU, we need

Re: [PATCH v1 5/8] vfio/type1: Report 1st-level/stage-1 format to userspace

2020-04-08 Thread Auger Eric
Hi Yi, On 4/7/20 11:43 AM, Liu, Yi L wrote: > Hi Jean, > >> From: Jean-Philippe Brucker >> Sent: Friday, April 3, 2020 4:23 PM >> To: Auger Eric >> userspace >> >> On Wed, Apr 01, 2020 at 03:01:12PM +0200, Auger Eric wrote: >>>>>>

Re: [PATCH v11 04/10] iommu/vt-d: Add nested translation helper function

2020-04-08 Thread Auger Eric
Hi Jacob, On 4/3/20 8:42 PM, Jacob Pan wrote: > Nested translation mode is supported in VT-d 3.0 Spec.CH 3.8. > With PASID granular translation type set to 0x11b, translation > result from the first level(FL) also subject to a second level(SL) > page table translation. This mode is used for SVA

Re: [PATCH v1 5/8] vfio/type1: Report 1st-level/stage-1 format to userspace

2020-04-01 Thread Auger Eric
Hi Yi, On 3/22/20 1:32 PM, Liu, Yi L wrote: > From: Liu Yi L > > VFIO exposes IOMMU nesting translation (a.k.a dual stage translation) > capability to userspace. Thus applications like QEMU could support > vIOMMU with hardware's nesting translation capability for pass-through > devices. Before

Re: [PATCH v11 06/10] iommu/vt-d: Support flushing more translation cache types

2020-04-05 Thread Auger Eric
Hi Jacob, On 4/3/20 8:42 PM, Jacob Pan wrote: > When Shared Virtual Memory is exposed to a guest via vIOMMU, scalable > IOTLB invalidation may be passed down from outside IOMMU subsystems. > This patch adds invalidation functions that can be used for additional > translation cache types. > >

Re: [PATCH v11 03/10] iommu/vt-d: Use a helper function to skip agaw for SL

2020-04-05 Thread Auger Eric
other places. > > --- > v11 Added Baolu's commit message and squashed 4 & 5 from v10. > --- > > Signed-off-by: Jacob Pan > Signed-off-by: Lu Baolu Reviewed-by: Eric Auger Eric > --- > drivers/iommu/intel-pasid.c | 34 -- >

Re: [PATCH v2 3/3] iommu/virtio: Reject IOMMU page granule larger than PAGE_SIZE

2020-03-26 Thread Auger Eric
Hi Jean, On 3/26/20 10:35 AM, Jean-Philippe Brucker wrote: > We don't currently support IOMMUs with a page granule larger than the > system page size. The IOVA allocator has a BUG_ON() in this case, and > VFIO has a WARN_ON(). > > Removing these obstacles ranges doesn't seem possible without

Re: [PATCH] iommu/virtio: Reject IOMMU page granule larger than PAGE_SIZE

2020-03-25 Thread Auger Eric
Hi Jean, On 3/18/20 12:40 PM, Jean-Philippe Brucker wrote: > We don't currently support IOMMUs with a page granule larger than the > system page size. The IOVA allocator has a BUG_ON() in this case, and > VFIO has a WARN_ON(). > > It might be possible to remove these obstacles if necessary. If

Re: [PATCH V10 02/11] iommu/uapi: Define a mask for bind data

2020-03-27 Thread Auger Eric
Hi Jacob, On 3/21/20 12:27 AM, Jacob Pan wrote: > Memory type related flags can be grouped together for one simple check. > > --- > v9 renamed from EMT to MTS since these are memory type support flags. > --- > > Signed-off-by: Jacob Pan Reviewed-by: Eric Auger Thanks Eric > --- >

Re: [PATCH V10 07/11] iommu/vt-d: Support flushing more translation cache types

2020-03-27 Thread Auger Eric
Hi Jacob, On 3/21/20 12:27 AM, Jacob Pan wrote: > When Shared Virtual Memory is exposed to a guest via vIOMMU, scalable > IOTLB invalidation may be passed down from outside IOMMU subsystems. > This patch adds invalidation functions that can be used for additional > translation cache types. > >

Re: [PATCH v1 5/8] vfio/type1: Report 1st-level/stage-1 format to userspace

2020-04-01 Thread Auger Eric
Hi Yi, On 4/1/20 2:51 PM, Liu, Yi L wrote: > Hi Eric, > >> From: Auger Eric >> Sent: Wednesday, April 1, 2020 4:51 PM >> To: Liu, Yi L ; alex.william...@redhat.com >> Subject: Re: [PATCH v1 5/8] vfio/type1: Report 1st-level/stage-1 format to >> userspace >

Re: [PATCH v1 3/8] vfio/type1: Report PASID alloc/free support to userspace

2020-04-01 Thread Auger Eric
Yi, On 3/22/20 1:32 PM, Liu, Yi L wrote: > From: Liu Yi L > > This patch reports PASID alloc/free availability to userspace (e.g. QEMU) > thus userspace could do a pre-check before utilizing this feature. > > Cc: Kevin Tian > CC: Jacob Pan > Cc: Alex Williamson > Cc: Eric Auger > Cc:

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

2020-04-01 Thread Auger Eric
Hi Yi, On 4/1/20 3:18 PM, Liu, Yi L wrote: > Hi Eric, > > Just curious about your plan on this patch, I just heard my colleague would > like > to reference the functions from this patch in his dsa driver work. Well I intend to respin until somebody tells me it is completely vain or dead

Re: [PATCH V10 05/11] iommu/vt-d: Add nested translation helper function

2020-03-29 Thread Auger Eric
Hi Jacob, On 3/21/20 12:27 AM, Jacob Pan wrote: > Nested translation mode is supported in VT-d 3.0 Spec.CH 3.8. > With PASID granular translation type set to 0x11b, translation > result from the first level(FL) also subject to a second level(SL) > page table translation. This mode is used for SVA

Re: [PATCH V10 04/11] iommu/vt-d: Use helper function to skip agaw for SL

2020-03-27 Thread Auger Eric
Hi Jacob, On 3/27/20 12:55 PM, Tian, Kevin wrote: >> From: Jacob Pan >> Sent: Saturday, March 21, 2020 7:28 AM >> >> Signed-off-by: Jacob Pan >> --- >> drivers/iommu/intel-pasid.c | 14 -- >> 1 file changed, 4 insertions(+), 10 deletions(-) >> >> diff --git

Re: [PATCH] iommu/vt-d: Fix PASID cache flush

2020-03-31 Thread Auger Eric
Hi Jacob, On 3/31/20 1:25 AM, Jacob Pan wrote: > PASID cache type and shift of granularity bits are missing in > the current code. > > Fixes: 6f7db75e1c46 ("iommu/vt-d: Add second level page table > interface") > > Cc: Eric Auger > Signed-off-by: Jacob Pan Reviewed-by: Eric Auger Thanks

Re: [RFC PATCH] vfio: Ignore -ENODEV when getting MSI cookie

2020-03-31 Thread Auger Eric
Hi Andre, On 3/12/20 7:19 PM, Andre Przywara wrote: > When we try to get an MSI cookie for a VFIO device, that can fail if > CONFIG_IOMMU_DMA is not set. In this case iommu_get_msi_cookie() returns > -ENODEV, and that should not be fatal. > > Ignore that case and proceed with the initialisation.

Re: [PATCH] iommu/vt-d: Fix PASID cache flush

2020-03-31 Thread Auger Eric
Eric > > On Tue, 31 Mar 2020 11:28:17 +0200 > Auger Eric wrote: > >> Hi Jacob, >> >> On 3/31/20 1:25 AM, Jacob Pan wrote: >>> PASID cache type and shift of granularity bits are missing in >>> the current code. >>> >>> Fixes: 6f7db75e1c46

Re: [PATCH V10 07/11] iommu/vt-d: Support flushing more translation cache types

2020-03-31 Thread Auger Eric
Hi Jacob, On 3/31/20 6:13 PM, Jacob Pan wrote: > On Mon, 30 Mar 2020 16:28:34 -0700 > Jacob Pan wrote: > >> On Fri, 27 Mar 2020 15:46:23 +0100 >> Auger Eric wrote: >> >>> Hi Jacob, >>> >>> On 3/21/20 12:27 AM, Jacob Pan wrote: >>&g

Re: [PATCH V10 08/11] iommu/vt-d: Add svm/sva invalidate function

2020-03-29 Thread Auger Eric
Hi, On 3/28/20 11:01 AM, Tian, Kevin wrote: >> From: Jacob Pan >> Sent: Saturday, March 21, 2020 7:28 AM >> >> When Shared Virtual Address (SVA) is enabled for a guest OS via >> vIOMMU, we need to provide invalidation support at IOMMU API and driver >> level. This patch adds Intel VT-d specific

Re: [PATCH V10 08/11] iommu/vt-d: Add svm/sva invalidate function

2020-03-29 Thread Auger Eric
On 3/28/20 11:01 AM, Tian, Kevin wrote: >> From: Jacob Pan >> Sent: Saturday, March 21, 2020 7:28 AM >> >> When Shared Virtual Address (SVA) is enabled for a guest OS via >> vIOMMU, we need to provide invalidation support at IOMMU API and driver >> level. This patch adds Intel VT-d specific

Re: [PATCH V10 08/11] iommu/vt-d: Add svm/sva invalidate function

2020-03-29 Thread Auger Eric
Hi Jacob, On 3/21/20 12:27 AM, Jacob Pan wrote: > When Shared Virtual Address (SVA) is enabled for a guest OS via > vIOMMU, we need to provide invalidation support at IOMMU API and driver > level. This patch adds Intel VT-d specific function to implement > iommu passdown invalidate API for shared

Re: [PATCH V10 08/11] iommu/vt-d: Add svm/sva invalidate function

2020-04-01 Thread Auger Eric
l 1, 2020 4:58 AM >>> >>> On Tue, 31 Mar 2020 02:49:21 + >>> "Tian, Kevin" wrote: >>> >>>>> From: Auger Eric >>>>> Sent: Sunday, March 29, 2020 11:34 PM >>>>> >>>>> Hi, >>>>&g

Re: [PATCH V10 06/11] iommu/vt-d: Add bind guest PASID support

2020-03-29 Thread Auger Eric
Hi, On 3/21/20 12:27 AM, Jacob Pan wrote: > When supporting guest SVA with emulated IOMMU, the guest PASID > table is shadowed in VMM. Updates to guest vIOMMU PASID table > will result in PASID cache flush which will be passed down to > the host as bind guest PASID calls. > > For the SL page

Re: [PATCH v12 6/8] iommu/vt-d: Add svm/sva invalidate function

2020-04-29 Thread Auger Eric
Hi Jacob, On 4/21/20 8:52 PM, Jacob Pan wrote: > When Shared Virtual Address (SVA) is enabled for a guest OS via > vIOMMU, we need to provide invalidation support at IOMMU API and driver > level. This patch adds Intel VT-d specific function to implement > iommu passdown invalidate API for shared

Re: [PATCH v12 4/8] iommu/vt-d: Add bind guest PASID support

2020-04-29 Thread Auger Eric
Hi, On 4/27/20 10:34 PM, Jacob Pan wrote: > On Fri, 24 Apr 2020 10:47:45 + > "Tian, Kevin" wrote: > >>> From: Jacob Pan >>> Sent: Wednesday, April 22, 2020 2:53 AM >>> >>> When supporting guest SVA with emulated IOMMU, the guest PASID >>> table is shadowed in VMM. Updates to guest vIOMMU

Re: [PATCH v11 01/13] iommu: Introduce attach/detach_pasid_table API

2020-04-15 Thread Auger Eric
Hi Jacob, On 4/15/20 12:15 AM, Jacob Pan wrote: > Hi Eric, > > There are some discussions about how to size the uAPI data. > https://lkml.org/lkml/2020/4/14/939 > > I think the problem with the current scheme is that when uAPI data gets > extended, if VFIO continue to use: > > minsz =

Re: [PATCH v11 01/13] iommu: Introduce attach/detach_pasid_table API

2020-04-15 Thread Auger Eric
Hi Jacob, On 4/15/20 5:59 PM, Jacob Pan wrote: > On Wed, 15 Apr 2020 16:52:10 +0200 > Auger Eric wrote: > >> Hi Jacob, >> On 4/15/20 12:15 AM, Jacob Pan wrote: >>> Hi Eric, >>> >>> There are some discussions about how to size the uAPI data. &

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

2020-05-07 Thread Auger Eric
Hi Shameer, On 5/7/20 8:59 AM, Shameerali Kolothum Thodi wrote: > Hi Eric, > >> -Original Message- >> From: Shameerali Kolothum Thodi >> Sent: 30 April 2020 10:38 >> To: 'Auger Eric' ; Zhangfei Gao >> ; eric.auger@gmail.com; >> i

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

2020-05-13 Thread Auger Eric
Hi Shameer, On 5/7/20 8:59 AM, Shameerali Kolothum Thodi wrote: > Hi Eric, > >> -Original Message- >> From: Shameerali Kolothum Thodi >> Sent: 30 April 2020 10:38 >> To: 'Auger Eric' ; Zhangfei Gao >> ; eric.auger@gmail.com; >> i

Re: [PATCH v5] iommu/virtio: Use page size bitmap supported by endpoint

2020-05-07 Thread Auger Eric
Hi, On 5/6/20 2:22 AM, Michael S. Tsirkin wrote: > On Tue, May 05, 2020 at 03:00:04PM +0530, Bharat Bhushan wrote: >> Different endpoint can support different page size, probe >> endpoint if it supports specific page size otherwise use >> global page sizes. >> >> Signed-off-by: Bharat Bhushan >>

Re: [EXT] Re: [PATCH v5] iommu/virtio: Use page size bitmap supported by endpoint

2020-05-07 Thread Auger Eric
Hi, On 5/7/20 1:32 PM, Michael S. Tsirkin wrote: > On Thu, May 07, 2020 at 11:24:29AM +, Bharat Bhushan wrote: >> >> >>> -Original Message- >>> From: Michael S. Tsirkin >>> Sent: Wednesday, May 6, 2020 5:53 AM >>> To: Bharat Bhushan >>> Cc: jean-phili...@linaro.org; j...@8bytes.org;

Re: [EXT] Re: [PATCH v5] iommu/virtio: Use page size bitmap supported by endpoint

2020-05-07 Thread Auger Eric
Hi Bharat, On 5/7/20 1:24 PM, Bharat Bhushan wrote: > > >> -Original Message- >> From: Michael S. Tsirkin >> Sent: Wednesday, May 6, 2020 5:53 AM >> To: Bharat Bhushan >> Cc: jean-phili...@linaro.org; j...@8bytes.org; jasow...@redhat.com; >> virtualizat...@lists.linux-foundation.org;

Re: [PATCH] iommu/virtio: Reject IOMMU page granule larger than PAGE_SIZE

2020-03-18 Thread Auger Eric
Hi, On 3/18/20 1:00 PM, Robin Murphy wrote: > On 2020-03-18 11:40 am, Jean-Philippe Brucker wrote: >> We don't currently support IOMMUs with a page granule larger than the >> system page size. The IOVA allocator has a BUG_ON() in this case, and >> VFIO has a WARN_ON(). Adding Alex in CC in case

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

2020-09-01 Thread Auger Eric
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 that is > group of IOASIDs. For example, if IOASID #1 and #2 are allocated via the > same ioasid_set*, they are viewed as to belong to the same set. two IOASIDs allocated via the

Re: [PATCH v2 2/9] iommu/ioasid: Rename ioasid_set_data()

2020-09-01 Thread Auger Eric
Hi jacob, On 8/22/20 6:35 AM, Jacob Pan wrote: > Rename ioasid_set_data() to ioasid_attach_data() to avoid confusion with > struct ioasid_set. ioasid_set is a group of IOASIDs that share a common > token. > > Signed-off-by: Jacob Pan Reviewed-by: Eric Auger Eric > --- >

Re: [PATCH v2 4/9] iommu/ioasid: Add reference couting functions

2020-09-01 Thread Auger Eric
Hi Jacob, On 8/22/20 6:35 AM, Jacob Pan wrote: > There can be multiple users of an IOASID, each user could have hardware > contexts associated with the IOASID. In order to align lifecycles, > reference counting is introduced in this patch. It is expected that when > an IOASID is being freed, each

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 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 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 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 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 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 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 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 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 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 v3 1/6] iommu/virtio: Move to drivers/iommu/virtio/

2020-09-04 Thread Auger Eric
Hi Jean, On 8/21/20 3:15 PM, Jean-Philippe Brucker wrote: > Before adding new files to the virtio-iommu driver, move it to its own > subfolder, similarly to other IOMMU drivers. > > Signed-off-by: Jean-Philippe Brucker > --- > drivers/iommu/Makefile| 3 +-- >

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

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

2020-09-03 Thread Auger Eric
Hi Jacob, On 8/31/20 8:25 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 v8 6/7] iommu/uapi: Handle data and argsz filled by users

2020-09-03 Thread Auger Eric
Hi Jacob, On 8/31/20 8:24 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: [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 v2 7/9] iommu/vt-d: Listen to IOASID notifications

2020-09-01 Thread Auger Eric
Hi Jacob, On 8/22/20 6:35 AM, Jacob Pan wrote: > On Intel Scalable I/O Virtualization (SIOV) enabled platforms, IOMMU > driver is one of the users of IOASIDs. In normal flow, callers will > perform IOASID allocation, bind, unbind, and free in order. However, for > guest SVA, IOASID free could

Re: [PATCH v2 9/9] iommu/vt-d: Store guest PASID during bind

2020-09-01 Thread Auger Eric
Hi Jacob, On 8/22/20 6:35 AM, Jacob Pan wrote: > IOASID core maintains the guest-host mapping in the form of SPID and > IOASID. This patch assigns the guest PASID (if valid) as SPID while > binding guest page table with a host PASID. This mapping will be used > for lookup and notifications. > >

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

2020-09-01 Thread Auger Eric
Hi Jacob, On 8/22/20 6:35 AM, Jacob Pan wrote: > Relations among IOASID users largely follow a publisher-subscriber > pattern. E.g. to support guest SVA on Intel Scalable I/O Virtualization > (SIOV) enabled platforms, VFIO, IOMMU, device drivers, KVM are all users > of IOASIDs. When a state

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

2020-09-01 Thread Auger Eric
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 allocations. IOASIDs within the VM must have a > host/physical IOASID backing, mapping between guest and host IOASIDs can > be non-identical. IOASID set

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 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-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 v6 02/15] iommu: Report domain nesting info

2020-08-18 Thread Auger Eric
Hi Jacob, On 8/18/20 6:21 AM, Jacob Pan wrote: > On Sun, 16 Aug 2020 14:40:57 +0200 > Auger Eric wrote: > >> Hi Yi, >> >> On 8/14/20 9:15 AM, Liu, Yi L wrote: >>> Hi Eric, >>> >>>> From: Auger Eric >>>> Sent: Thursday, Au

Re: [PATCH v6 08/15] iommu: Pass domain to sva_unbind_gpasid()

2020-08-21 Thread Auger Eric
Hi, On 8/20/20 11:06 PM, Alex Williamson wrote: > On Mon, 27 Jul 2020 23:27:37 -0700 > Liu Yi L wrote: > >> From: Yi Sun >> >> Current interface is good enough for SVA virtualization on an assigned >> physical PCI device, but when it comes to mediated devices, a physical >> device may attached

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

2020-08-27 Thread Auger Eric
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: >> IOASID is used to identify address spaces that can be targeted by device >> DMA. It is a system-wide resource that is essential to its many users. >> This document is an

Re: [PATCH v6 15/15] iommu/vt-d: Support reporting nesting capability info

2020-08-17 Thread Auger Eric
On 8/17/20 9:05 AM, Liu, Yi L wrote: > Hi Eric, > >> Auger Eric >> Sent: Sunday, August 16, 2020 8:01 PM >> >> Hi Yi, >> >> On 7/28/20 8:27 AM, Liu Yi L wrote: >>> This patch reports nesting info, and only supports the case where all >&g

Re: [PATCH v6 07/15] vfio/type1: Add VFIO_IOMMU_PASID_REQUEST (alloc/free)

2020-08-15 Thread Auger Eric
Yi, On 7/28/20 8:27 AM, Liu Yi L wrote: > This patch allows userspace to request PASID allocation/free, e.g. when > serving the request from the guest. > > PASIDs that are not freed by userspace are automatically freed when the > IOASID set is destroyed when process exits. > > Cc: Kevin Tian >

Re: [PATCH v6 09/15] iommu/vt-d: Check ownership for PASIDs from user-space

2020-08-15 Thread Auger Eric
Hi Yi, On 7/28/20 8:27 AM, Liu Yi L wrote: > When an IOMMU domain with nesting attribute is used for guest SVA, a > system-wide PASID is allocated for binding with the device and the domain. > For security reason, we need to check the PASID passed from user-space. > e.g. page table bind/unbind

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: [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: [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 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 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 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: [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: [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 PATCH] iommu/arm-smmu: Add module parameter to set msi iova address

2020-05-28 Thread Auger Eric
Hi, On 5/27/20 7:30 PM, Robin Murphy wrote: > On 2020-05-27 17:03, Srinath Mannam wrote: >> This patch gives the provision to change default value of MSI IOVA base >> to platform's suitable IOVA using module parameter. The present >> hardcoded MSI IOVA base may not be the accessible IOVA ranges

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

2020-05-28 Thread Auger Eric
Hi, On 5/28/20 9:23 AM, Jean-Philippe Brucker wrote: > On Thu, May 28, 2020 at 10:45:14AM +0530, Srinath Mannam wrote: >> On Wed, May 27, 2020 at 11:00 PM Robin Murphy wrote: >>> >> Thanks Robin for your quick response. >>> On 2020-05-27 17:03, Srinath Mannam wrote: This patch gives the

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

2020-05-28 Thread Auger Eric
Hi, On 5/28/20 10:38 AM, Jean-Philippe Brucker wrote: > [+ Shameer] > > On Thu, May 28, 2020 at 09:43:46AM +0200, Auger Eric wrote: >> Hi, >> >> On 5/28/20 9:23 AM, Jean-Philippe Brucker wrote: >>> On Thu, May 28, 2020 at 10:45:14AM +0530, Srinath Mannam wrote

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

2020-05-28 Thread Auger Eric
On 5/28/20 11:15 AM, Shameerali Kolothum Thodi wrote: > > >> -Original Message----- >> From: Auger Eric [mailto:eric.au...@redhat.com] >> Sent: 28 May 2020 09:54 >> To: Jean-Philippe Brucker >> Cc: Will Deacon ; Joerg Roedel ; >> iommu@lists

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

2020-05-28 Thread Auger Eric
Hi Shameer, On 5/28/20 2:09 PM, Shameerali Kolothum Thodi wrote: > > >> -Original Message----- >> From: Auger Eric [mailto:eric.au...@redhat.com] >> Sent: 28 May 2020 12:48 >> To: Shameerali Kolothum Thodi ; >> Jean-Philippe Brucker >> Cc: Robin Mu

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 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: [PATCH v5 07/15] vfio/type1: Add VFIO_IOMMU_PASID_REQUEST (alloc/free)

2020-07-19 Thread Auger Eric
Yi, On 7/12/20 1:21 PM, Liu Yi L wrote: > This patch allows user space to request PASID allocation/free, e.g. when > serving the request from the guest. > > PASIDs that are not freed by userspace are automatically freed when the > IOASID set is destroyed when process exits. > > Cc: Kevin Tian

Re: [PATCH v5 05/15] vfio: Add PASID allocation/free support

2020-07-19 Thread Auger Eric
Yi, On 7/12/20 1:21 PM, Liu Yi L wrote: > Shared Virtual Addressing (a.k.a Shared Virtual Memory) allows sharing > multiple process virtual address spaces with the device for simplified > programming model. PASID is used to tag an virtual address space in DMA > requests and to identify the

Re: [PATCH v5 06/15] iommu/vt-d: Support setting ioasid set to domain

2020-07-19 Thread Auger Eric
Yi, On 7/12/20 1:21 PM, Liu Yi L wrote: > From IOMMU p.o.v., PASIDs allocated and managed by external components > (e.g. VFIO) will be passed in for gpasid_bind/unbind operation. IOMMU > needs some knowledge to check the PASID ownership, hence add an interface > for those components to tell the

Re: [PATCH v5 08/15] iommu: Pass domain to sva_unbind_gpasid()

2020-07-19 Thread Auger Eric
*data); > > - int (*sva_unbind_gpasid)(struct device *dev, int pasid); > + int (*sva_unbind_gpasid)(struct iommu_domain *domain, > + struct device *dev, ioasid_t pasid); > > int (*def_domain_type)(struct device *dev); > > Besides Reviewed-by: Eric Auger Eric ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH v5 09/15] iommu/vt-d: Check ownership for PASIDs from user-space

2020-07-19 Thread Auger Eric
Hi Yi, On 7/12/20 1:21 PM, Liu Yi L wrote: > When an IOMMU domain with nesting attribute is used for guest SVA, a > system-wide PASID is allocated for binding with the device and the domain. > For security reason, we need to check the PASID passsed from user-space. passed > e.g. page table

Re: [PATCH v7 1/7] docs: IOMMU user API

2020-08-12 Thread Auger Eric
main *domain, > + struct device *dev, > + void __user *udata) > + > +In-kernel caller :: > + > + int iommu_sva_unbind_gpasid(struct iommu_domain *domain, > + struct device *

Re: [PATCH v7 2/7] iommu/uapi: Add argsz for user filled data

2020-08-12 Thread Auger Eric
Hi, On 7/30/20 2:21 AM, Jacob Pan wrote: > As IOMMU UAPI gets extended, user data size may increase. To support > backward compatibiliy, this patch introduces a size field to each UAPI s/compatibiliy/compatibility > data structures. It is *always* the responsibility for the user to fill in > the

Re: [PATCH v7 5/7] iommu/uapi: Rename uapi functions

2020-08-13 Thread Auger Eric
Hi Jacob, On 7/30/20 2:21 AM, Jacob Pan wrote: > User APIs such as iommu_sva_unbind_gpasid() may also be used by the > kernel. Since we introduced user pointer to the UAPI functions, Practically this is done in the next patch. What about something like: We plan to have two flavors of the same

Re: [PATCH v6 06/15] iommu/vt-d: Support setting ioasid set to domain

2020-08-13 Thread Auger Eric
- a/include/linux/iommu.h > +++ b/include/linux/iommu.h > @@ -124,6 +124,7 @@ enum iommu_attr { > DOMAIN_ATTR_FSL_PAMUV1, > DOMAIN_ATTR_NESTING,/* two stages of translation */ > DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE, > + DOMAIN_ATTR_IOASID_SID, > DOMAIN_ATTR_MAX, > }; > > Besides Reviewed-by: Eric Auger Eric ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH v6 04/15] vfio/type1: Report iommu nesting info to userspace

2020-08-13 Thread Auger Eric
Hi Yi, On 7/28/20 8:27 AM, Liu Yi L wrote: > This patch exports iommu nesting capability info to user space through > VFIO. Userspace is expected to check this info for supported uAPIs (e.g. > PASID alloc/free, bind page table, and cache invalidation) and the vendor > specific format information

Re: [PATCH v6 05/15] vfio: Add PASID allocation/free support

2020-08-13 Thread Auger Eric
Yi, On 7/28/20 8:27 AM, Liu Yi L wrote: > Shared Virtual Addressing (a.k.a Shared Virtual Memory) allows sharing > multiple process virtual address spaces with the device for simplified > programming model. PASID is used to tag an virtual address space in DMA > requests and to identify the

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

2020-08-13 Thread Auger Eric
Hi Jacob, On 7/30/20 2:21 AM, Jacob Pan wrote: > IOMMU generic layer already does sanity checks UAPI data for version > match and argsz range under generic information. > Remove the redundant version check from VT-d driver and check for vendor > specific data size. > > Signed-off-by: Jacob Pan

Re: [PATCH v6 02/15] iommu: Report domain nesting info

2020-08-13 Thread Auger Eric
Yi, On 7/28/20 8:27 AM, Liu Yi L wrote: > IOMMUs that support nesting translation needs report the capability info s/needs/need to > to userspace. It gives information about requirements the userspace needs > to implement plus other features characterizing the physical implementation. > > This

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

2020-08-13 Thread Auger Eric
Hi Jacob, On 7/30/20 2:21 AM, 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: [PATCH v7 6/7] iommu/uapi: Handle data and argsz filled by users

2020-08-13 Thread Auger Eric
Hi Yi, On 8/13/20 11:25 AM, Liu, Yi L wrote: > Hi Eric, > > >> From: Auger Eric >> Sent: Thursday, August 13, 2020 5:12 PM >> >> Hi Jacob, >> >> On 7/30/20 2:21 AM, Jacob Pan wrote: >>> IOMMU user APIs are responsible for proc

<    1   2   3   4   5   6   7   >