Re: Re: Crash/hang in iommu_flush_dev_iotlb

2016-11-07 Thread Jacob Pan
Hi Brian, I suspect it might be a race condition that causes domain == NULL in iommu_flush_dev_iotlb(). Can you help me reproduce it? what workload and device you are using etc. Thanks, Jacob ___ iommu mailing list iommu@lists.linux-foundation.org

Re: [PATCH] iommu/intel-iommu: fix pasid table size encoding

2016-12-06 Thread Jacob Pan
On Tue, 6 Dec 2016 17:31:11 +0100 Joerg Roedel <j...@8bytes.org> wrote: > Hi Jacob, > > On Thu, Dec 01, 2016 at 01:50:26PM -0800, Jacob Pan wrote: > > diff --git a/drivers/iommu/intel-iommu.c > > b/drivers/iommu/intel-iommu.c index 27596e6..f112aa9 100644 > >

Re: [PATCH v2] iommu/intel-iommu: fix pasid table size encoding

2016-12-12 Thread Jacob Pan
Hi Joerg/David, Just wondering if you have any more comments? Thanks, Jacob On Tue, 6 Dec 2016 10:14:23 -0800 Jacob Pan <jacob.jun@linux.intel.com> wrote: > Different encodings are used to represent supported PASID bits > and number of PASID table entries. > The curre

[PATCH] iommu/intel-iommu: fix pasid table size encoding

2016-12-01 Thread Jacob Pan
the allocation limitation of PASID table. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> --- drivers/iommu/intel-iommu.c | 27 ++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 2

Re: [PATCH] iommu/intel-iommu: fix pasid table size encoding

2016-12-05 Thread Jacob Pan
Hi David, Any thoughts on this one? Without this patch Kabylake would fail with IOMMU error when svm is initialized. Thanks, Jacob On Thu, 1 Dec 2016 13:50:26 -0800 Jacob Pan <jacob.jun@linux.intel.com> wrote: > Different encodings are used to represent supported PASID bits >

Re: [PATCH] iommu/vt-d: Make sure IOMMUs are off when intel_iommu=off

2017-03-29 Thread Jacob Pan
* boot into a kexec kernel and the previous kernel > left > + * them enabled > + */ > + intel_disable_iommus(); > goto out_free_dmar; > + } > > if (list_empty(_rmrr_units)) > pr_info(&qu

Re: [RFC PATCH 29/30] vfio: Add support for Shared Virtual Memory

2017-03-21 Thread jacob pan
On Tue, 21 Mar 2017 19:37:56 + Jean-Philippe Brucker wrote: > > For invalidation, I've following info in in pseudo code. > > struct iommu_svm_tlb_invalidate_info > > { > >__u32 inv_type; > > #define IOTLB_INV (1 << 0) > > #define

Re: [RFC 0/9] IOMMU driver support for shared virtual memory virtualization

2017-08-16 Thread Jacob Pan
On Wed, 16 Aug 2017 11:44:30 +0200 Joerg Roedel <j...@8bytes.org> wrote: > On Tue, Jun 27, 2017 at 12:47:54PM -0700, Jacob Pan wrote: > > At the top level, three new IOMMU interfaces are introduced: > > - bind PASID table > > - passdown invalidation > > - pe

Re: [Qemu-devel] [RFC PATCH 7/8] VFIO: Add new IOCTL for IOMMU TLB invalidate propagation

2017-07-19 Thread Jacob Pan
of the invalidation queue > > if a user is effectively given direct access? Will the > > invalidation data be sanitized by the iommu driver? > > > > > union intel_iommu_invalidate_data { > > > struct { > > > __u64 low; > > > __u64 high; > > > } invalidate_data; > > > > > > struct { > > > __u64 type: 4; > > > __u64 gran: 2; > > > __u64 rsv1: 10; > > > __u64 did: 16; > > > __u64 sid: 16; > > > __u64 func_mask: 2; > > > __u64 rsv2: 14; > > > __64 rsv3: 64; > > > } context_cache_inv; > > > > > > > Here's part of the issue with not fully defining these, we have did, > > sid, and func_mask. I think we're claiming that the benefit of > > passing through the hardware data structure is performance, but the > > user needs to replace these IDs to match the physical device rather > > than the virtual device, perhaps even entirely recreating it > > because there's not necessarily a 1:1 mapping of things like > > func_mask between virtual and physical hardware topologies > > (assuming I'm interpreting these fields correctly). Doesn't the > > kernel also need to validate any such field to prevent the user > > spoofing entries for other devices? Is there any actual > > performance benefit remaining vs defining a generic interface after > > multiple levels have manipulated, recreated, and sanitized these > > structures? We can't evaluate these sorts of risks if we don't > > define what we're passing through. Thanks, > > A potential proposal is to abstract the fields of the QI entry. > However, here is a concern for it. Different type of QI entry would > have diferent fields. It means we need to have a hyper set to include > all the possible fields. Supposedly, the set would increase as more > QI type is introduced. I'm not sure if it is an acceptable definition. > > Based on the latest spec, the vendor-specific fields may have: > > Global hint > Drain read/write > Source-ID > MIP > PFSID > My thinking was that as long as the risk of having some opaque data is limited to the device that is already exposed to the user space, it should be fine. We have model specific IOMMU driver to sanitize the data before putting the descriptor into hardware. But I agree the overhead of disassemble/assemble may not be significant. Though with vIOMMU and caching mode = 1 (requires explicit invalidation of caches regardless present or not, VT-d spec 6.1), we will see more invalidation than the native pIOMMU case. Anyway, we can do some micro benchmark to see the overhead. > PRQ response is another topic. Not included here. > > Thanks, > Yi L > [Jacob Pan] ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

[PATCH 4/9] iommu/vt-d: Add iommu do invalidate function

2017-06-27 Thread Jacob Pan
IOMMU. The assumption is that guest to host device ID mapping should be resolved prior to calling IOMMU driver. Based on the device handle, host IOMMU driver can replace certain fields before submit to the invalidation queue. Signed-off-by: Liu, Yi L <yi.l@linux.intel.com> Signed-off-by:

[PATCH 6/9] iommu/vt-d: track device with pasid table bond to a guest

2017-06-27 Thread Jacob Pan
such that page request and other events can be propagated to the guest as needed. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Ashok Raj <ashok@intel.com> --- drivers/iommu/intel-iommu.c | 19 +-- include/linux/intel-iommu.h | 19 ++

[PATCH 9/9] iommu/intel-svm: replace dev ops with generic fault notifier

2017-06-27 Thread Jacob Pan
is both generic and contains raw data for architectural specific uses. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Ashok Raj <ashok@intel.com> --- drivers/iommu/intel-svm.c | 13 ++--- include/linux/intel-svm.h | 20 +++- 2 file

[PATCH 2/9] iommu/vt-d: add bind_pasid_table function

2017-06-27 Thread Jacob Pan
table pointer (GPA) and size. Device context table entry is modified by Intel IOMMU specific bind_pasid_table function. This will turn on nesting mode and matching translation type. The unbind operation restores default context mapping. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com>

[RFC 0/9] IOMMU driver support for shared virtual memory virtualization

2017-06-27 Thread Jacob Pan
- passdown invalidation - per device IOMMU fault notification The additional patches are Intel VT-d specific, which either implements or replaces existing private interfaces with the generic ones. Thanks, Jacob Jacob Pan (8): iommu: Introduce bind_pasid_table API function iommu/vt-d: add

[PATCH 3/9] iommu: Introduce iommu do invalidate API function

2017-06-27 Thread Jacob Pan
need to be taken which requires the generic APIs introduced in this patch to have opaque data in the tlb_invalidate_info argument. Signed-off-by: Liu, Yi L <yi.l@linux.intel.com> Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Ashok Raj <ashok@intel.

[PATCH 1/9] iommu: Introduce bind_pasid_table API function

2017-06-27 Thread Jacob Pan
table of assigned devices. This patch also adds model definition in iommu.h. It would be used to check if the bind request is from a compatible entity. e.g. a bind request from an intel_iommu emulator may not be supported by an ARM SMMU driver. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com>

[PATCH 7/9] iommu/dmar: notify unrecoverable faults

2017-06-27 Thread Jacob Pan
with PASID transactions. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Ashok Raj <ashok@intel.com> --- drivers/iommu/dmar.c | 38 +- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/dmar.c b/drivers/

[PATCH 8/9] iommu/intel-svm: notify page request to guest

2017-06-27 Thread Jacob Pan
OS. Once guest pages are fault in, guest will issue page response which will be passed down via the invalidation passdown APIs. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Ashok Raj <ashok@intel.com> --- drivers/iommu/inte

[PATCH 5/9] iommu: Introduce fault notifier API

2017-06-27 Thread Jacob Pan
and unrecoverable faults - VFIO and other other in kernel users - DMA & IRQ remapping (TBD) The event data contains both generic and raw architectural data such that performance is not compromised as the data propagation may involve many layers. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com&

Re: [PATCH 5/9] iommu: Introduce fault notifier API

2017-06-28 Thread Jacob Pan
On Wed, 28 Jun 2017 12:16:03 +0200 Joerg Roedel <j...@8bytes.org> wrote: > On Tue, Jun 27, 2017 at 12:47:59PM -0700, Jacob Pan wrote: > > diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c > > index d973555..07cfd92 100644 > > --- a/drivers/iommu/iommu.c >

Re: [PATCH 3/9] iommu: Introduce iommu do invalidate API function

2017-06-28 Thread Jacob Pan
On Wed, 28 Jun 2017 12:08:23 +0200 Joerg Roedel <j...@8bytes.org> wrote: > On Tue, Jun 27, 2017 at 12:47:57PM -0700, Jacob Pan wrote: > > From: "Liu, Yi L" <yi.l@linux.intel.com> > > > > When a SVM capable device is assigned to a guest, the first l

Re: [RFC PATCH 1/8] iommu: Introduce bind_pasid_table API function

2017-04-26 Thread jacob pan
On Wed, 26 Apr 2017 17:56:45 +0100 Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> wrote: > Hi Yi, Jacob, > > On 26/04/17 11:11, Liu, Yi L wrote: > > From: Jacob Pan <jacob.jun@linux.intel.com> > > > > Virtual IOMMU was proposed to support S

Re: [RFC PATCH 2/8] iommu/vt-d: add bind_pasid_table function

2017-05-15 Thread jacob pan
On Fri, 12 May 2017 15:59:29 -0600 Alex Williamson wrote: > > + if (pasidt_binfo->size >= intel_iommu_get_pts(iommu)) { > > + pr_err("Invalid gPASID table size %llu, host size > > %lu\n", > > + pasidt_binfo->size, > > +

Re: [RFC 2/9] iommu/vt-d: add bind_pasid_table function

2017-06-23 Thread Jacob Pan
On Fri, 23 Jun 2017 12:59:00 -0600 Alex Williamson <alex.william...@redhat.com> wrote: > On Fri, 23 Jun 2017 11:19:52 -0700 > Jacob Pan <jacob.jun@linux.intel.com> wrote: > > > On Thu, 22 Jun 2017 16:52:15 -0600 > > Alex Williamson <alex.william...@redhat

Re: [RFC 7/9] iommu/dmar: notify unrecoverable faults

2017-06-23 Thread Jacob Pan
On Thu, 22 Jun 2017 16:54:16 -0600 Alex Williamson <alex.william...@redhat.com> wrote: > On Wed, 14 Jun 2017 15:23:01 -0700 > Jacob Pan <jacob.jun@linux.intel.com> wrote: > > > Currently, when device DMA faults are detected by IOMMU the fault > > reasons are

Re: [RFC 8/9] iommu/intel-svm: notify page request to guest

2017-06-23 Thread Jacob Pan
On Fri, 23 Jun 2017 14:34:34 -0600 Alex Williamson wrote: > > for_each_pci_dev(dev) { > <-- look in here, it's trickier than it > appears you are right, thanks. ___ iommu mailing list

Re: [RFC 8/9] iommu/intel-svm: notify page request to guest

2017-06-23 Thread Jacob Pan
On Thu, 22 Jun 2017 16:53:58 -0600 Alex Williamson <alex.william...@redhat.com> wrote: > On Wed, 14 Jun 2017 15:23:02 -0700 > Jacob Pan <jacob.jun@linux.intel.com> wrote: > > > If the source device of a page request has its PASID table pointer > > bond to a g

Re: [RFC 2/9] iommu/vt-d: add bind_pasid_table function

2017-06-23 Thread Jacob Pan
On Thu, 22 Jun 2017 16:52:15 -0600 Alex Williamson <alex.william...@redhat.com> wrote: > On Wed, 14 Jun 2017 15:22:56 -0700 > Jacob Pan <jacob.jun@linux.intel.com> wrote: > > > Add Intel VT-d ops to the generic iommu_bind_pasid_table API > > functio

Re: [RFC 1/9] iommu: Introduce bind_pasid_table API function

2017-06-23 Thread Jacob Pan
On Thu, 22 Jun 2017 16:52:01 -0600 Alex Williamson <alex.william...@redhat.com> wrote: > On Wed, 14 Jun 2017 15:22:55 -0700 > Jacob Pan <jacob.jun@linux.intel.com> wrote: > > > Virtual IOMMU was proposed to support Shared Virtual Memory (SVM) > >

Re: [RFC 5/9] iommu: Introduce fault notifier API

2017-06-23 Thread Jacob Pan
On Thu, 22 Jun 2017 16:53:17 -0600 Alex Williamson <alex.william...@redhat.com> wrote: > On Wed, 14 Jun 2017 15:22:59 -0700 > Jacob Pan <jacob.jun@linux.intel.com> wrote: > > > Traditionally, device specific faults are detected and handled > > within the

Re: [RFC 5/9] iommu: Introduce fault notifier API

2017-06-26 Thread Jacob Pan
On Fri, 23 Jun 2017 13:15:51 -0600 Alex Williamson <alex.william...@redhat.com> wrote: > On Fri, 23 Jun 2017 11:59:28 -0700 > Jacob Pan <jacob.jun@linux.intel.com> wrote: > > > On Thu, 22 Jun 2017 16:53:17 -0600 > > Alex Williamson <alex.william...@redhat

Re: 回复: Alibaba-kernel

2017-06-06 Thread Jacob Pan
rienced with > > kernel debugging 5·Kernel community contributor as a plus > > > > Linux内核测试专家 > > 具体职责: > > 1. > > 根据业务需求制定测试方案,测试执行和结果分析,保证操作系统的高质量部署交付。 > > 2. 负责linux内核测试系统、测试工具和测试集的开发。 3. > > 对内核各子模块性能数据采集和量化分析,发现性能瓶颈,提出解决方案。岗位要求 &

[RFC 4/9] iommu/vt-d: Add iommu do invalidate function

2017-06-14 Thread Jacob Pan
IOMMU. The assumption is that guest to host device ID mapping should be resolved prior to calling IOMMU driver. Based on the device handle, host IOMMU driver can replace certain fields before submit to the invalidation queue. Signed-off-by: Liu, Yi L <yi.l@linux.intel.com> Signed-off-by:

[RFC 0/9] IOMMU driver changes for shared virtual memory virtualization

2017-06-14 Thread Jacob Pan
: - bind PASID table - passdown invalidation - per device IOMMU fault notification The additional patches are Intel VT-d specific, which either implements or replaces existing private interfaces with the generic ones. Thanks, Jacob Jacob Pan (8): iommu: Introduce bind_pasid_table API function

[RFC 1/9] iommu: Introduce bind_pasid_table API function

2017-06-14 Thread Jacob Pan
table of assigned devices. This patch also adds model definition in iommu.h. It would be used to check if the bind request is from a compatible entity. e.g. a bind request from an intel_iommu emulator may not be supported by an ARM SMMU driver. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com>

[RFC 9/9] iommu/intel-svm: replace dev ops with generic fault notifier

2017-06-14 Thread Jacob Pan
is both generic and contains raw data for architectural specific uses. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Ashok Raj <ashok@intel.com> --- drivers/iommu/intel-svm.c | 13 ++--- include/linux/intel-svm.h | 20 +++- 2 file

[RFC 7/9] iommu/dmar: notify unrecoverable faults

2017-06-14 Thread Jacob Pan
with PASID transactions. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Ashok Raj <ashok@intel.com> --- drivers/iommu/dmar.c | 37 - 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/dmar.c b/drivers/

[RFC 5/9] iommu: Introduce fault notifier API

2017-06-14 Thread Jacob Pan
and unrecoverable faults - VFIO and other other in kernel users - DMA & IRQ remapping (TBD) The event data contains both generic and raw architectural data such that performance is not compromised as the data propagation may involve many layers. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com&

[RFC 8/9] iommu/intel-svm: notify page request to guest

2017-06-14 Thread Jacob Pan
OS. Once guest pages are fault in, guest will issue page response which will be passed down via the invalidation passdown APIs. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Ashok Raj <ashok@intel.com> --- drivers/iommu/inte

[RFC 2/9] iommu/vt-d: add bind_pasid_table function

2017-06-14 Thread Jacob Pan
table pointer (GPA) and size. Device context table entry is modified by Intel IOMMU specific bind_pasid_table function. This will turn on nesting mode and matching translation type. The unbind operation restores default context mapping. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com>

[RFC 3/9] iommu: Introduce iommu do invalidate API function

2017-06-14 Thread Jacob Pan
need to be taken which requires the generic APIs introduced in this patch to have opaque data in the tlb_invalidate_info argument. Signed-off-by: Liu, Yi L <yi.l@linux.intel.com> Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Ashok Raj <ashok@intel.

[RFC 6/9] iommu/vt-d: track device with pasid table bond to a guest

2017-06-14 Thread Jacob Pan
such that page request and other events can be propagated to the guest as needed. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Ashok Raj <ashok@intel.com> --- drivers/iommu/intel-iommu.c | 19 +-- include/linux/intel-iommu.h | 19 ++

bind pasid table API

2017-09-18 Thread Jacob Pan
Hi Jean and All, This is a follow-up on the LPC discussion we had last week. (https://linuxplumbersconf.org/2017/ocw/proposals/4748) My understanding is that the data structure below can satisfy the needs from Intel (pointer + size) and AMD (pointer only). But ARM pvIOMMU would need additional

Re: bind pasid table API

2017-09-20 Thread Jacob Pan
On Wed, 20 Sep 2017 13:09:47 +0100 Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> wrote: > Hi Jacob, > > [Adding Eric as he might need pasid_table_info for vSVM at some point] > > On 19/09/17 04:45, Jacob Pan wrote: > > Hi Jean and All, > > > > Th

Re: [PATCH v2 09/16] driver core: add iommu device fault reporting data

2017-10-06 Thread Jacob Pan
On Fri, 6 Oct 2017 10:39:31 +0200 Joerg Roedel wrote: > On Fri, Oct 06, 2017 at 12:11:45AM -0700, Christoph Hellwig wrote: > > This is the 3rd iommu field, in addition to 8 dma-specific fields > > that we carry around for each struct device. > > Agreed, consolidating the

Re: [PATCH v2 10/16] iommu: introduce device fault report API

2017-10-09 Thread Jacob Pan
On Fri, 6 Oct 2017 10:36:02 +0100 Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> wrote: > Hi Jacob, > > On 06/10/17 00:03, Jacob Pan wrote: > > Traditionally, device specific faults are detected and handled > > within their own device drivers. When IOMMU is enab

Re: [PATCH v2 01/16] iommu: introduce bind_pasid_table API function

2017-10-10 Thread Jacob Pan
On Tue, 10 Oct 2017 17:45:53 +0100 Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> wrote: > On 06/10/17 00:03, Jacob Pan wrote: > > Virtual IOMMU was proposed to support Shared Virtual Memory (SVM) > > use in the guest: > > https://lists.gnu.org/archive/html/qemu-

Re: [PATCH v2 03/16] iommu: introduce iommu invalidate API function

2017-10-10 Thread Jacob Pan
On Tue, 10 Oct 2017 15:35:42 +0200 Joerg Roedel <j...@8bytes.org> wrote: > On Thu, Oct 05, 2017 at 04:03:31PM -0700, Jacob Pan wrote: > > +int iommu_invalidate(struct iommu_domain *domain, > > + struct device *dev, struct tlb_invalidate_info > > *inv_info)

Re: [PATCH v2 08/16] iommu: introduce device fault data

2017-10-10 Thread Jacob Pan
On Tue, 10 Oct 2017 20:29:29 +0100 Jean-Philippe Brucker wrote: > > +enum iommu_model { > > + IOMMU_MODEL_INTEL = 1, > > + IOMMU_MODEL_AMD, > > + IOMMU_MODEL_SMMU3, > > +}; > > Now unused, I guess? right, missed it. thanks

Re: [PATCH v2 01/16] iommu: introduce bind_pasid_table API function

2017-10-10 Thread Jacob Pan
On Tue, 10 Oct 2017 15:14:33 +0200 Joerg Roedel <j...@8bytes.org> wrote: > Hi Jacob, > > On Thu, Oct 05, 2017 at 04:03:29PM -0700, Jacob Pan wrote: > > +int iommu_unbind_pasid_table(struct iommu_domain *domain, struct > > device *dev) +{ > > + if (unlikely

[PATCH v2 05/16] iommu/vt-d: add iommu invalidate function

2017-10-05 Thread Jacob Pan
ed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Ashok Raj <ashok@intel.com> --- drivers/iommu/intel-iommu.c | 148 include/linux/intel-iommu.h | 10 +++ 2 files changed, 158 insertions(+) diff --git a/drivers/iommu/intel

[PATCH v2 16/16] iommu/vt-d: add intel iommu page response function

2017-10-05 Thread Jacob Pan
This patch adds page response support for Intel VT-d. Generic response data is taken from the IOMMU API then parsed into VT-d specific response descriptor format. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> --- drivers/iommu/intel-iommu.c | 30 ++

[PATCH v2 09/16] driver core: add iommu device fault reporting data

2017-10-05 Thread Jacob Pan
IOMMU fault. Therefore we need fault reporting mechanism to propagate faults beyond IOMMU subsystem. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> --- include/linux/device.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/device.h b/include/linux/device.h

[PATCH v2 13/16] iommu/intel-svm: notify page request to guest

2017-10-05 Thread Jacob Pan
OS. Once guest pages are fault in, guest will issue page response which will be passed down via the invalidation passdown APIs. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Ashok Raj <ashok@intel.com> --- drivers/iommu/inte

[PATCH v2 11/16] iommu/vt-d: use threaded irq for dmar_fault

2017-10-05 Thread Jacob Pan
. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> --- drivers/iommu/dmar.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c index 2fbff8b..ae33d61 100644 --- a/drivers/iommu/dmar.c +++ b/drivers/iommu/dmar.c @@ -1748,7 +

[PATCH v2 08/16] iommu: introduce device fault data

2017-10-05 Thread Jacob Pan
of the IOMMU faults if the cause is within IOMMU driver control. Therefore, the fault reasons can be reported are grouped and generalized based common specifications such as PCI ATS. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> --- include/linux/iommu.

[PATCH v2 00/16] IOMMU driver support for SVM virtualization

2017-10-05 Thread Jacob Pan
ge request/response communications between host IOMMU and guest or other in-kernel users. - Added unrecoverable fault reporting to DMAR - Use threaded IRQ function for DMAR fault interrupt and fault reporting Jacob Pan (15): iommu: introduce bind_pasid_table AP

Re: [PATCH v2 02/16] iommu/vt-d: add bind_pasid_table function

2017-10-12 Thread Jacob Pan
On Thu, 12 Oct 2017 11:12:46 + "Liu, Yi L" <yi.l@intel.com> wrote: > > From: Jacob Pan [mailto:jacob.jun@linux.intel.com] > > Sent: Friday, October 6, 2017 7:04 AM > > To: iommu@lists.linux-foundation.org; LKML > > <linux-ker...@vger

Re: [PATCH] intel-iommu: Don't be too aggressive when clearing one context entry

2017-08-30 Thread Jacob Pan
(((u16)bus) << 8) | devfn, > +DMA_CCMD_MASK_NOBIT, > +DMA_CCMD_DEVICE_INVL); > + iommu->flush.flush_iotlb(iommu, > + did_old, > +

Re: bind pasid table API

2017-09-27 Thread Jacob Pan
} amd; > > /* ... */ > }; > }; > > How does that look? > It should work for us for now but I am not sure how stable the vendor specific fields will be, this is UAPI. BTW, do you also intend to include the pasi

Re: bind pasid table API

2017-09-28 Thread Jacob Pan
On Thu, 28 Sep 2017 14:07:05 +0200 Joerg Roedel <j...@8bytes.org> wrote: > On Wed, Sep 27, 2017 at 10:51:55AM -0700, Jacob Pan wrote: > > On Wed, 27 Sep 2017 15:40:41 +0200 > > Joerg Roedel <j...@8bytes.org> wrote: > > > enum pasid_table_model

[PATCH v2 10/16] iommu: introduce device fault report API

2017-10-05 Thread Jacob Pan
users - DMA & IRQ remapping (TBD) The original idea was brought up by David Woodhouse and discussions summarized at https://lwn.net/Articles/608914/. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Ashok Raj <ashok@intel.com> --- drivers/io

[PATCH v2 01/16] iommu: introduce bind_pasid_table API function

2017-10-05 Thread Jacob Pan
table of assigned devices. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Liu, Yi L <yi.l@linux.intel.com> Signed-off-by: Ashok Raj <ashok@intel.com> --- drivers/iommu/iommu.c | 19 include/linux/iommu.h | 25 +++

[PATCH v2 12/16] iommu/vt-d: report unrecoverable device faults

2017-10-05 Thread Jacob Pan
ID in VT-d fault reason report registers. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Ashok Raj <ashok@intel.com> --- drivers/iommu/dmar.c | 95 +++- 1 file changed, 94 insertions(+), 1 deletion(-) diff --g

[PATCH v2 14/16] iommu/intel-svm: replace dev ops with fault report API

2017-10-05 Thread Jacob Pan
With the introduction of generic IOMMU device fault reporting API, we can replace the private fault callback functions with standard function and event data. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> --- drivers/iommu/intel-svm.c | 7 +-- include/linux/intel-svm.

[PATCH v2 07/16] iommu/vt-d: assign PFSID in device TLB invalidation

2017-10-05 Thread Jacob Pan
When SRIOV VF device IOTLB is invalidated, we need to provide the PF source SID such that IOMMU hardware can gauge the depth of invalidation queue which is shared among VFs. This is needed when device invalidation throttle (DIT) capability is supported. Signed-off-by: Jacob Pan <jacob.

[PATCH v2 03/16] iommu: introduce iommu invalidate API function

2017-10-05 Thread Jacob Pan
from user space and will be written into physical IOMMU, we must allow security check at various layers. Therefore, generic invalidation data format are proposed here, model specific IOMMU drivers need to convert them into their own format. Signed-off-by: Liu, Yi L <yi.l@linux.intel.com> Si

[PATCH v2 02/16] iommu/vt-d: add bind_pasid_table function

2017-10-05 Thread Jacob Pan
table pointer (GPA) and size. Device context table entry is modified by Intel IOMMU specific bind_pasid_table function. This will turn on nesting mode and matching translation type. The unbind operation restores default context mapping. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com>

[PATCH v2 04/16] iommu/vt-d: support flushing more TLB types

2017-10-05 Thread Jacob Pan
Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> --- drivers/iommu/dmar.c| 53 ++--- drivers/iommu/intel-iommu.c | 3 ++- include/linux/intel-iommu.h | 10 +++-- 3 files changed, 60 insertions(+), 6 deletions(-) diff --git a/d

[PATCH v2 06/16] iommu/vt-d: move device_domain_info to header

2017-10-05 Thread Jacob Pan
Allow both intel-iommu.c and dmar.c to access device_domain_info. Prepare for additional per device arch data used in TLB flush function Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> --- drivers/iommu/intel-iommu.c | 18 -- include/linux/intel-iommu.

Re: [PATCH v2 10/16] iommu: introduce device fault report API

2017-10-11 Thread Jacob Pan
On Tue, 10 Oct 2017 15:40:54 +0200 Joerg Roedel <j...@8bytes.org> wrote: > On Thu, Oct 05, 2017 at 04:03:38PM -0700, Jacob Pan wrote: > > Traditionally, device specific faults are detected and handled > > within their own device drivers. When IOMMU is enabled, faults su

Re: [PATCH] iommu/vt-d: Fix scatterlist offset handling

2017-11-15 Thread Jacob Pan
Hi Alex and all, Just wondering if you could merge Robin's patch for the next rc. From all our testing, this seems to be a solid fix and should be included in the stable releases as well. Thanks, Jacob On Mon, 6 Nov 2017 10:47:09 -0800 Jacob Pan <jacob.jun@linux.intel.com> wrote: &g

Re: [PATCH v3 08/16] iommu: introduce device fault data

2017-11-29 Thread Jacob Pan
On Fri, 24 Nov 2017 12:03:33 + Jean-Philippe Brucker wrote: > > + * @rid: requestor ID > > This comment can be removed will do, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org

Re: [PATCH v3 01/16] iommu: introduce bind_pasid_table API function

2017-11-29 Thread Jacob Pan
On Fri, 24 Nov 2017 12:04:08 + Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> wrote: > On 17/11/17 18:54, Jacob Pan wrote: > > Virtual IOMMU was proposed to support Shared Virtual Memory (SVM) > > use in the guest: > > https://lists.gnu.org/archive/html/qemu-

Re: [PATCH v3 15/16] iommu: introduce page response function

2017-12-04 Thread Jacob Pan
On Fri, 24 Nov 2017 12:03:50 + Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> wrote: > On 17/11/17 18:55, Jacob Pan wrote: > > When nested translation is turned on and guest owns the > > first level page tables, device page request can be forwared > > to th

[PATCH v3 01/16] iommu: introduce bind_pasid_table API function

2017-11-17 Thread Jacob Pan
table of assigned devices. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Liu, Yi L <yi.l@linux.intel.com> Signed-off-by: Ashok Raj <ashok@intel.com> --- drivers/iommu/iommu.c | 19 +++ include/linux/iommu.h | 24 +

[PATCH v3 00/16] [PATCH v3 00/16] IOMMU driver support for SVM virtualization

2017-11-17 Thread Jacob Pan
AR fault interrupt and fault reporting Jacob Pan (15): iommu: introduce bind_pasid_table API function iommu/vt-d: add bind_pasid_table function iommu/vt-d: move device_domain_info to header iommu/vt-d: support flushing more TLB types iommu/vt-d: add svm/sva invalidate functio

[PATCH v3 07/16] iommu/vt-d: assign PFSID in device TLB invalidation

2017-11-17 Thread Jacob Pan
When SRIOV VF device IOTLB is invalidated, we need to provide the PF source SID such that IOMMU hardware can gauge the depth of invalidation queue which is shared among VFs. This is needed when device invalidation throttle (DIT) capability is supported. Signed-off-by: Jacob Pan <jacob.

[PATCH v3 02/16] iommu/vt-d: add bind_pasid_table function

2017-11-17 Thread Jacob Pan
table pointer (GPA) and size. Device context table entry is modified by Intel IOMMU specific bind_pasid_table function. This will turn on nesting mode and matching translation type. The unbind operation restores default context mapping. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com>

[PATCH v3 03/16] iommu: introduce iommu invalidate API function

2017-11-17 Thread Jacob Pan
from user space and will be written into physical IOMMU, we must allow security check at various layers. Therefore, generic invalidation data format are proposed here, model specific IOMMU drivers need to convert them into their own format. Signed-off-by: Liu, Yi L <yi.l@linux.intel.com> Si

[PATCH v3 05/16] iommu/vt-d: support flushing more TLB types

2017-11-17 Thread Jacob Pan
With shared virtual memory vitualization, extended IOTLB invalidation may be passed down from outside IOMMU subsystems. This patch adds invalidation functions that can be used for each IOTLB types. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Liu, Yi L

[PATCH v3 04/16] iommu/vt-d: move device_domain_info to header

2017-11-17 Thread Jacob Pan
Allow both intel-iommu.c and dmar.c to access device_domain_info. Prepare for additional per device arch data used in TLB flush function Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> --- drivers/iommu/intel-iommu.c | 18 -- include/linux/intel-iommu.

[PATCH v3 10/16] iommu: introduce device fault report API

2017-11-17 Thread Jacob Pan
users - DMA & IRQ remapping (TBD) The original idea was brought up by David Woodhouse and discussions summarized at https://lwn.net/Articles/608914/. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Ashok Raj <ashok@intel.com> --- drivers/io

[PATCH v3 06/16] iommu/vt-d: add svm/sva invalidate function

2017-11-17 Thread Jacob Pan
i.l@linux.intel.com> Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Ashok Raj <ashok@intel.com> --- drivers/iommu/intel-iommu.c | 200 +++- include/linux/intel-iommu.h | 17 +++- 2 files changed, 211 insertions(+), 6

[PATCH v3 13/16] iommu/intel-svm: notify page request to guest

2017-11-17 Thread Jacob Pan
OS. Once guest pages are fault in, guest will issue page response which will be passed down via the invalidation passdown APIs. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Ashok Raj <ashok@intel.com> --- drivers/iommu/inte

[PATCH v3 09/16] driver core: add iommu device fault reporting data

2017-11-17 Thread Jacob Pan
here by Greg KH and Joerg. The name iommu_param is chosen here since iommu_data has been used. Suggested-by: Greg Kroah-Hartman <gre...@linuxfoundation.org> Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Link: https://lkml.org/lkml/2017/10/6/81 --- include/linux/device.h | 3

[PATCH v3 14/16] iommu/intel-svm: replace dev ops with fault report API

2017-11-17 Thread Jacob Pan
With the introduction of generic IOMMU device fault reporting API, we can replace the private fault callback functions with standard function and event data. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> --- drivers/iommu/intel-svm.c | 7 +-- include/linux/intel-svm.

[PATCH v3 11/16] iommu/vt-d: use threaded irq for dmar_fault

2017-11-17 Thread Jacob Pan
. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> --- drivers/iommu/dmar.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c index f69f6ee..38ee91b 100644 --- a/drivers/iommu/dmar.c +++ b/drivers/iommu/dmar.c @@ -1749,7 +

[PATCH v3 08/16] iommu: introduce device fault data

2017-11-17 Thread Jacob Pan
. Therefore, the fault reasons can be reported are grouped and generalized based common specifications such as PCI ATS. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Liu, Yi L <yi.l@linux.intel.com> Signed-off-by: Ashok Raj <ashok@intel.com> --- inc

[PATCH v3 12/16] iommu/vt-d: report unrecoverable device faults

2017-11-17 Thread Jacob Pan
ID in VT-d fault reason report registers. Signed-off-by: Liu, Yi L <yi.l@linux.intel.com> Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Ashok Raj <ashok@intel.com> --- drivers/iommu/dmar.c | 94 ++

[PATCH v3 16/16] iommu/vt-d: add intel iommu page response function

2017-11-17 Thread Jacob Pan
This patch adds page response support for Intel VT-d. Generic response data is taken from the IOMMU API then parsed into VT-d specific response descriptor format. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> --- drivers/iommu/intel-iommu.c | 30 ++

[PATCH v3 15/16] iommu: introduce page response function

2017-11-17 Thread Jacob Pan
request transaction. This patch introduces generic API function for page response passing from the guest or other in-kernel users. The definitions of the generic data is based on PCI ATS specification not limited to any vendor. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> --- d

Re: [PATCH] iommu/vt-d: Fix scatterlist offset handling

2017-11-17 Thread Jacob Pan
On Fri, 17 Nov 2017 17:44:57 + Casey Leedom <lee...@chelsio.com> wrote: > | From: Raj, Ashok <ashok@intel.com> > | Sent: Friday, November 17, 2017 7:48 AM > | > | Reported by: Harsh <ha...@chelsio.com> > | Reviewed by: Ashok Raj <ashok....@intel.com&

Re: [PATCH v2 08/16] iommu: introduce device fault data

2017-11-10 Thread Jacob Pan
ut */ IOMMU_FAULT_REASON_INTERNAL, > /* Could not access the PASID table */ > IOMMU_FAULT_REASON_PASID_FETCH, [Jacob Pan] ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH v2 08/16] iommu: introduce device fault data

2017-11-13 Thread Jacob Pan
On Mon, 13 Nov 2017 13:19:50 + Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> wrote: > On 11/11/17 00:00, Jacob Pan wrote: > > On Fri, 10 Nov 2017 13:54:59 + > > Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> wrote: > > > >> /*

Re: [PATCH v2 08/16] iommu: introduce device fault data

2017-11-13 Thread Jacob Pan
On Mon, 13 Nov 2017 13:06:24 + Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> wrote: > On 10/11/17 22:18, Jacob Pan wrote: > > On Fri, 10 Nov 2017 13:54:59 + > > Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> wrote: > > > &

Re: [PATCH v3 05/16] iommu/vt-d: support flushing more TLB types

2017-11-20 Thread Jacob Pan
On Mon, 20 Nov 2017 14:20:31 + "Lukoshkov, Maksim" <maksim.lukosh...@intel.com> wrote: > On 11/17/2017 18:55, Jacob Pan wrote: > > +void qi_flush_dev_iotlb(struct intel_iommu *iommu, u16 sid, u16 > > pfsid, > > + u16 qdep, u64 addr,

Re: [PATCH] iommu/vt-d: Fix scatterlist offset handling

2017-11-06 Thread Jacob Pan
; Joerg > > _______ > iommu mailing list > iommu@lists.linux-foundation.org > https://lists.linuxfoundation.org/mailman/listinfo/iommu [Jacob Pan] ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH v2 08/16] iommu: introduce device fault data

2017-11-09 Thread Jacob Pan
On Tue, 7 Nov 2017 11:38:50 + Jean-Philippe Brucker wrote: > I think the IOMMU should pass the struct device associated to the BDF > to the fault handler. The fault handler can then deduce the BDF from > struct device if it needs to. This also allows to support

Re: [PATCH v3 15/16] iommu: introduce page response function

2017-12-07 Thread Jacob Pan
On Thu, 7 Dec 2017 12:56:55 + Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> wrote: > On 06/12/17 19:25, Jacob Pan wrote: > [...] > >> For SMMUv3, the stall buffer may be shared between devices on > >> some implementations, in which case the guest co

  1   2   3   4   5   >