Re: [PATCH v4 05/22] iommu: Introduce cache_invalidate API

2019-03-05 Thread Auger Eric
Hi Kevin, Yi, On 3/5/19 4:28 PM, Jean-Philippe Brucker wrote: > On 18/02/2019 13:54, Eric Auger wrote: >> From: "Liu, Yi L" >> >> In any virtualization use case, when the first translation stage >> is "owned" by the guest OS, the host IOMMU driver has no knowledge >> of caching structure updates

Re: [PATCH v4 02/22] iommu: introduce device fault data

2019-03-06 Thread Auger Eric
Hi Jean, On 3/5/19 3:56 PM, Jean-Philippe Brucker wrote: > On 18/02/2019 13:54, Eric Auger wrote: >> From: Jacob Pan >> >> Device faults detected by IOMMU can be reported outside the IOMMU >> subsystem for further processing. This patch introduces >> a generic device fault data structure. >> >> T

Re: [PATCH v4 02/22] iommu: introduce device fault data

2019-03-06 Thread Auger Eric
Hi Jean, On 3/5/19 3:56 PM, Jean-Philippe Brucker wrote: > On 18/02/2019 13:54, Eric Auger wrote: >> From: Jacob Pan >> >> Device faults detected by IOMMU can be reported outside the IOMMU >> subsystem for further processing. This patch introduces >> a generic device fault data structure. >> >> T

Re: [PATCH v4 02/22] iommu: introduce device fault data

2019-03-06 Thread Auger Eric
Hi Jean, On 3/5/19 3:56 PM, Jean-Philippe Brucker wrote: > On 18/02/2019 13:54, Eric Auger wrote: >> From: Jacob Pan >> >> Device faults detected by IOMMU can be reported outside the IOMMU >> subsystem for further processing. This patch introduces >> a generic device fault data structure. >> >> T

Re: [PATCH v4 02/22] iommu: introduce device fault data

2019-03-06 Thread Auger Eric
Hi Jean, On 3/6/19 5:07 PM, Jean-Philippe Brucker wrote: > On 06/03/2019 14:30, Auger Eric wrote: >>>> +#define IOMMU_FAULT_PAGE_REQUEST_LAST_PAGE(1 << 1) >>>> +#define IOMMU_FAULT_PAGE_REQUEST_PRIV_DATA(1 << 2) >>>> + __u32

Re: [PATCH v5 05/22] iommu: Introduce cache_invalidate API

2019-03-17 Thread Auger Eric
Hi Jacob, On 3/15/19 7:37 PM, Jacob Pan wrote: > On Fri, 15 Mar 2019 17:08:49 +0100 > Eric Auger wrote: > >> From: "Liu, Yi L" >> >> In any virtualization use case, when the first translation stage >> is "owned" by the guest OS, the host IOMMU driver has no knowledge >> of caching structure upd

Re: [PATCH v5 05/22] iommu: Introduce cache_invalidate API

2019-03-18 Thread Auger Eric
Hi Jean, On 3/18/19 12:01 PM, Jean-Philippe Brucker wrote: > On 17/03/2019 16:43, Auger Eric wrote: >>>> diff --git a/include/uapi/linux/iommu.h b/include/uapi/linux/iommu.h >>>> index 532a64075f23..e4c6a447e85a 100644 >>>> --- a/include/uapi/linux/iommu.

Re: [PATCH v6 05/22] iommu: Introduce cache_invalidate API

2019-03-21 Thread Auger Eric
Hi Jacob, Jean-Philippe, On 3/20/19 5:50 PM, Jean-Philippe Brucker wrote: > On 20/03/2019 16:37, Jacob Pan wrote: > [...] >>> +struct iommu_inv_addr_info { >>> +#define IOMMU_INV_ADDR_FLAGS_PASID (1 << 0) >>> +#define IOMMU_INV_ADDR_FLAGS_ARCHID(1 << 1) >>> +#define IOMMU_INV_ADDR_FLAGS_LE

Re: [PATCH v6 05/22] iommu: Introduce cache_invalidate API

2019-03-21 Thread Auger Eric
Hi jean, Jacob, On 3/21/19 3:13 PM, Jean-Philippe Brucker wrote: > On 21/03/2019 13:54, Auger Eric wrote: >> Hi Jacob, Jean-Philippe, >> >> On 3/20/19 5:50 PM, Jean-Philippe Brucker wrote: >>> On 20/03/2019 16:37, Jacob Pan wrote: >>> [...] >>>

Re: [PATCH v6 05/22] iommu: Introduce cache_invalidate API

2019-03-22 Thread Auger Eric
Hi Jacob, On 3/21/19 11:10 PM, Jacob Pan wrote: > On Thu, 21 Mar 2019 15:32:45 +0100 > Auger Eric wrote: > >> Hi jean, Jacob, >> >> On 3/21/19 3:13 PM, Jean-Philippe Brucker wrote: >>> On 21/03/2019 13:54, Auger Eric wrote: >>>> Hi Jacob, J

Re: [PATCH v6 07/22] vfio: VFIO_IOMMU_ATTACH/DETACH_PASID_TABLE

2019-03-22 Thread Auger Eric
Hi Alex, On 3/21/19 11:19 PM, Alex Williamson wrote: > On Sun, 17 Mar 2019 18:22:17 +0100 > Eric Auger wrote: > >> From: "Liu, Yi L" >> >> This patch adds VFIO_IOMMU_ATTACH/DETACH_PASID_TABLE ioctl >> which aims to pass/withdraw the virtual iommu guest configuration >> to/from the VFIO driver d

Re: [PATCH v6 02/22] iommu: introduce device fault data

2019-03-22 Thread Auger Eric
Hi Jacob, On 3/21/19 11:04 PM, Jacob Pan wrote: > On Sun, 17 Mar 2019 18:22:12 +0100 > Eric Auger wrote: > >> From: Jacob Pan >> >> Device faults detected by IOMMU can be reported outside the IOMMU >> subsystem for further processing. This patch introduces >> a generic device fault data structu

Re: [PATCH v6 09/22] vfio: VFIO_IOMMU_BIND/UNBIND_MSI

2019-03-22 Thread Auger Eric
Hi Alex, On 3/22/19 12:01 AM, Alex Williamson wrote: > On Sun, 17 Mar 2019 18:22:19 +0100 > Eric Auger wrote: > >> This patch adds the VFIO_IOMMU_BIND/UNBIND_MSI ioctl which aim >> to pass/withdraw the guest MSI binding to/from the host. >> >> Signed-off-by: Eric Auger >> >> --- >> v3 -> v4: >>

Re: [PATCH v6 00/22] SMMUv3 Nested Stage Setup

2019-03-22 Thread Auger Eric
Hi, On 3/17/19 6:22 PM, Eric Auger wrote: > This series allows a virtualizer to program the nested stage mode. > This is useful when both the host and the guest are exposed with > an SMMUv3 and a PCI device is assigned to the guest using VFIO. > > In this mode, the physical IOMMU must be programm

Re: [PATCH v2] iommu/arm-smmu-v3: Add SMMUv3.2 range invalidation support

2020-02-24 Thread Auger Eric
Hi Rob, On 2/13/20 8:54 PM, Rob Herring wrote: > On Thu, Jan 30, 2020 at 9:06 AM Auger Eric wrote: >> >> Hi Rob, >> On 1/17/20 10:16 PM, Rob Herring wrote: >>> Arm SMMUv3.2 adds support for TLB range invalidate operations. >>> Support for range invalidate i

Re: [RFC PATCH 01/11] vfio: Remove Calxeda XGMAC reset driver

2020-02-24 Thread Auger Eric
Hi Rob, Alex, On 2/18/20 6:13 PM, Rob Herring wrote: > Cc: Eric Auger > Cc: Alex Williamson > Cc: Cornelia Huck > Cc: k...@vger.kernel.org > Signed-off-by: Rob Herring > --- > Do not apply yet. > > drivers/vfio/platform/reset/Kconfig | 8 -- > drivers/vfio/platform/reset/Makefile

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

2020-02-25 Thread Auger Eric
Hi Jacob, On 2/15/20 12:27 AM, Jacob Pan wrote: > Hi Eric, > > On Wed, 12 Feb 2020 13:55:25 +0100 > Auger Eric wrote: > >> Hi Jacob, >> >> On 1/29/20 7:01 AM, Jacob Pan wrote: >>> When Shared Virtual Memory is exposed to a guest via vIOMMU, >>

Re: [PATCH v2 1/3] iommu/virtio: Add topology description to virtio-iommu config space

2020-03-03 Thread Auger Eric
Hi Joerg, On 3/2/20 5:16 PM, Joerg Roedel wrote: > On Fri, Feb 28, 2020 at 06:25:36PM +0100, Jean-Philippe Brucker wrote: >> This solution isn't elegant nor foolproof, but is the best we can do at >> the moment and works with existing virtio-iommu implementations. It also >> enables an IOMMU for l

Re: [PATCH v9 00/11] SMMUv3 Nested Stage Setup (VFIO part)

2020-03-03 Thread Auger Eric
Hi Zhangfei, On 3/3/20 1:57 PM, zhangfei wrote: > Hi, Eric > > On 2019/11/20 下午6:18, Auger Eric wrote: >> >>>> This series brings the VFIO part of HW nested paging support >>>> in the SMMUv3. >>>> >>>> The series depends

Re: [PATCH v2 1/3] iommu/virtio: Add topology description to virtio-iommu config space

2020-03-03 Thread Auger Eric
Hi Michael, Joerg, On 3/3/20 5:09 PM, Michael S. Tsirkin wrote: > On Tue, Mar 03, 2020 at 04:53:19PM +0100, Joerg Roedel wrote: >> On Tue, Mar 03, 2020 at 09:00:05AM -0500, Michael S. Tsirkin wrote: >>> Not necessarily. E.g. some power systems have neither. >>> There are also systems looking to by

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

2020-03-16 Thread Auger Eric
Hi Andre, On 3/13/20 3:08 PM, Robin Murphy wrote: > On 2020-03-12 6: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. >> >> Ignor

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 h

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 th

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 majo

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 > --- > include/u

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. > > Si

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 a/drivers/iommu/intel-pas

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 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 tabl

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 f

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 fun

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] 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 Eri

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 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] iommu/vt-d: Fix PASID cache flush

2020-03-31 Thread Auger Eric
anks 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: 6f7db75

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 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 se

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: Jean-Ph

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 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 follows

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

2020-04-04 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 v11 06/10] iommu/vt-d: Support flushing more translation cache types

2020-04-04 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. > > Sign

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 vi

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

2020-04-09 Thread Auger Eric
Hi Jacob, On 4/3/20 8:42 PM, 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 v11 07/10] iommu/vt-d: Add svm/sva invalidate function

2020-04-09 Thread Auger Eric
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 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 vi

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

2020-04-09 Thread Auger Eric
Hi Jean, On 4/9/20 10:14 AM, Jean-Philippe Brucker wrote: > On Wed, Apr 08, 2020 at 12:27:58PM +0200, Auger Eric wrote: >> Hi Yi, >> >> On 4/7/20 11:43 AM, Liu, Yi L wrote: >>> Hi Jean, >>> >>>> From: Jean-Philippe Brucker >>&

Re: [PATCH v11 08/10] iommu/vt-d: Cache virtual command capability register

2020-04-09 Thread Auger Eric
Hi Jacob, On 4/3/20 8:42 PM, Jacob Pan wrote: > Virtual command registers are used in the guest only, to prevent > vmexit cost, we cache the capability and store it during initialization. > > Signed-off-by: Jacob Pan > Reviewed-by: Eric Auger > Reviewed-by: Lu Baolu nit: following Joerg's comm

Re: [PATCH v11 10/10] iommu/vt-d: Add custom allocator for IOASID

2020-04-09 Thread Auger Eric
Hi Jacob, On 4/3/20 8:42 PM, Jacob Pan wrote: > When VT-d driver runs in the guest, PASID allocation must be > performed via virtual command interface. This patch registers a > custom IOASID allocator which takes precedence over the default > XArray based allocator. The resulting IOASID allocation

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

2020-04-09 Thread Auger Eric
Hi Yi, On 4/9/20 2:47 PM, Liu, Yi L wrote: > Hi Jean, > >> From: Jean-Philippe Brucker >> Sent: Thursday, April 9, 2020 4:15 PM >> Subject: Re: [PATCH v1 5/8] vfio/type1: Report 1st-level/stage-1 format to >> userspace >> >> On Wed, Apr 08, 2020 at 12:

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 = offsetofen

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-04-16 Thread Auger Eric
Hi Zhangfei, On 4/16/20 6:25 AM, Zhangfei Gao wrote: > > > On 2020/4/14 下午11:05, Eric Auger wrote: >> This version fixes an issue observed by Shameer on an SMMU 3.2, >> when moving from dual stage config to stage 1 only config. >> The 2 high 64b of the STE now get reset. Otherwise, leaving the >

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 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 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 7/8] vfio/type1: Add VFIO_IOMMU_CACHE_INVALIDATE

2020-04-16 Thread Auger Eric
Hi Kevin, On 4/16/20 2:09 PM, Tian, Kevin wrote: >> From: Liu, Yi L >> Sent: Thursday, April 16, 2020 6:40 PM >> >> Hi Alex, >> Still have a direction question with you. Better get agreement with you >> before heading forward. >> >>> From: Alex Williamson >>> Sent: Friday, April 3, 2020 11:35 PM

Re: [PATCH v1 7/8] vfio/type1: Add VFIO_IOMMU_CACHE_INVALIDATE

2020-04-16 Thread Auger Eric
Hi Kevin, On 4/16/20 3:28 PM, Tian, Kevin wrote: >> From: Auger Eric >> Sent: Thursday, April 16, 2020 8:43 PM >> >> Hi Kevin, >> On 4/16/20 2:09 PM, Tian, Kevin wrote: >>>> From: Liu, Yi L >>>> Sent: Thursday, April 16, 2020 6:40 PM >&g

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

2020-04-17 Thread Auger Eric
Hi Kevin, On 4/17/20 4:45 AM, Tian, Kevin wrote: >> From: Auger Eric >> Sent: Thursday, April 16, 2020 6:43 PM >> > [...] >>>>> + if (svm) { >>>>> + /* >>>>> + * If we found svm for the PASID, there must be at

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 v

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 PA

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;

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; i

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: [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: [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;

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 of

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 prov

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 v2] iommu: revisit iommu_insert_resv_region() implementation

2019-08-21 Thread Auger Eric
Hi Christoph, On 8/6/19 9:32 AM, Christoph Hellwig wrote: > A couple nitpicks below: > > On Thu, Aug 01, 2019 at 05:59:46PM +0200, Eric Auger wrote: >> - * The new element is sorted by address with respect to the other >> - * regions of the same type. In case it overlaps with another >> - * regio

Re: [PATCH 0/5] iommu: Implement iommu_put_resv_regions_simple()

2019-09-16 Thread Auger Eric
Hi Thierry, On 8/29/19 1:17 PM, Thierry Reding wrote: > From: Thierry Reding > > Most IOMMU drivers only need to free the memory allocated for each > reserved region. Instead of open-coding the loop to do this in each > driver, extract the code into a common function that can be used by > all th

Plumber VFIO/IOMMU/PCI "Dual Stage SMMUv3 Status" Follow-up

2019-09-20 Thread Auger Eric
Hi Will, As a follow-up of the VFIO/IOMMU/PCI "Dual Stage SMMUv3 Status" session, please find some further justifications about the SMMUv3 nested stage enablement series. In the text below, I only talk about use cases featuring VFIO assigned devices where the physical IOMMU is actually involved.

Re: [PATCH v4 0/4] User API for nested shared virtual address (SVA)

2019-10-15 Thread Auger Eric
Hi, On 10/2/19 9:42 PM, Jacob Pan wrote: > This set consists of IOMMU APIs to support SVA in the guest, a.k.a nested > SVA. As the complete SVA support is complex, we break down the enabling > effort into three stages: > 1. PCI device direct assignment > 2. Fault handling, especially page request

Re: [PATCH v7 01/11] iommu/vt-d: Cache virtual command capability register

2019-11-08 Thread Auger Eric
ecap; > + u64 vccap; > u32 gcmd; /* Holds TE, EAFL. Don't need SRTP, SFL, WBF */ > raw_spinlock_t register_lock; /* protect register handling */ > int seq_id; /* sequence id of the iommu */ > with DMA_VCS_PAS

Re: [PATCH v7 02/11] iommu/vt-d: Enlightened PASID allocation

2019-11-08 Thread Auger Eric
Hi Jacob, On 10/24/19 9:54 PM, Jacob Pan wrote: > From: Lu Baolu > > Enabling IOMMU in a guest requires communication with the host > driver for certain aspects. Use of PASID ID to enable Shared Virtual > Addressing (SVA) requires managing PASID's in the host. VT-d 3.0 spec > provides a Virtual C

Re: [PATCH v7 03/11] iommu/vt-d: Add custom allocator for IOASID

2019-11-08 Thread Auger Eric
Hi Jacob, On 10/24/19 9:54 PM, Jacob Pan wrote: > When VT-d driver runs in the guest, PASID allocation must be > performed via virtual command interface. This patch registers a > custom IOASID allocator which takes precedence over the default > XArray based allocator. The resulting IOASID allocati

Re: [PATCH v7 04/11] iommu/vt-d: Replace Intel specific PASID allocator with IOASID

2019-11-08 Thread Auger Eric
Hi Jacob, On 10/24/19 9:54 PM, Jacob Pan wrote: > Make use of generic IOASID code to manage PASID allocation, > free, and lookup. Replace Intel specific code. > > Signed-off-by: Jacob Pan > --- > drivers/iommu/intel-iommu.c | 12 ++-- > drivers/iommu/intel-pasid.c | 36 -

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

2019-11-08 Thread Auger Eric
Hi Jacob, On 10/24/19 9:55 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 v7 10/11] iommu/vt-d: Support flushing more translation cache types

2019-11-08 Thread Auger Eric
Hi Jacob, On 10/24/19 9:55 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. > > Si

Re: [PATCH v7 06/11] iommu/vt-d: Avoid duplicated code for PASID setup

2019-11-12 Thread Auger Eric
Hi Jacob, On 10/24/19 9:54 PM, Jacob Pan wrote: > After each setup for PASID entry, related translation caches must be flushed. > We can combine duplicated code into one function which is less error prone. > > Signed-off-by: Jacob Pan > --- > drivers/iommu/intel-pasid.c | 48 >

Re: [PATCH v7 04/11] iommu/vt-d: Replace Intel specific PASID allocator with IOASID

2019-11-12 Thread Auger Eric
Hi Jacob, On 11/8/19 11:55 PM, Jacob Pan wrote: > On Fri, 8 Nov 2019 12:30:31 +0100 > Auger Eric wrote: > >> Hi Jacob, >> >> On 10/24/19 9:54 PM, Jacob Pan wrote: >>> Make use of generic IOASID code to manage PASID allocation, >>> free, and lookup

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

2019-11-12 Thread Auger Eric
Hi Jacob, On 10/24/19 9:55 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 v9 00/11] SMMUv3 Nested Stage Setup (VFIO part)

2019-11-12 Thread Auger Eric
Hi Shameer, On 11/12/19 12:08 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 Eric Auger >> Sent: 11 July 2019 14:56 >> To: eric.auger@gmail.com; eric.au.

Re: [PATCH v9 00/11] SMMUv3 Nested Stage Setup (VFIO part)

2019-11-12 Thread Auger Eric
Hi Shameer, On 11/12/19 2:06 PM, Shameerali Kolothum Thodi wrote: > Hi Eric, > >> -Original Message----- >> From: Auger Eric [mailto:eric.au...@redhat.com] >> Sent: 12 November 2019 11:29 >> To: Shameerali Kolothum Thodi ; >> eric.auger@gmail.c

Re: [PATCH v9 00/11] SMMUv3 Nested Stage Setup (VFIO part)

2019-11-12 Thread Auger Eric
Hi Shameer, On 11/12/19 6:56 PM, Shameerali Kolothum Thodi wrote: > Hi Eric, > >> -Original Message- >> From: Shameerali Kolothum Thodi >> Sent: 12 November 2019 14:21 >> To: 'Auger Eric' ; eric.auger@gmail.com; >> iommu@lists.linux-foun

Re: [RFC v2 1/3] vfio: VFIO_IOMMU_CACHE_INVALIDATE

2019-11-12 Thread Auger Eric
Hi Yi, On 11/6/19 2:31 AM, Liu, Yi L wrote: >> From: Alex Williamson [mailto:alex.william...@redhat.com] >> Sent: Wednesday, November 6, 2019 6:42 AM >> To: Liu, Yi L >> Subject: Re: [RFC v2 1/3] vfio: VFIO_IOMMU_CACHE_INVALIDATE >> >> On Fri, 25 Oct 2019 11:20:40 + >> "Liu, Yi L" wrote: >>

Re: [PATCH] iommu/arm-smmu-v3: Populate VMID field for CMDQ_OP_TLBI_NH_VA

2019-11-13 Thread Auger Eric
Hi Shameer, On 11/13/19 5:11 PM, Shameer Kolothum wrote: > CMDQ_OP_TLBI_NH_VA requires VMID and this was missing since > commit 1c27df1c0a82 ("iommu/arm-smmu: Use correct address mask > for CMD_TLBI_S2_IPA"). Add it back. > > Fixes: 1c27df1c0a82 ("iommu/arm-smmu: Use correct address mask for > C

Re: [PATCH v3 3/8] iommu/vt-d: Reject SVM bind for failed capability check

2019-11-20 Thread Auger Eric
Hi Jacob, On 11/19/19 6:56 PM, Jacob Pan wrote: > Add a check during SVM bind to ensure CPU and IOMMU hardware capabilities > are met. > > Signed-off-by: Jacob Pan > Acked-by: Lu Baolu I sent my Rb on v2: Reviewed-by: Eric Auger Thanks Eric > --- > drivers/iommu/intel-svm.c | 3 +++ > 1 fil

Re: [PATCH v3 1/8] iommu/vt-d: Fix CPU and IOMMU SVM feature matching checks

2019-11-20 Thread Auger Eric
Hi Jacob, On 11/19/19 6:56 PM, Jacob Pan wrote: > Shared Virtual Memory(SVM) is based on a collective set of hardware > features detected at runtime. There are requirements for matching CPU > and IOMMU capabilities. > > The current code checks CPU and IOMMU feature set for SVM support but > the r

Re: [PATCH v3 5/8] iommu/vt-d: Fix off-by-one in PASID allocation

2019-11-20 Thread Auger Eric
d-off-by: Jacob Pan > Acked-by: Lu Baolu same (v2) Reviewed-by: Eric Auger Eric > --- > drivers/iommu/intel-svm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iommu/intel-svm.c b/drivers/iommu/intel-svm.c > index 74df10a39dfc..e90d

Re: [PATCH v3 4/8] iommu/vt-d: Avoid duplicated code for PASID setup

2019-11-20 Thread Auger Eric
Lu Baolu I sent my R-b already on v2: Reviewed-by: Eric Auger Eric > --- > drivers/iommu/intel-pasid.c | 48 > + > 1 file changed, 18 insertions(+), 30 deletions(-) > > diff --git a/drivers/iommu/intel-pasid.c b/drivers/i

Re: [PATCH v3 6/8] iommu/vt-d: Replace Intel specific PASID allocator with IOASID

2019-11-20 Thread Auger Eric
Hi Jacob, On 11/19/19 6:56 PM, Jacob Pan wrote: > Make use of generic IOASID code to manage PASID allocation, > free, and lookup. Replace Intel specific code. > IOASID allocator is inclusive for both start and end of the allocation > range. The current code is based on IDR, which is exclusive for

Re: [PATCH v3 7/8] iommu/vt-d: Avoid sending invalid page response

2019-11-20 Thread Auger Eric
alidation descriptor > support") > Signed-off-by: Jacob Pan > Acked-by: Lu Baolu R-b sent on v2 Reviewed-by: Eric Auger Eric > --- > drivers/iommu/intel-svm.c | 7 +++ > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/iommu/intel-svm.c

Re: [PATCH v3 2/8] iommu/vt-d: Match CPU and IOMMU paging mode

2019-11-20 Thread Auger Eric
Hi Jacob, On 11/19/19 6:56 PM, Jacob Pan wrote: > When setting up first level page tables for sharing with CPU, we need > to ensure IOMMU can support no less than the levels supported by the > CPU. > > It is not adequate, as in the current code, to set up 5-level paging > in PASID entry First Leve

Re: "Revisit iommu_insert_resv_region() implementation" causes use-after-free

2019-11-24 Thread Auger Eric
Hi, On 11/22/19 4:06 PM, Qian Cai wrote: > Read files under /sys/kernel/iommu_groups/ triggers an use-after-free. > Reverted > the commit 4dbd258ff63e ("iommu: Revisit iommu_insert_resv_region() > implementation") fixed the issue. Thanks for testing and reporting this. I've worked on this durin

Re: "Revisit iommu_insert_resv_region() implementation" causes use-after-free

2019-11-25 Thread Auger Eric
Hi, On 11/22/19 4:06 PM, Qian Cai wrote: > Read files under /sys/kernel/iommu_groups/ triggers an use-after-free. > Reverted > the commit 4dbd258ff63e ("iommu: Revisit iommu_insert_resv_region() > implementation") fixed the issue. > > /* no merge needed on elements of different types than @nr */

Re: [PATCH] iommu/vt-d: Set ISA bridge reserved region as relaxable

2019-12-12 Thread Auger Eric
Hi Alex, On 12/11/19 9:28 PM, Alex Williamson wrote: > Commit d850c2ee5fe2 ("iommu/vt-d: Expose ISA direct mapping region via > iommu_get_resv_regions") created a direct-mapped reserved memory region > in order to replace the static identity mapping of the ISA address > space, where the latter was

<    1   2   3   4   5   6   7   >