[PATCH v5 03/23] iommu/vt-d: add a flag for pasid table bound status

2018-05-11 Thread Jacob Pan
Adding a flag in device domain into to track whether a guest or user PASID table is bound to a device. Signed-off-by: Jacob Pan --- include/linux/intel-iommu.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index 304afae..ddc7d79

[PATCH v5 01/23] iommu: introduce bind_pasid_table API function

2018-05-11 Thread Jacob Pan
table of assigned devices. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Liu, Yi L Signed-off-by: Ashok Raj Signed-off-by: Jacob Pan --- drivers/iommu/iommu.c | 19 +++ include/linux/iommu.h | 24 include/uapi/linux/iommu.

[PATCH v5 04/23] iommu/vt-d: add bind_pasid_table function

2018-05-11 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 v5 08/23] iommu/vt-d: support flushing more translation cache types

2018-05-11 Thread Jacob Pan
When Shared Virtual Memory is exposed to a guest via vIOMMU, extended 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 <jacob.jun@linux.intel.

[PATCH v5 00/23] IOMMU and VT-d driver support for Shared Virtual Address (SVA)

2018-05-11 Thread Jacob Pan
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 (22): iommu: introduce bind_pasid_table API function iommu/vt-d: move device_domain_info to header iomm

[PATCH v5 04/23] iommu/vt-d: add bind_pasid_table function

2018-05-11 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 Signed-off-by: Liu, Yi L Signed-off

[PATCH v5 08/23] iommu/vt-d: support flushing more translation cache types

2018-05-11 Thread Jacob Pan
When Shared Virtual Memory is exposed to a guest via vIOMMU, extended 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 --- drivers/iommu/dmar.c

[PATCH v5 00/23] IOMMU and VT-d driver support for Shared Virtual Address (SVA)

2018-05-11 Thread Jacob Pan
- Use threaded IRQ function for DMAR fault interrupt and fault reporting Jacob Pan (22): iommu: introduce bind_pasid_table API function iommu/vt-d: move device_domain_info to header iommu/vt-d: add a flag for pasid table bound status iommu/vt-d: add bind_pasid_table function

[PATCH v5 11/23] driver core: add per device iommu param

2018-05-11 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> Reviewed-by: Greg Kroah-Hartman <gre...@linuxfoundation.org> Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Link

[PATCH v5 10/23] iommu: introduce device fault data

2018-05-11 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: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> Signed-off-by: Liu, Yi L <yi.l@

[PATCH v5 11/23] driver core: add per device iommu param

2018-05-11 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 Reviewed-by: Greg Kroah-Hartman Signed-off-by: Jacob Pan Link: https://lkml.org/lkml/2017/10/6/81 --- include/linux/device.h | 3 +++ 1 file changed, 3 insertions

[PATCH v5 10/23] iommu: introduce device fault data

2018-05-11 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 Signed-off-by: Jean-Philippe Brucker Signed-off-by: Liu, Yi L Signed-off-by: Ashok Raj --- include/linux/iommu.h | 101

[PATCH v5 02/23] iommu/vt-d: move device_domain_info to header

2018-05-11 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 v5 02/23] iommu/vt-d: move device_domain_info to header

2018-05-11 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 --- drivers/iommu/intel-iommu.c | 18 -- include/linux/intel-iommu.h | 19 +++ 2 files changed, 19

[PATCH v5 09/23] iommu/vt-d: add svm/sva invalidate function

2018-05-11 Thread Jacob Pan
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: Ashok Raj <ashok@intel.com> Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> --- drivers/iommu/i

[PATCH v5 09/23] iommu/vt-d: add svm/sva invalidate function

2018-05-11 Thread Jacob Pan
on the device handle, host IOMMU driver can replace certain fields before submit to the invalidation queue. Signed-off-by: Liu, Yi L Signed-off-by: Ashok Raj Signed-off-by: Jacob Pan --- drivers/iommu/intel-iommu.c | 129 1 file changed, 129 insertions

[PATCH v5 12/23] iommu: add a timeout parameter for prq response

2018-05-11 Thread Jacob Pan
with credit based or device level page response exception handling. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> --- Documentation/admin-guide/kernel-parameters.txt | 8 +++ drivers/iommu/iommu.c | 28 + 2 files changed, 36 inse

[PATCH v5 12/23] iommu: add a timeout parameter for prq response

2018-05-11 Thread Jacob Pan
with credit based or device level page response exception handling. Signed-off-by: Jacob Pan --- Documentation/admin-guide/kernel-parameters.txt | 8 +++ drivers/iommu/iommu.c | 28 + 2 files changed, 36 insertions(+) diff --git a/Documentation

[PATCH v5 16/23] iommu/config: add build dependency for dmar

2018-05-11 Thread Jacob Pan
-off-by: Jacob Pan <jacob.jun@linux.intel.com> --- drivers/iommu/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index 73590ba..8d8b63f 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -139,6 +139,7 @@ config AMD_IO

[PATCH v5 16/23] iommu/config: add build dependency for dmar

2018-05-11 Thread Jacob Pan
-off-by: Jacob Pan --- drivers/iommu/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index 73590ba..8d8b63f 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -139,6 +139,7 @@ config AMD_IOMMU_V2 # Intel IOMMU support config

[PATCH v5 15/23] iommu: handle page response timeout

2018-05-11 Thread Jacob Pan
timer expires but not included in this patch. We need to consider the life cycle of page groupd ID to prevent confusion with reused group ID by a device. For now, a warning message provides clue of such failure. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Ashok Raj

[PATCH v5 15/23] iommu: handle page response timeout

2018-05-11 Thread Jacob Pan
timer expires but not included in this patch. We need to consider the life cycle of page groupd ID to prevent confusion with reused group ID by a device. For now, a warning message provides clue of such failure. Signed-off-by: Jacob Pan Signed-off-by: Ashok Raj --- drivers/iommu/iommu.c | 53

[PATCH v5 13/23] iommu: introduce device fault report API

2018-05-11 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> Signed-off-by: Jean-Philip

[PATCH v5 13/23] iommu: introduce device fault report API

2018-05-11 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 Signed-off-by: Ashok Raj Signed-off-by: Jean-Philippe Brucker --- drivers/iommu/iommu.c |

[PATCH v5 17/23] iommu/vt-d: report non-recoverable faults to device

2018-05-11 Thread Jacob Pan
and interrupt remapping which has to be set up early before threaded IRQ is available. This patch adds an option and a workqueue such that when faults are requested, DMAR fault IRQ handler can use the IOMMU fault reporting API to report. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Sign

[PATCH v5 14/23] iommu: introduce page response function

2018-05-11 Thread Jacob Pan
. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Link: https://lkml.org/lkml/2017/12/7/1725 --- drivers/iommu/iommu.c | 45 + include/linux/

[PATCH v5 17/23] iommu/vt-d: report non-recoverable faults to device

2018-05-11 Thread Jacob Pan
and interrupt remapping which has to be set up early before threaded IRQ is available. This patch adds an option and a workqueue such that when faults are requested, DMAR fault IRQ handler can use the IOMMU fault reporting API to report. Signed-off-by: Jacob Pan Signed-off-by: Liu, Yi L Signed-off

[PATCH v5 14/23] iommu: introduce page response function

2018-05-11 Thread Jacob Pan
. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Jacob Pan Link: https://lkml.org/lkml/2017/12/7/1725 --- drivers/iommu/iommu.c | 45 + include/linux/iommu.h | 43 +++ 2 files changed, 88 insertions(+) diff

[PATCH v5 19/23] iommu/intel-svm: replace dev ops with fault report API

2018-05-11 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 v5 19/23] iommu/intel-svm: replace dev ops with fault report API

2018-05-11 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 --- drivers/iommu/intel-svm.c | 7 +-- include/linux/intel-svm.h | 20 +++- 2 files changed

[PATCH v5 22/23] trace/iommu: add sva trace events

2018-05-11 Thread Jacob Pan
Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> --- include/trace/events/iommu.h | 112 +++ 1 file changed, 112 insertions(+) diff --git a/include/trace/events/iommu.h b/include/trace/events/iommu.h index 72b4582..e64eb29 100644 --- a/i

[PATCH v5 06/23] iommu/vt-d: add definitions for PFSID

2018-05-11 Thread Jacob Pan
and tracking PFSID. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> --- include/linux/intel-iommu.h | 4 1 file changed, 4 insertions(+) diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index ddc7d79..dfacd49 100644 --- a/include/linux/intel-iommu.h

[PATCH v5 06/23] iommu/vt-d: add definitions for PFSID

2018-05-11 Thread Jacob Pan
and tracking PFSID. Signed-off-by: Jacob Pan --- include/linux/intel-iommu.h | 4 1 file changed, 4 insertions(+) diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index ddc7d79..dfacd49 100644 --- a/include/linux/intel-iommu.h +++ b/include/linux/intel-iommu.h

[PATCH v5 22/23] trace/iommu: add sva trace events

2018-05-11 Thread Jacob Pan
Signed-off-by: Jacob Pan --- include/trace/events/iommu.h | 112 +++ 1 file changed, 112 insertions(+) diff --git a/include/trace/events/iommu.h b/include/trace/events/iommu.h index 72b4582..e64eb29 100644 --- a/include/trace/events/iommu.h +++ b/include

[PATCH v5 18/23] iommu/intel-svm: report device page request

2018-05-11 Thread Jacob Pan
-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Ashok Raj <ashok@intel.com> --- drivers/iommu/intel-svm.c | 73 --- include/linux/iommu.h | 1 + 2 files changed, 64 insertions(+), 10 deletions(-) diff --git a/drivers/iommu/i

[PATCH v5 23/23] iommu: use sva invalidate and device fault trace event

2018-05-11 Thread Jacob Pan
For performance and debugging purposes, these trace events help analyzing device faults and passdown invalidations that interact with IOMMU subsystem. E.g. IOMMU::00:0a.0 type=2 reason=0 addr=0x007ff000 pasid=1 group=1 last=0 prot=1 Signed-off-by: Jacob Pan <jacob.

[PATCH v5 21/23] iommu/vt-d: add intel iommu page response function

2018-05-11 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.

[PATCH v5 23/23] iommu: use sva invalidate and device fault trace event

2018-05-11 Thread Jacob Pan
For performance and debugging purposes, these trace events help analyzing device faults and passdown invalidations that interact with IOMMU subsystem. E.g. IOMMU::00:0a.0 type=2 reason=0 addr=0x007ff000 pasid=1 group=1 last=0 prot=1 Signed-off-by: Jacob Pan --- drivers/iommu/iommu.c

[PATCH v5 21/23] iommu/vt-d: add intel iommu page response function

2018-05-11 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 --- drivers/iommu/intel-iommu.c | 47 + include/linux/intel

[PATCH v5 18/23] iommu/intel-svm: report device page request

2018-05-11 Thread Jacob Pan
-by: Jacob Pan Signed-off-by: Ashok Raj --- drivers/iommu/intel-svm.c | 73 --- include/linux/iommu.h | 1 + 2 files changed, 64 insertions(+), 10 deletions(-) diff --git a/drivers/iommu/intel-svm.c b/drivers/iommu/intel-svm.c index e8cd984..a8186f8

[PATCH v5 20/23] iommu/intel-svm: do not flush iotlb for viommu

2018-05-11 Thread Jacob Pan
vIOMMU passdown invalidation will be inclusive, PASID cache invalidation includes TLBs. See Intel VT-d Specification Ch 6.5.2.2 for details. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> --- drivers/iommu/intel-svm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff

[PATCH v5 20/23] iommu/intel-svm: do not flush iotlb for viommu

2018-05-11 Thread Jacob Pan
vIOMMU passdown invalidation will be inclusive, PASID cache invalidation includes TLBs. See Intel VT-d Specification Ch 6.5.2.2 for details. Signed-off-by: Jacob Pan --- drivers/iommu/intel-svm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/intel-svm.c b

[PATCH v5 07/23] iommu/vt-d: fix dev iotlb pfsid use

2018-05-11 Thread Jacob Pan
PFSID should be used in the invalidation descriptor for flushing device IOTLBs on SRIOV VFs. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> --- drivers/iommu/dmar.c| 6 +++--- drivers/iommu/intel-iommu.c | 16 +++- include/linux/intel-iommu.h | 5 ++--- 3

[PATCH v5 05/23] iommu: introduce iommu invalidate API function

2018-05-11 Thread Jacob Pan
t; Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Ashok Raj <ashok@intel.com> --- drivers/iommu/iommu.c | 14 +++ include/linux/iommu.h | 12

[PATCH v5 07/23] iommu/vt-d: fix dev iotlb pfsid use

2018-05-11 Thread Jacob Pan
PFSID should be used in the invalidation descriptor for flushing device IOTLBs on SRIOV VFs. Signed-off-by: Jacob Pan --- drivers/iommu/dmar.c| 6 +++--- drivers/iommu/intel-iommu.c | 16 +++- include/linux/intel-iommu.h | 5 ++--- 3 files changed, 20 insertions(+), 7

[PATCH v5 05/23] iommu: introduce iommu invalidate API function

2018-05-11 Thread Jacob Pan
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 Signed-off-by: Jean-Philippe Brucker Signed-off-by: Jacob Pan

Re: [PATCH v4 05/22] iommu: introduce iommu invalidate API function

2018-05-09 Thread Jacob Pan
On Tue, 8 May 2018 11:35:00 +0100 Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> wrote: > Hi Jacob, > > Looks mostly good to me, I just have a couple more comments > > On 04/05/18 19:07, Jacob Pan wrote: > > Now the passdown invalidation granularities look like

Re: [PATCH v4 05/22] iommu: introduce iommu invalidate API function

2018-05-09 Thread Jacob Pan
On Tue, 8 May 2018 11:35:00 +0100 Jean-Philippe Brucker wrote: > Hi Jacob, > > Looks mostly good to me, I just have a couple more comments > > On 04/05/18 19:07, Jacob Pan wrote: > > Now the passdown invalidation granularities look like: > > (sorted by coarseness), w

Re: [PATCH v4 05/22] iommu: introduce iommu invalidate API function

2018-05-07 Thread Jacob Pan
On Sat, 5 May 2018 15:19:43 -0700 Jerry Snitselaar wrote: > > > >+static inline int iommu_sva_invalidate(struct iommu_domain *domain, > >+struct device *dev, struct tlb_invalidate_info > >*inv_info) +{ > >+return -EINVAL; > >+} > >+ > > Would -ENODEV make

Re: [PATCH v4 05/22] iommu: introduce iommu invalidate API function

2018-05-07 Thread Jacob Pan
On Sat, 5 May 2018 15:19:43 -0700 Jerry Snitselaar wrote: > > > >+static inline int iommu_sva_invalidate(struct iommu_domain *domain, > >+struct device *dev, struct tlb_invalidate_info > >*inv_info) +{ > >+return -EINVAL; > >+} > >+ > > Would -ENODEV make more sense here? >

Re: [PATCH v4 05/22] iommu: introduce iommu invalidate API function

2018-05-04 Thread Jacob Pan
On Thu, 3 May 2018 21:46:16 -0700 Jacob Pan <jacob.jun@linux.intel.com> wrote: > On Wed, 2 May 2018 10:31:50 +0100 > Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> wrote: > > > On 01/05/18 23:58, Jacob Pan wrote: > > >>>&g

Re: [PATCH v4 05/22] iommu: introduce iommu invalidate API function

2018-05-04 Thread Jacob Pan
On Thu, 3 May 2018 21:46:16 -0700 Jacob Pan wrote: > On Wed, 2 May 2018 10:31:50 +0100 > Jean-Philippe Brucker wrote: > > > On 01/05/18 23:58, Jacob Pan wrote: > > >>>> Maybe this should be called "NG_PAGE_PASID", > > >>>

Re: [PATCH v4 05/22] iommu: introduce iommu invalidate API function

2018-05-03 Thread Jacob Pan
On Wed, 2 May 2018 10:31:50 +0100 Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> wrote: > On 01/05/18 23:58, Jacob Pan wrote: > >>>> Maybe this should be called "NG_PAGE_PASID", > >>> Sure. I was thinking page range already implies non-g

Re: [PATCH v4 05/22] iommu: introduce iommu invalidate API function

2018-05-03 Thread Jacob Pan
On Wed, 2 May 2018 10:31:50 +0100 Jean-Philippe Brucker wrote: > On 01/05/18 23:58, Jacob Pan wrote: > >>>> Maybe this should be called "NG_PAGE_PASID", > >>> Sure. I was thinking page range already implies non-global > >>> pages

Re: [PATCH v4 05/22] iommu: introduce iommu invalidate API function

2018-05-01 Thread Jacob Pan
On Fri, 27 Apr 2018 19:07:43 +0100 Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> wrote: > On 23/04/18 21:43, Jacob Pan wrote: > [...] > >> The last name is a bit unfortunate. Since the Arm architecture uses > >> the name "context" for what a PASID p

Re: [PATCH v4 05/22] iommu: introduce iommu invalidate API function

2018-05-01 Thread Jacob Pan
On Fri, 27 Apr 2018 19:07:43 +0100 Jean-Philippe Brucker wrote: > On 23/04/18 21:43, Jacob Pan wrote: > [...] > >> The last name is a bit unfortunate. Since the Arm architecture uses > >> the name "context" for what a PASID points to, "Device ca

Re: [PATCH v4 12/22] iommu: introduce device fault report API

2018-04-30 Thread Jacob Pan
On Mon, 30 Apr 2018 17:53:52 +0100 Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> wrote: > Hi, > > I noticed a couple issues when testing > > On 16/04/18 22:49, Jacob Pan wrote: > > +int iommu_register_device_fault

Re: [PATCH v4 12/22] iommu: introduce device fault report API

2018-04-30 Thread Jacob Pan
On Mon, 30 Apr 2018 17:53:52 +0100 Jean-Philippe Brucker wrote: > Hi, > > I noticed a couple issues when testing > > On 16/04/18 22:49, Jacob Pan wrote: > > +int iommu_register_device_fault_handler(struct device *dev, > > +

Re: [PATCH v4 14/22] iommu: handle page response timeout

2018-04-30 Thread Jacob Pan
On Mon, 30 Apr 2018 11:58:10 +0100 Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> wrote: > On 25/04/18 16:37, Jacob Pan wrote: > >> In the other cases (unsupported PRI or rogue guest) then disabling > >> PRI using a FAILURE status might be the right thing to

Re: [PATCH v4 14/22] iommu: handle page response timeout

2018-04-30 Thread Jacob Pan
On Mon, 30 Apr 2018 11:58:10 +0100 Jean-Philippe Brucker wrote: > On 25/04/18 16:37, Jacob Pan wrote: > >> In the other cases (unsupported PRI or rogue guest) then disabling > >> PRI using a FAILURE status might be the right thing to do. However, > >> assuming t

Re: [PATCH v4 14/22] iommu: handle page response timeout

2018-04-25 Thread Jacob Pan
On Mon, 23 Apr 2018 16:36:23 +0100 Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> wrote: > On Mon, Apr 16, 2018 at 10:49:03PM +0100, Jacob Pan wrote: > > When IO page faults are reported outside IOMMU subsystem, the page > > request handler may fail for various

Re: [PATCH v4 14/22] iommu: handle page response timeout

2018-04-25 Thread Jacob Pan
On Mon, 23 Apr 2018 16:36:23 +0100 Jean-Philippe Brucker wrote: > On Mon, Apr 16, 2018 at 10:49:03PM +0100, Jacob Pan wrote: > > When IO page faults are reported outside IOMMU subsystem, the page > > request handler may fail for various reasons. E.g. a guest received > >

Re: [PATCH v4 12/22] iommu: introduce device fault report API

2018-04-24 Thread Jacob Pan
On Mon, 23 Apr 2018 12:30:13 +0100 Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> wrote: > On Mon, Apr 16, 2018 at 10:49:01PM +0100, Jacob Pan wrote: > [...] > > +int iommu_register_device_fault_handler(struct device *dev, > > + i

Re: [PATCH v4 12/22] iommu: introduce device fault report API

2018-04-24 Thread Jacob Pan
On Mon, 23 Apr 2018 12:30:13 +0100 Jean-Philippe Brucker wrote: > On Mon, Apr 16, 2018 at 10:49:01PM +0100, Jacob Pan wrote: > [...] > > +int iommu_register_device_fault_handler(struct device *dev, > > + iommu_dev_fault_han

Re: [PATCH v4 05/22] iommu: introduce iommu invalidate API function

2018-04-23 Thread Jacob Pan
On Fri, 20 Apr 2018 19:19:54 +0100 Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> wrote: > Hi Jacob, > > On Mon, Apr 16, 2018 at 10:48:54PM +0100, Jacob Pan wrote: > [...] > > +/** > > + * enum iommu_inv_granularity - Generic invalidation granularity > &

Re: [PATCH v4 05/22] iommu: introduce iommu invalidate API function

2018-04-23 Thread Jacob Pan
On Fri, 20 Apr 2018 19:19:54 +0100 Jean-Philippe Brucker wrote: > Hi Jacob, > > On Mon, Apr 16, 2018 at 10:48:54PM +0100, Jacob Pan wrote: > [...] > > +/** > > + * enum iommu_inv_granularity - Generic invalidation granularity > > + * > > + * When an i

Re: [PATCH v4 13/22] iommu: introduce page response function

2018-04-23 Thread Jacob Pan
On Mon, 23 Apr 2018 12:47:10 +0100 Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> wrote: > On Mon, Apr 16, 2018 at 10:49:02PM +0100, Jacob Pan wrote: > [...] > > + /* > > +* Check if we have a matching page request pending to > > respond, >

Re: [PATCH v4 13/22] iommu: introduce page response function

2018-04-23 Thread Jacob Pan
On Mon, 23 Apr 2018 12:47:10 +0100 Jean-Philippe Brucker wrote: > On Mon, Apr 16, 2018 at 10:49:02PM +0100, Jacob Pan wrote: > [...] > > + /* > > +* Check if we have a matching page request pending to > > respond, > > +

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

2018-04-23 Thread Jacob Pan
On Mon, 23 Apr 2018 11:11:41 +0100 Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> wrote: > On Mon, Apr 16, 2018 at 10:48:59PM +0100, Jacob Pan wrote: > > +/** > > + * struct iommu_fault_event - Generic per device fault data > > + * > > + * - PCI and non-

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

2018-04-23 Thread Jacob Pan
On Mon, 23 Apr 2018 11:11:41 +0100 Jean-Philippe Brucker wrote: > On Mon, Apr 16, 2018 at 10:48:59PM +0100, Jacob Pan wrote: > > +/** > > + * struct iommu_fault_event - Generic per device fault data > > + * > > + * - PCI and non-PCI devices > > + * - Reco

Re: [PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function

2018-04-20 Thread Jacob Pan
On Fri, 20 Apr 2018 19:25:34 +0100 Jean-Philippe Brucker wrote: > On Tue, Apr 17, 2018 at 08:10:47PM +0100, Alex Williamson wrote: > [...] > > > + /* Assign guest PASID table pointer and size order */ > > > + ctx_lo = (pasidt_binfo->base_ptr & VTD_PAGE_MASK) | > >

Re: [PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function

2018-04-20 Thread Jacob Pan
On Fri, 20 Apr 2018 19:25:34 +0100 Jean-Philippe Brucker wrote: > On Tue, Apr 17, 2018 at 08:10:47PM +0100, Alex Williamson wrote: > [...] > > > + /* Assign guest PASID table pointer and size order */ > > > + ctx_lo = (pasidt_binfo->base_ptr & VTD_PAGE_MASK) | > > > +

Re: [PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function

2018-04-20 Thread Jacob Pan
On Tue, 17 Apr 2018 13:10:47 -0600 Alex Williamson <alex.william...@redhat.com> wrote: > On Mon, 16 Apr 2018 14:48:53 -0700 > Jacob Pan <jacob.jun@linux.intel.com> wrote: > > > Add Intel VT-d ops to the generic iommu_bind_pasid_table API > > functio

Re: [PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function

2018-04-20 Thread Jacob Pan
On Tue, 17 Apr 2018 13:10:47 -0600 Alex Williamson wrote: > On Mon, 16 Apr 2018 14:48:53 -0700 > Jacob Pan wrote: > > > Add Intel VT-d ops to the generic iommu_bind_pasid_table API > > functions. > > > > The primary use case is for direct assignment of SVM ca

Re: [PATCH v4 09/22] iommu/vt-d: add svm/sva invalidate function

2018-04-20 Thread Jacob Pan
On Tue, 17 Apr 2018 13:10:45 -0600 Alex Williamson <alex.william...@redhat.com> wrote: > On Mon, 16 Apr 2018 14:48:58 -0700 > Jacob Pan <jacob.jun@linux.intel.com> wrote: > > > When Shared Virtual Address (SVA) is enabled for a guest OS via > > vIOMMU, we nee

Re: [PATCH v4 09/22] iommu/vt-d: add svm/sva invalidate function

2018-04-20 Thread Jacob Pan
On Tue, 17 Apr 2018 13:10:45 -0600 Alex Williamson wrote: > On Mon, 16 Apr 2018 14:48:58 -0700 > 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 l

[PATCH v4 02/22] iommu/vt-d: move device_domain_info to header

2018-04-16 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 v4 02/22] iommu/vt-d: move device_domain_info to header

2018-04-16 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 --- drivers/iommu/intel-iommu.c | 18 -- include/linux/intel-iommu.h | 19 +++ 2 files changed, 19

[PATCH v4 03/22] iommu/vt-d: add a flag for pasid table bound status

2018-04-16 Thread Jacob Pan
Adding a flag in device domain into to track whether a guest or user PASID table is bound to a device. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> --- include/linux/intel-iommu.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/intel-iommu.h b/include/linux

[PATCH v4 03/22] iommu/vt-d: add a flag for pasid table bound status

2018-04-16 Thread Jacob Pan
Adding a flag in device domain into to track whether a guest or user PASID table is bound to a device. Signed-off-by: Jacob Pan --- include/linux/intel-iommu.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index 304afae..ddc7d79

[PATCH v4 01/22] iommu: introduce bind_pasid_table API function

2018-04-16 Thread Jacob Pan
table of assigned devices. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> Signed-off-by: Liu, Yi L <yi.l@linux.intel.com> Signed-off-by: Ashok Raj <ashok@intel.com> Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> --- d

[PATCH v4 01/22] iommu: introduce bind_pasid_table API function

2018-04-16 Thread Jacob Pan
table of assigned devices. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Liu, Yi L Signed-off-by: Ashok Raj Signed-off-by: Jacob Pan --- drivers/iommu/iommu.c | 19 +++ include/linux/iommu.h | 24 include/uapi/linux/iommu.

[PATCH v4 12/22] iommu: introduce device fault report API

2018-04-16 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> Signed-off-by: Jean-Philip

[PATCH v4 12/22] iommu: introduce device fault report API

2018-04-16 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 Signed-off-by: Ashok Raj Signed-off-by: Jean-Philippe Brucker --- drivers/iommu/iommu.c |

[PATCH v4 11/22] driver core: add per device iommu param

2018-04-16 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> Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.c

[PATCH v4 11/22] driver core: add per device iommu param

2018-04-16 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 Signed-off-by: Jacob Pan Signed-off-by: Jean-Philippe Brucker Link: https://lkml.org/lkml/2017/10/6/81 --- include/linux/device.h | 3 +++ 1 file changed, 3

[PATCH v4 00/22] IOMMU and VT-d driver support for Shared Virtual Address (SVA)

2018-04-16 Thread Jacob Pan
ion for DMAR fault interrupt and fault reporting Jacob Pan (21): iommu: introduce bind_pasid_table API function iommu/vt-d: move device_domain_info to header iommu/vt-d: add a flag for pasid table bound status iommu/vt-d: add bind_pasid_table function iommu/vt-d: add definitions

[PATCH v4 00/22] IOMMU and VT-d driver support for Shared Virtual Address (SVA)

2018-04-16 Thread Jacob Pan
eport data - Support page 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 (21): iommu:

[PATCH v4 05/22] iommu: introduce iommu invalidate API function

2018-04-16 Thread Jacob Pan
t; Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Ashok Raj <ashok@intel.com> --- drivers/iommu/iommu.c | 14 include/linux/iommu.h | 12

[PATCH v4 05/22] iommu: introduce iommu invalidate API function

2018-04-16 Thread Jacob Pan
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 Signed-off-by: Jean-Philippe Brucker Signed-off-by: Jacob Pan

[PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function

2018-04-16 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 v4 04/22] iommu/vt-d: add bind_pasid_table function

2018-04-16 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 Signed-off-by: Liu, Yi L Signed-off

[PATCH v4 14/22] iommu: handle page response timeout

2018-04-16 Thread Jacob Pan
timer expires but not included in this patch. We need to consider the life cycle of page groupd ID to prevent confusion with reused group ID by a device. For now, a warning message provides clue of such failure. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Signed-off-by: Ashok Raj

[PATCH v4 15/22] iommu/config: add build dependency for dmar

2018-04-16 Thread Jacob Pan
-off-by: Jacob Pan <jacob.jun@linux.intel.com> --- drivers/iommu/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index 73590ba..8d8b63f 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -139,6 +139,7 @@ config AMD_IO

[PATCH v4 13/22] iommu: introduce page response function

2018-04-16 Thread Jacob Pan
. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Link: https://lkml.org/lkml/2017/12/7/1725 --- drivers/iommu/iommu.c | 45 include/linux/

[PATCH v4 14/22] iommu: handle page response timeout

2018-04-16 Thread Jacob Pan
timer expires but not included in this patch. We need to consider the life cycle of page groupd ID to prevent confusion with reused group ID by a device. For now, a warning message provides clue of such failure. Signed-off-by: Jacob Pan Signed-off-by: Ashok Raj --- drivers/iommu/iommu.c | 60

[PATCH v4 15/22] iommu/config: add build dependency for dmar

2018-04-16 Thread Jacob Pan
-off-by: Jacob Pan --- drivers/iommu/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index 73590ba..8d8b63f 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -139,6 +139,7 @@ config AMD_IOMMU_V2 # Intel IOMMU support config

[PATCH v4 13/22] iommu: introduce page response function

2018-04-16 Thread Jacob Pan
. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Jacob Pan Link: https://lkml.org/lkml/2017/12/7/1725 --- drivers/iommu/iommu.c | 45 include/linux/iommu.h | 52 +++ 2 files changed, 97 insertions

[PATCH v4 16/22] iommu/vt-d: report non-recoverable faults to device

2018-04-16 Thread Jacob Pan
and interrupt remapping which has to be set up early before threaded IRQ is available. This patch adds an option and a workqueue such that when faults are requested, DMAR fault IRQ handler can use the IOMMU fault reporting API to report. Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> Sign

[PATCH v4 16/22] iommu/vt-d: report non-recoverable faults to device

2018-04-16 Thread Jacob Pan
and interrupt remapping which has to be set up early before threaded IRQ is available. This patch adds an option and a workqueue such that when faults are requested, DMAR fault IRQ handler can use the IOMMU fault reporting API to report. Signed-off-by: Jacob Pan Signed-off-by: Liu, Yi L Signed-off

<    1   2   3   4   5   6   7   8   9   10   >