Global pages support is removed from VT-d spec 3.0 for dev TLB
invalidation. This patch is to remove the bits for vSVA. Similar change
already made for the native SVA. See the link below.
Link: https://lkml.org/lkml/2019/8/26/651
Acked-by: Lu Baolu
Signed-off-by: Jacob Pan
---
drivers/iommu
potential glitch do not warrant this unlikely
use case thereby removed by this patch.
Fixes: 56722a4398a30 ("iommu/vt-d: Add bind guest PASID support")
Acked-by: Lu Baolu
Cc: Kevin Tian
Cc: Lu Baolu
Signed-off-by: Liu Yi L
Signed-off-by: Jacob Pan
---
drivers/iommu/intel/
On Wed, 1 Jul 2020 08:49:54 +0800
Lu Baolu wrote:
> Hi Jacob,
>
> On 7/1/20 5:07 AM, Jacob Pan wrote:
> > DevTLB flush can be used for both DMA request with and without
> > PASIDs. The former uses PASID#0 (RID2PASID), latter uses non-zero
> > PASID for SVA usage.
On Wed, 1 Jul 2020 09:45:40 +0800
Lu Baolu wrote:
> Hi Jacob,
>
> On 7/1/20 1:34 AM, Jacob Pan wrote:
> > On Thu, 25 Jun 2020 18:10:43 +0800
> > Lu Baolu wrote:
> >
> >> Hi,
> >>
> >> On 2020/6/23 23:43, Jacob Pan wrote:
> >>
invalidate function")
Signed-off-by: Liu Yi L
Signed-off-by: Jacob Pan
---
drivers/iommu/intel/iommu.c | 28 ++--
1 file changed, 18 insertions(+), 10 deletions(-)
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index 96340da57075..6a0c62c73
Global pages support is removed from VT-d spec 3.0 for dev TLB
invalidation. This patch is to remove the bits for vSVA. Similar change
already made for the native SVA. See the link below.
Link: https://lkml.org/lkml/2019/8/26/651
Acked-by: Lu Baolu
Signed-off-by: Jacob Pan
---
drivers/iommu
potential glitch do not warrant this unlikely
use case thereby removed by this patch.
Fixes: 56722a4398a30 ("iommu/vt-d: Add bind guest PASID support")
Acked-by: Lu Baolu
Cc: Kevin Tian
Cc: Lu Baolu
Signed-off-by: Liu Yi L
Signed-off-by: Jacob Pan
---
drivers/iommu/intel/
rom Baolu
- Fixed addr field in devTLB flush (5/7)
- Assign address for single page devTLB invalidation (4/7)
- Coding style tweaks
Jacob Pan (4):
iommu/vt-d: Remove global page support in devTLB flush
iommu/vt-d: Fix PASID devTLB invalidation
iommu/vt-d: Warn on out
invalidation descriptor. Unrecoverable fault will be reported due to
non-zero value in the reserved bits.
Signed-off-by: Liu Yi L
Signed-off-by: Jacob Pan
---
drivers/iommu/intel/dmar.c | 20 ++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/drivers/iommu/intel/dmar.c b
be used by a single device, when tearing down a PASID entry
we shall flush only the devTLB specific to a PASID.
Fixes: 6f7db75e1c46 ("iommu/vt-d: Add second level page table")
Signed-off-by: Jacob Pan
---
drivers/iommu/intel/pasid.c | 11 ++-
1 file changed, 10 insertions(+),
to warning and proceed with invalidation request
with the given mask.
Signed-off-by: Jacob Pan
---
drivers/iommu/intel/iommu.c | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index 6a0c62c7395c..88e75be5ea76
From: Liu Yi L
Set proper masks to avoid invalid input spillover to reserved bits.
Acked-by: Lu Baolu
Signed-off-by: Liu Yi L
Signed-off-by: Jacob Pan
---
include/linux/intel-iommu.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/intel-iommu.h b
On Tue, 30 Jun 2020 02:52:45 +
"Tian, Kevin" wrote:
> > From: Jacob Pan
> > Sent: Tuesday, June 30, 2020 7:05 AM
> >
> > On Fri, 26 Jun 2020 16:19:23 -0600
> > Alex Williamson wrote:
> >
> > > On Tue, 23 Jun 2020 10:03:53 -0700
>
On Thu, 25 Jun 2020 18:10:43 +0800
Lu Baolu wrote:
> Hi,
>
> On 2020/6/23 23:43, Jacob Pan wrote:
> > For guest requested IOTLB invalidation, address and mask are
> > provided as part of the invalidation data. VT-d HW silently ignores
> > any address bits below th
On Thu, 25 Jun 2020 18:05:52 +0800
Lu Baolu wrote:
> Hi,
>
> On 2020/6/23 23:43, Jacob Pan wrote:
> > From: Liu Yi L
> >
> > Address information for device TLB invalidation comes from userspace
> > when device is directly assigned to a guest with vIOMMU suppor
On Tue, 30 Jun 2020 03:01:29 +
"Tian, Kevin" wrote:
> > From: Lu Baolu
> > Sent: Thursday, June 25, 2020 3:26 PM
> >
> > On 2020/6/23 23:43, Jacob Pan wrote:
> > > DevTLB flush can be used for both DMA request with and without
> > >
On Thu, 25 Jun 2020 15:25:57 +0800
Lu Baolu wrote:
> On 2020/6/23 23:43, Jacob Pan wrote:
> > DevTLB flush can be used for both DMA request with and without
> > PASIDs. The former uses PASID#0 (RID2PASID), latter uses non-zero
> > PASID for SVA usage.
> >
> >
On Fri, 26 Jun 2020 16:19:23 -0600
Alex Williamson wrote:
> On Tue, 23 Jun 2020 10:03:53 -0700
> Jacob Pan wrote:
>
> > IOMMU UAPI is newly introduced to support communications between
> > guest virtual IOMMU and host IOMMU. There has been lots of
> > discussions
On Wed, 24 Jun 2020 14:54:49 +0800
Lu Baolu wrote:
> Hi Jacob,
>
> On 2020/6/24 1:03, Jacob Pan wrote:
> > IOMMU UAPI data has a user filled argsz field which indicates the
> > data length comes with the API call. User data is not trusted,
> > argsz must be validated
On Wed, 24 Jun 2020 14:29:57 +0800
Lu Baolu wrote:
> > case IOMMU_CACHE_INV_TYPE_IOTLB:
> > /* HW will ignore LSB bits based on
> > address mask */ if (inv_info->granularity == IOMMU_INV_GRANU_ADDR &&
> > size &&
> > -
On Tue, 23 Jun 2020 08:43:14 -0700
Jacob Pan wrote:
> From: Liu Yi L
>
> For guest SVA usage, in order to optimize for less VMEXIT, guest
> request of IOTLB flush also includes device TLB.
>
> On the host side, IOMMU driver performs IOTLB and implicit devTLB
> inv
:
Documentation/userspace-api/iommu.rst
Signed-off-by: Liu Yi L
Signed-off-by: Jacob Pan
---
include/uapi/linux/iommu.h | 6 ++
1 file changed, 6 insertions(+)
diff --git a/include/uapi/linux/iommu.h b/include/uapi/linux/iommu.h
index e907b7091a46..303f148a5cd7 100644
--- a/include/uapi/linux
be parsed and sanitized before calling into the kernel
unbind function. Common user data copy code also consolidated.
Signed-off-by: Liu Yi L
Signed-off-by: Jacob Pan
---
drivers/iommu/iommu.c | 70 ++-
include/linux/iommu.h | 13 --
2
minimum size is the offset of the union.
To use offsetof() on the union, we must make it named.
Link: https://lkml.org/lkml/2020/6/11/834
Signed-off-by: Jacob Pan
---
drivers/iommu/intel/iommu.c | 24
drivers/iommu/intel/svm.c | 2 +-
include/uapi/linux/iommu.h | 4
extensions should be achieved are also covered
in this documentation.
Signed-off-by: Liu Yi L
Signed-off-by: Jacob Pan
---
Documentation/userspace-api/iommu.rst | 244 ++
1 file changed, 244 insertions(+)
create mode 100644 Documentation/userspace-api/iommu.rst
diff
Jacob Pan (5):
docs: IOMMU user API
iommu/uapi: Add argsz for user filled data
iommu/uapi: Use named union for user data
iommu/uapi: Handle data and argsz filled by users
iommu/uapi: Support both kernel and user unbind guest PASID
Documentation/userspace-api/iommu.rst | 244
increase.
Backward compatibility is ensured based on size and flags checking.
Details are documented in Documentation/userspace-api/iommu.rst
This patch adds sanity checks in both IOMMU layer and vendor code, where
VT-d is the only user for now.
Signed-off-by: Liu Yi L
Signed-off-by: Jacob Pan
Global pages support is removed from VT-d spec 3.0 for dev TLB
invalidation. This patch is to remove the bits for vSVA. Similar change
already made for the native SVA. See the link below.
Link: https://lkml.org/lkml/2019/8/26/651
Signed-off-by: Jacob Pan
---
drivers/iommu/intel/dmar.c | 4
invalidate function")
Signed-off-by: Liu Yi L
Signed-off-by: Jacob Pan
---
drivers/iommu/intel/iommu.c | 25 +
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index 96340da57075..5ea5732d5ec4 1006
From: Liu Yi L
Set proper masks to avoid invalid input spillover to reserved bits.
Signed-off-by: Liu Yi L
Signed-off-by: Jacob Pan
---
include/linux/intel-iommu.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/intel-iommu.h b/include/linux/intel
Hi Baolu and all,
This a series to address some of the issues we found in vSVA support.
Most of the patches deal with exception handling, we also removed some bits
that are not currently supported.
Many thanks to Kevin Tian's review.
Jacob & Yi
Jacob Pan (4):
iommu/vt-d: Remove gl
invalidation descriptor. Unrecoverable fault will be reported due to
non-zero value in the reserved bits.
Signed-off-by: Liu Yi L
Signed-off-by: Jacob Pan
---
drivers/iommu/intel/dmar.c | 19 +--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/drivers/iommu/intel/dmar.c b
be used by a single device, when tearing down a PASID entry
we shall flush only the devTLB specific to a PASID.
Fixes: 6f7db75e1c46 ("iommu/vt-d: Add second level page table")
Signed-off-by: Jacob Pan
---
drivers/iommu/intel/pasid.c | 11 ++-
1 file changed, 10 insertions(+),
to warning and proceed with invalidation request
with the given mask.
Signed-off-by: Jacob Pan
---
drivers/iommu/intel/iommu.c | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index 5ea5732d5ec4..50fc62413a35
potential glitch do not warrant this unlikely
use case thereby removed by this patch.
Cc: Kevin Tian
Cc: Lu Baolu
Signed-off-by: Liu Yi L
Signed-off-by: Jacob Pan
---
drivers/iommu/intel/svm.c | 22 +-
1 file changed, 9 insertions(+), 13 deletions(-)
diff --git a/drivers/iommu
On Thu, 11 Jun 2020 17:27:27 -0700
Jacob Pan wrote:
> >
> > But then I thought it even better if VFIO leaves the entire
> > copy_from_user() to the layer consuming it.
> >
> OK. Sounds good, that was what Kevin suggested also. I just wasn't
> sure how mu
Hi Jon,
On Thu, 11 Jun 2020 10:30:32 +0100
Jonathan Cameron wrote:
> On Wed, 10 Jun 2020 21:12:13 -0700
> Jacob Pan wrote:
>
> > IOMMU UAPI is newly introduced to support communications between
> > guest virtual IOMMU and host IOMMU. There has been lots of
> > d
On Thu, 11 Jun 2020 14:33:08 +0800
Lu Baolu wrote:
> Hi Jacob,
>
> On 2020/6/11 12:12, Jacob Pan wrote:
> > IOMMU UAPI is newly introduced to support communications between
> > guest virtual IOMMU and host IOMMU. There has been lots of
> > discussions on how it sho
On Fri, 12 Jun 2020 07:38:44 +
"Tian, Kevin" wrote:
> > From: Jacob Pan
> > Sent: Friday, June 12, 2020 8:27 AM
> >
> > On Thu, 11 Jun 2020 14:40:47 -0600
> > Alex Williamson wrote:
> >
> > > On Thu, 11 Jun 2020 12:52:0
On Thu, 11 Jun 2020 14:40:47 -0600
Alex Williamson wrote:
> On Thu, 11 Jun 2020 12:52:05 -0700
> Jacob Pan wrote:
>
> > Hi Alex,
> >
> > On Thu, 11 Jun 2020 09:47:41 -0600
> > Alex Williamson wrote:
> >
> > > On Wed, 1
On Thu, 11 Jun 2020 10:49:36 -0600
Alex Williamson wrote:
> On Wed, 10 Jun 2020 21:12:14 -0700
> 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
> >
On Thu, 11 Jun 2020 14:55:18 -0600
Alex Williamson wrote:
> On Thu, 11 Jun 2020 13:02:24 -0700
> Jacob Pan wrote:
>
> > On Thu, 11 Jun 2020 11:08:16 -0600
> > Alex Williamson wrote:
> >
> > > On Wed, 10 Jun 2020 21:12:15 -0700
> > > Jacob Pan
On Thu, 11 Jun 2020 11:08:16 -0600
Alex Williamson wrote:
> On Wed, 10 Jun 2020 21:12:15 -0700
> Jacob Pan wrote:
>
> > IOMMU UAPI data has an argsz field which is filled by user. As the
> > data structures expands, argsz may change. As the UAPI data are
>
Hi Alex,
On Thu, 11 Jun 2020 09:47:41 -0600
Alex Williamson wrote:
> On Wed, 10 Jun 2020 21:12:13 -0700
> Jacob Pan wrote:
>
> > IOMMU UAPI is newly introduced to support communications between
> > guest virtual IOMMU and host IOMMU. There has been lots of
> > d
Hi Jon,
On Thu, 11 Jun 2020 07:55:00 -0600
Jonathan Corbet wrote:
> On Wed, 10 Jun 2020 21:12:13 -0700
> Jacob Pan wrote:
>
> A little nit but...this pattern:
>
> > +pattern below:
> > +
> > +::
> > +
> > + struct {
> > + _
checks are performed in the model specific IOMMU drivers. This
patch adds sanity checks in the VT-d to ensure argsz passed by userspace
matches feature flags and other contents.
Signed-off-by: Jacob Pan
---
drivers/iommu/intel-iommu.c | 16
drivers/iommu/intel-svm.c | 12
:
Documentation/userspace-api/iommu.rst
Signed-off-by: Liu Yi L
Signed-off-by: Jacob Pan
---
include/uapi/linux/iommu.h | 6 ++
1 file changed, 6 insertions(+)
diff --git a/include/uapi/linux/iommu.h b/include/uapi/linux/iommu.h
index e907b7091a46..303f148a5cd7 100644
--- a/include/uapi/linux
each UAPI data
- Introduced UAPI doc
Jacob Pan (3):
docs: IOMMU user API
iommu/uapi: Add argsz for user filled data
iommu/vt-d: Sanity check uapi argsz filled by users
Documentation/userspace-api/iommu.rst | 210 ++
drivers/iommu/intel-iommu.c
extensions should be achieved are also covered
in this documentation.
Signed-off-by: Liu Yi L
Signed-off-by: Jacob Pan
---
Documentation/userspace-api/iommu.rst | 210 ++
1 file changed, 210 insertions(+)
create mode 100644 Documentation/userspace-api/iommu.rst
diff
On Fri, 29 May 2020 15:15:45 +0200
Joerg Roedel wrote:
> Applied, thanks.
>
> On Thu, May 28, 2020 at 11:03:51AM -0700, Jacob Pan wrote:
> > Make intel_svm_unbind_mm() a static function.
> >
> > Fixes: 064a57d7ddfc ("iommu/vt-d: Replace intel SVM APIs with
>
Make intel_svm_unbind_mm() a static function.
Fixes: 064a57d7ddfc ("iommu/vt-d: Replace intel SVM APIs with generic
SVA APIs")
Reported-by: kbuild test robot
Signed-off-by: Jacob Pan
---
drivers/iommu/intel-svm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dri
from the Intel people)
> > before going ahead with this.
> >
>
> Patch 2 in this series looks good to me.
>
> Acked-by: Lu Baolu
>
> +Jacob, he participated in the discussions.
>
Patch 2 looks good to me, VT-d has a similar flow and challenge to stop
DMA
Hi Christoph,
Thanks a lot for the reviews, comments below.
Jacob
On Wed, 13 May 2020 22:59:30 -0700
Christoph Hellwig wrote:
> > + if (dev_is_pci(dev)) {
> > + /* VT-d supports devices with full 20 bit PASIDs
> > only */
> > + if (pci_max_pasids(to_pci_dev(dev)) != PASID
On Wed, 13 May 2020 22:54:24 -0700
Christoph Hellwig wrote:
> > +* 1. CPU vs. IOMMU
> > +* 2. Guest vs. Host.
> > +*/
> > + switch (addr_width) {
> > +#ifdef CONFIG_X86
> > + case ADDR_WIDTH_5LEVEL:
> > + if (cpu_feature_enabled(X86_FEATURE_LA57) &&
> > + c
On Wed, 13 May 2020 22:51:32 -0700
Christoph Hellwig wrote:
> On Wed, May 13, 2020 at 04:01:43PM -0700, Jacob Pan wrote:
> > An Intel iommu domain uses 5-level page table by default. If the
> > iommu that the domain tries to attach supports less page levels,
> > the top lev
es for common APIs
(https://github.com/eauger/linux/tree/v5.1-rc3-2stage-v7)
- Addressed review comments from Andy Shevchenko and Alex Williamson
on
IOASID custom allocator.
- Support multiple custom IOASID allocators (vIOMMUs) and dynamic
registra
PASID namespace is system-
wide.
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: Liu, Yi L
Signed-off-by: Jacob Pan
Reviewed-by: Eric Auger
---
v12 - squashed virtual command register
| | |SL for GPA-HPA, default domain|
| | '--'
'-'
Where:
- FL = First level/stage one page tables
- SL = Second level/stage two page tables
Signed-off-by: Jacob Pan
Signed-off-by: Liu Yi L
---
v13 Only allow multiple bind if device has
device handle,
host IOMMU driver can replace certain fields before submit to the
invalidation queue.
Signed-off-by: Liu Yi L
Signed-off-by: Jacob Pan
Reviewed-by: Eric Auger
---
drivers/iommu/intel-iommu.c | 171
1 file changed, 171 insertions
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.
Signed-off-by: Jacob Pan
Reviewed-by: Eric Auger
An Intel iommu domain uses 5-level page table by default. If the
iommu that the domain tries to attach supports less page levels,
the top level page tables should be skipped. Add a helper to do
this so that it could be used in other places.
Signed-off-by: Jacob Pan
Reviewed-by: Eric Auger
Move domain helper to header to be used by SVA code.
Signed-off-by: Jacob Pan
Reviewed-by: Eric Auger
Reviewed-by: Kevin Tian
---
drivers/iommu/intel-iommu.c | 6 --
include/linux/intel-iommu.h | 6 ++
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/iommu/intel
s the enlightened PASID allocation/free interfaces
via the virtual command interface.
Signed-off-by: Liu Yi L
Signed-off-by: Lu Baolu
Signed-off-by: Jacob Pan
Reviewed-by: Eric Auger
Reviewed-by: Kevin Tian
---
drivers/iommu/intel-pasid.c | 57 +
dr
physical translation and
SL performs guest physical to host physical translation.
This patch adds a helper function for setting up nested translation
where second level comes from a domain and first level comes from
a guest PGD.
Signed-off-by: Jacob Pan
Signed-off-by: Liu Yi L
Reviewed-by: Eric
reused soon, we don't want to
> @@ -643,7 +645,8 @@ int intel_svm_unbind_mm(struct device *dev, int
> pasid)
>* to use. We have a *shared* PASID table,
> because it's
>* large and has to be physically
> contiguous. So it's
>* hard to be as defensive as we might like.
> */
> - intel_pasid_tear_down_entry(iommu, dev,
> svm->pasid);
> + intel_pasid_tear_down_entry(iommu, dev,
> + svm->pasid,
> false); intel_flush_svm_range_dev(svm, sdev, 0, -1, 0);
> kfree_rcu(sdev, rcu);
>
Reviewed-by: Jacob Pan
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
> struct intel_iommu *iommu)
> @@ -490,6 +550,8 @@ void __init intel_iommu_debugfs_init(void)
> debugfs_create_file("domain_translation_struct", 0444,
> intel_iommu_debug, NULL,
> &domain_translation_struct_fops);
> + debugfs_create_file("invalidation_queue", 0444,
> intel_iommu_debug,
> + NULL, &invalidation_queue_fops);
> #ifdef CONFIG_IRQ_REMAP
> debugfs_create_file("ir_translation_struct", 0444,
> intel_iommu_debug, NULL, &ir_translation_struct_fops);
[Jacob Pan]
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
On Tue, 5 May 2020 11:15:31 +0200
Jean-Philippe Brucker wrote:
> On Mon, May 04, 2020 at 01:47:23PM -0700, Jacob Pan wrote:
> > > > > + arm_smmu_write_ctx_desc(smmu_domain, mm->pasid,
> > > > > &invalid_cd); +
> > > > > + arm_smm
On Mon, 4 May 2020 18:43:51 +0200
Jean-Philippe Brucker wrote:
> On Thu, Apr 30, 2020 at 02:16:17PM -0700, Jacob Pan wrote:
> > > +static void arm_smmu_mm_invalidate_range(struct mmu_notifier *mn,
> > > +
On Mon, 4 May 2020 16:25:48 +0200
Jean-Philippe Brucker wrote:
> On Thu, Apr 30, 2020 at 11:39:31AM -0700, Jacob Pan wrote:
> > > +/**
> > > + * ioasid_get - obtain a reference to the IOASID
> > > + */
> > > +void ioasid_get(ioasid_t ioasid)
> &
On Mon, 4 May 2020 16:39:32 +0200
Jean-Philippe Brucker wrote:
> On Thu, Apr 30, 2020 at 01:48:42PM -0700, Jacob Pan wrote:
> > On Thu, 30 Apr 2020 11:39:31 -0700
> > Jacob Pan wrote:
> >
> > > > -void ioasid_free(ioasid_t ioasid)
> >
u/iommu-sva.c | 85 +
> drivers/iommu/of_iommu.c |5 +-
> drivers/pci/ats.c |4 +
> MAINTAINERS |3 +-
> 21 files changed, 2275 insertions(+), 158 deletions(-)
if (smmu_domain->stage != ARM_SMMU_DOMAIN_S1)
> + return ERR_PTR(-EINVAL);
> +
> + mutex_lock(&arm_smmu_sva_lock);
> + handle = __arm_smmu_sva_bind(dev, mm);
> + mutex_unlock(&arm_smmu_sva_lock);
> + return handle;
> +}
> +
> +static void arm_smmu_sva_unbind(struct iommu_sva *handle)
> +{
> + mutex_lock(&arm_smmu_sva_lock);
> + __arm_smmu_sva_unbind(handle);
> + mutex_unlock(&arm_smmu_sva_lock);
> +}
> +
> +static int arm_smmu_sva_get_pasid(struct iommu_sva *handle)
> +{
> + struct arm_smmu_bond *bond = sva_to_bond(handle);
> +
> + return bond->mm->pasid;
> +}
> +
> static struct platform_driver arm_smmu_driver;
>
> static
> @@ -3426,6 +3665,12 @@ static int arm_smmu_dev_disable_sva(struct
> device *dev) master->sva_enabled = false;
> mutex_unlock(&arm_smmu_sva_lock);
>
> + /*
> + * Since the MMU notifier ops are held in the domain, it is
> not safe to
> + * free the domain until all MMU notifiers are freed.
> + */
> + mmu_notifier_synchronize();
> +
> return 0;
> }
>
> @@ -3482,6 +3727,9 @@ static struct iommu_ops arm_smmu_ops = {
> .dev_feat_enabled = arm_smmu_dev_feature_enabled,
> .dev_enable_feat= arm_smmu_dev_enable_feature,
> .dev_disable_feat = arm_smmu_dev_disable_feature,
> + .sva_bind = arm_smmu_sva_bind,
> + .sva_unbind = arm_smmu_sva_unbind,
> + .sva_get_pasid = arm_smmu_sva_get_pasid,
> .pgsize_bitmap = -1UL, /* Restricted during
> device attach */ };
>
[Jacob Pan]
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
On Thu, 30 Apr 2020 11:39:31 -0700
Jacob Pan wrote:
> > -void ioasid_free(ioasid_t ioasid)
> > +bool ioasid_free(ioasid_t ioasid)
> > {
Sorry I missed this in the last reply.
I think free needs to be unconditional since there is not a good way to
fail it.
Also can we have m
;refs);
> + if (!free)
> + goto exit_unlock;
> +
Just FYI, we may need to add states for the IOASID, i.g. mark the IOASID
inactive after free. And prohibit ioasid_get() after freed. For VT-d,
this is useful when KVM queries the IOASID.
> active_allocator->ops-&
On Wed, 29 Apr 2020 16:12:01 +0200
Auger Eric wrote:
> >> in last review Eric raised the open about what about binding the
> >> same PASID to the same pdev multiple times. We discussed that
> >> should be disallowed. Here can you check whether aux_domain is
> >> enabled on pdev to restrict multip
On Wed, 29 Apr 2020 14:00:05 +0800
Lu Baolu wrote:
> Hi Jacob,
>
> On 2020/4/29 11:36, Jacob Pan wrote:
> > On Wed, 22 Apr 2020 16:06:10 +0800
> > Lu Baolu wrote:
> >
> >> When a PASID is stopped or terminated, there can be pending PRQs
> >>
gt;
> Signed-off-by: Jacob Pan
> Signed-off-by: Liu Yi L
> Signed-off-by: Lu Baolu
> ---
> drivers/iommu/intel-svm.c | 103
> ++-- include/linux/intel-iommu.h |
> 4 ++ 2 files changed, 102 insertions(+), 5 deletions(-)
>
> diff --
On Tue, 28 Apr 2020 13:59:43 -0700
"Luck, Tony" wrote:
> >> So the driver needs to use flush/drain operations to make sure all
> >> the in-flight work has completed before releasing/re-using the
> >> PASID.
> > Are you suggesting we should let driver also hold a reference of the
> > PASID?
>
On Tue, 28 Apr 2020 12:07:25 -0700
"Luck, Tony" wrote:
> > If fd release cleans up then how should there be something in
> > flight at the final mmdrop?
>
> ENQCMD from the user is only synchronous in that it lets the user
> know their request has been added to a queue (or not). Execution of
On Tue, 28 Apr 2020 20:54:01 +0200
Thomas Gleixner wrote:
> "Jacob Pan (Jun)" writes:
> > On Sun, 26 Apr 2020 16:55:25 +0200
> > Thomas Gleixner wrote:
> >> Fenghua Yu writes:
> >> > The PASID is freed when the process exits (so no need t
On Sun, 26 Apr 2020 16:55:25 +0200
Thomas Gleixner wrote:
> Fenghua Yu writes:
>
> > PASID is shared by all threads in a process. So the logical place
> > to keep track of it is in the "mm". Add the field to the
> > architecture specific mm_context_t structure.
> >
> > A PASID is allocated for
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 PASID ta
On Fri, 17 Apr 2020 23:46:13 +
"Tian, Kevin" wrote:
> > From: Jacob Pan
> > Sent: Friday, April 17, 2020 11:29 PM
> >
> > On Fri, 17 Apr 2020 09:46:55 +0200
> > Auger Eric wrote:
> >
> > > Hi Kevin,
> > > On 4/17/20 4:45
Hi Jean,
Sorry for the late reply, been trying to redesign the notification part.
On Tue, 7 Apr 2020 13:01:07 +0200
Jean-Philippe Brucker wrote:
> On Mon, Apr 06, 2020 at 01:02:45PM -0700, Jacob Pan wrote:
> > > > + sdata = kzalloc(sizeof(*sdata), GFP_KERNEL);
> > &
Baolu
Signed-off-by: Liu, Yi L
Signed-off-by: Jacob Pan
Reviewed-by: Eric Auger
---
drivers/iommu/dmar.c| 1 +
drivers/iommu/intel-iommu.c | 85 +
include/linux/intel-iommu.h | 7
3 files changed, 93 insertions(+)
diff --git a/drivers
Move domain helper to header to be used by SVA code.
Signed-off-by: Jacob Pan
Reviewed-by: Eric Auger
Reviewed-by: Kevin Tian
---
drivers/iommu/intel-iommu.c | 6 --
include/linux/intel-iommu.h | 6 ++
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/iommu/intel
An Intel iommu domain uses 5-level page table by default. If the
iommu that the domain tries to attach supports less page levels,
the top level page tables should be skipped. Add a helper to do
this so that it could be used in other places.
Signed-off-by: Jacob Pan
Reviewed-by: Eric Auger
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.
Signed-off-by: Jacob Pan
Reviewed-by: Eric Auger
physical translation and
SL performs guest physical to host physical translation.
This patch adds a helper function for setting up nested translation
where second level comes from a domain and first level comes from
a guest PGD.
Signed-off-by: Jacob Pan
Signed-off-by: Liu, Yi L
Reviewed-by
device handle,
host IOMMU driver can replace certain fields before submit to the
invalidation queue.
---
v12 - Use ratelimited prints for all user called APIs.
- Check for domain nesting attr
---
Signed-off-by: Jacob Pan
Signed-off-by: Ashok Raj
Signed-off-by: Liu, Yi L
Signed-off-by
s the enlightened PASID allocation/free interfaces
via the virtual command interface.
Signed-off-by: Liu Yi L
Signed-off-by: Lu Baolu
Signed-off-by: Jacob Pan
Reviewed-by: Eric Auger
Reviewed-by: Kevin Tian
---
drivers/iommu/intel-pasid.c | 57 +
dr
es for common APIs
(https://github.com/eauger/linux/tree/v5.1-rc3-2stage-v7)
- Addressed review comments from Andy Shevchenko and Alex Williamson
on
IOASID custom allocator.
- Support multiple custom IOASID allocators (vIOMMUs) and dynamic
registr
| | |SL for GPA-HPA, default domain|
| | '--'
'-'
Where:
- FL = First level/stage one page tables
- SL = Second level/stage two page tables
Signed-off-by: Jacob Pan
Signed-off-by: Liu, Yi L
---
ructure. That avoid the whole multiplexing
> > > layer.
> >
> > Right, I can see the appeal. I still like having a single mmu
> > notifier per mm because it ensures we allocate a single PASID per
> > mm (as required by x86). I suppos
; Because the IOMMUv2 supports only smaller PASIDs, we want to avoid
> exhausting that space with PASID allocations that don't use the
> IOMMUv2. So our PASID allocation function has a "size" parameter, and
> we try to allocated a PASID as big as possible in order to leav
On Thu, 16 Apr 2020 12:59:14 +0200
Auger Eric wrote:
> 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:
>
from happening, otherwise VFIO
> > also needs to track the bind count and do multiple unbinds at
> > mm_exit. But it's not necessary to prevent it in VFIO. We can check
> > here upon whether aux_domain is valid, and if not return -EBUSY.
> Ah OK. So if we can detect the case
On Wed, 15 Apr 2020 09:47:36 +0200
Jean-Philippe Brucker wrote:
> On Fri, Apr 10, 2020 at 08:52:49AM -0700, Jacob Pan wrote:
> > On Thu, 9 Apr 2020 16:50:58 +0200
> > Jean-Philippe Brucker wrote:
> >
> > > > So unbind is coming anyway, the difference i
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.
> > https://lkml.org/lkml/2020/4/14/939
> >
> > I think the pr
On Tue, 14 Apr 2020 23:47:40 +
"Tian, Kevin" wrote:
> > From: Jacob Pan
> > Sent: Wednesday, April 15, 2020 6:32 AM
> >
> > On Tue, 14 Apr 2020 10:13:04 -0700
> > Jacob Pan wrote:
> >
> > > > > > In any of the proposed s
401 - 500 of 1270 matches
Mail list logo