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

2020-03-31 Thread Liu, Yi L
> From: Tian, Kevin > Sent: Wednesday, April 1, 2020 2:24 PM > To: Jacob Pan > Subject: RE: [PATCH V10 08/11] iommu/vt-d: Add svm/sva invalidate function > > > From: Jacob Pan > > Sent: Wednesday, April 1, 2020 2:14 AM > > > > On Sat, 28 Mar 2020 10:01:42 + > > "Tian, Kevin" wrote: > > > >

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

2020-03-31 Thread Tian, Kevin
> From: Jacob Pan > Sent: Wednesday, April 1, 2020 5:08 AM > > On Tue, 31 Mar 2020 03:34:22 + > "Tian, Kevin" wrote: > > > > From: Auger Eric > > > Sent: Monday, March 30, 2020 12:05 AM > > > > > > On 3/28/20 11:01 AM, Tian, Kevin wrote: > > > >> From: Jacob Pan > > > >> Sent: Saturday, M

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

2020-03-31 Thread Tian, Kevin
> From: Jacob Pan > Sent: Wednesday, April 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, > > > > > > On 3/28/20 11:01 AM, Tian, Kevin wrote: > > > >> From: Jacob Pan > > > >> S

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

2020-03-31 Thread Tian, Kevin
> From: Jacob Pan > Sent: Wednesday, April 1, 2020 2:14 AM > > On Sat, 28 Mar 2020 10:01:42 + > "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 pro

RE: [PATCH v1 1/8] vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free)

2020-03-31 Thread Liu, Yi L
> From: Tian, Kevin > Sent: Wednesday, April 1, 2020 1:43 PM > To: Liu, Yi L ; alex.william...@redhat.com; > Subject: RE: [PATCH v1 1/8] vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free) > > > From: Liu, Yi L > > Sent: Tuesday, March 31, 2020 9:22 PM > > > > > From: Tian, Kevin > > > Sent: Tuesday

RE: [PATCH v1 1/8] vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free)

2020-03-31 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Tuesday, March 31, 2020 9:22 PM > > > From: Tian, Kevin > > Sent: Tuesday, March 31, 2020 1:41 PM > > To: Liu, Yi L ; alex.william...@redhat.com; > > eric.au...@redhat.com > > Subject: RE: [PATCH v1 1/8] vfio: Add > VFIO_IOMMU_PASID_REQUEST(alloc/free) > > > > > From: L

RE: [PATCH v2 1/3] iommu/uapi: Define uapi version and capabilities

2020-03-31 Thread Tian, Kevin
> From: Jacob Pan > Sent: Tuesday, March 31, 2020 11:55 PM > > On Tue, 31 Mar 2020 06:06:38 + > "Tian, Kevin" wrote: > > > > From: Jacob Pan > > > Sent: Tuesday, March 31, 2020 12:08 AM > > > > > > On Mon, 30 Mar 2020 05:40:40 + > > > "Tian, Kevin" wrote: > > > > > > > > From: Jacob P

Re: [PATCH V10 10/11] iommu/vt-d: Enlightened PASID allocation

2020-03-31 Thread Jacob Pan
On Sat, 28 Mar 2020 10:08:52 + "Tian, Kevin" wrote: > > From: Jacob Pan > > Sent: Saturday, March 21, 2020 7:28 AM > > > > 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 > > Add

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

2020-03-31 Thread Jacob Pan
On Sat, 28 Mar 2020 10:04:38 + "Tian, Kevin" wrote: > > From: Jacob Pan > > Sent: Saturday, March 21, 2020 7:28 AM > > > > 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

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

2020-03-31 Thread Jacob Pan
On Sun, 29 Mar 2020 18:05:47 +0200 Auger Eric wrote: > 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 specifi

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

2020-03-31 Thread Jacob Pan
On Tue, 31 Mar 2020 03:34:22 + "Tian, Kevin" wrote: > > From: Auger Eric > > Sent: Monday, March 30, 2020 12:05 AM > > > > 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 enabl

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

2020-03-31 Thread Jacob Pan
On Tue, 31 Mar 2020 02:49:21 + "Tian, Kevin" wrote: > > From: Auger Eric > > Sent: Sunday, March 29, 2020 11:34 PM > > > > 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 (

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

2020-03-31 Thread Jacob Pan
On Sat, 28 Mar 2020 10:01:42 + "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 I

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

2020-03-31 Thread Auger Eric
Hi Jacob, On 3/31/20 6:08 PM, Jacob Pan wrote: > Actually, this is not a bug. The current code has: > #define QI_PC_PASID_SEL (QI_PC_TYPE | QI_PC_GRAN(1)) > > Which already has the type and shift. > > In my vSVA series, I redefined granu such that I can use them in the 2D > table loo

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: When Shared Virtual Memory is exposed to a guest via vIOMMU,

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

2020-03-31 Thread Jacob Pan
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: > > > When Shared Virtual Memory is exposed to a guest via vIOMMU, > > > scalable IOTLB invalidation may be passed down f

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

2020-03-31 Thread Jacob Pan
Actually, this is not a bug. The current code has: #define QI_PC_PASID_SEL (QI_PC_TYPE | QI_PC_GRAN(1)) Which already has the type and shift. In my vSVA series, I redefined granu such that I can use them in the 2D table lookup. -#define QI_PC_ALL_PASIDS (QI_PC_TYPE | QI_PC_GRAN

Re: [PATCH v2 1/3] iommu/uapi: Define uapi version and capabilities

2020-03-31 Thread Jacob Pan
On Tue, 31 Mar 2020 06:06:38 + "Tian, Kevin" wrote: > > From: Jacob Pan > > Sent: Tuesday, March 31, 2020 12:08 AM > > > > On Mon, 30 Mar 2020 05:40:40 + > > "Tian, Kevin" wrote: > > > > > > From: Jacob Pan > > > > Sent: Saturday, March 28, 2020 7:54 AM > > > > > > > > On Fri, 27 M

Re: [PATCH 08/10] iommu/ioasid: Introduce notifier APIs

2020-03-31 Thread Jacob Pan
On Sat, 28 Mar 2020 06:43:37 + "Tian, Kevin" wrote: > > From: Jacob Pan > > Sent: Saturday, March 28, 2020 2:37 AM > > > > On Fri, 27 Mar 2020 10:03:26 + > > "Tian, Kevin" wrote: > > > > > > From: Jacob Pan > > > > Sent: Thursday, March 26, 2020 1:55 AM > > > > > > > > IOASID users

Re: [PATCH] iommu/arm-smmu-v3: move error checking into common path

2020-03-31 Thread Robin Murphy
On 2020-03-31 2:59 pm, luanshi wrote: Move error checking into common path to be consistent with drivers/iommu/arm-smmu.c. Signed-off-by: Liguang Zhang --- drivers/iommu/arm-smmu-v3.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/iommu/arm-smmu-v3.c b

[PATCH] iommu/arm-smmu-v3: move error checking into common path

2020-03-31 Thread luanshi
Move error checking into common path to be consistent with drivers/iommu/arm-smmu.c. Signed-off-by: Liguang Zhang --- drivers/iommu/arm-smmu-v3.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index aa3ac2a

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 v1 1/8] vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free)

2020-03-31 Thread Liu, Yi L
> From: Tian, Kevin > Sent: Tuesday, March 31, 2020 1:41 PM > To: Liu, Yi L ; alex.william...@redhat.com; > eric.au...@redhat.com > Subject: RE: [PATCH v1 1/8] vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free) > > > From: Liu, Yi L > > Sent: Monday, March 30, 2020 10:37 PM > > > > > From: Tian, Kev

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

2020-03-31 Thread Liu, Yi L
Hi Hellwig, Thanks for your review, Hellwig. :-) inline reply. > From: Christoph Hellwig > Sent: Tuesday, March 31, 2020 3:56 PM > To: Liu, Yi L > Subject: Re: [PATCH v1 7/8] vfio/type1: Add VFIO_IOMMU_CACHE_INVALIDATE > > > @@ -2629,6 +2638,46 @@ static long vfio_iommu_type1_ioctl(void > *iom

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: [PATCH v1 1/8] vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free)

2020-03-31 Thread Christoph Hellwig
On Tue, Mar 31, 2020 at 08:36:32AM +, Liu, Yi L wrote: > > From: Liu, Yi L > > Sent: Tuesday, March 31, 2020 4:33 PM > > To: 'Christoph Hellwig' > > Subject: RE: [PATCH v1 1/8] vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free) > > > > > From: Christoph Hellwig > > > Sent: Tuesday, March 31, 202

RE: [PATCH v1 1/8] vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free)

2020-03-31 Thread Liu, Yi L
> From: Liu, Yi L > Sent: Tuesday, March 31, 2020 4:33 PM > To: 'Christoph Hellwig' > Subject: RE: [PATCH v1 1/8] vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free) > > > From: Christoph Hellwig > > Sent: Tuesday, March 31, 2020 3:54 PM > > To: Liu, Yi L > > Subject: Re: [PATCH v1 1/8] vfio: Add >

RE: [PATCH v1 1/8] vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free)

2020-03-31 Thread Liu, Yi L
> From: Christoph Hellwig > Sent: Tuesday, March 31, 2020 3:54 PM > To: Liu, Yi L > Subject: Re: [PATCH v1 1/8] vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free) > > Who is going to use thse exports? Please submit them together with > a driver actually using them. Hi Hellwig, Sorry, maybe I misu

RE: [PATCH v1 1/8] vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free)

2020-03-31 Thread Liu, Yi L
> From: Christoph Hellwig > Sent: Tuesday, March 31, 2020 3:54 PM > To: Liu, Yi L > Subject: Re: [PATCH v1 1/8] vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free) > > Who is going to use thse exports? Please submit them together with > a driver actually using them. Hi Hellwig, These are exposed f

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

2020-03-31 Thread Christoph Hellwig
> @@ -2629,6 +2638,46 @@ static long vfio_iommu_type1_ioctl(void *iommu_data, > } > kfree(gbind_data); > return ret; > + } else if (cmd == VFIO_IOMMU_CACHE_INVALIDATE) { Please refactor the spaghetti in this ioctl handler to use a switch statement and

Re: [PATCH v1 1/8] vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free)

2020-03-31 Thread Christoph Hellwig
Who is going to use thse exports? Please submit them together with a driver actually using them. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH] iommu/arm-smmu: Demote error messages to debug in shutdown callback

2020-03-31 Thread Sai Prakash Ranjan
Hi Will, On 2020-03-31 13:14, Will Deacon wrote: On Tue, Mar 31, 2020 at 01:06:11PM +0530, Sai Prakash Ranjan wrote: On 2020-03-30 23:54, Doug Anderson wrote: > On Sat, Mar 28, 2020 at 12:35 AM Sai Prakash Ranjan > wrote: > > > > > Of course the fact that in practice we'll *always* see the war

Re: [PATCH] iommu/arm-smmu: Demote error messages to debug in shutdown callback

2020-03-31 Thread Will Deacon
On Tue, Mar 31, 2020 at 01:06:11PM +0530, Sai Prakash Ranjan wrote: > On 2020-03-30 23:54, Doug Anderson wrote: > > On Sat, Mar 28, 2020 at 12:35 AM Sai Prakash Ranjan > > wrote: > > > > > > > Of course the fact that in practice we'll *always* see the warning > > > > because there's no way to tea

Re: [PATCH] iommu/arm-smmu: Demote error messages to debug in shutdown callback

2020-03-31 Thread Sai Prakash Ranjan
Hi, On 2020-03-30 23:54, Doug Anderson wrote: Hi, On Sat, Mar 28, 2020 at 12:35 AM Sai Prakash Ranjan wrote: > Of course the fact that in practice we'll *always* see the warning > because there's no way to tear down the default DMA domains, and even > if all devices *have* been nicely quiesc

Re: [PATCH v1 0/2] vfio/pci: expose device's PASID capability to VMs

2020-03-31 Thread Lu, Baolu
On 2020/3/31 14:35, Tian, Kevin wrote: From: Liu, Yi L Sent: Sunday, March 22, 2020 8:33 PM From: Liu Yi L Shared Virtual Addressing (SVA), a.k.a, Shared Virtual Memory (SVM) on Intel platforms allows address space sharing between device DMA and applications. SVA can reduce programming complexi