[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 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 Signed-off-by: Ashok Raj --- drivers/iommu/iommu.c | 56 ++- include/l

[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 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 Signed-off-by: Ashok Raj --- drivers/iommu/dmar.c | 95 +++- 1 file changed, 94 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c index ae33d61

[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 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 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 Signed-off-by: Ashok Raj --- drivers/iommu/intel-svm.c | 87 +++ include/linux/iommu.h | 1

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

[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 03/16] iommu: introduce iommu invalidate API function

2017-10-05 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: Jacob Pan Signed-off-by: Ashok Raj --- dri

[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 15/16] iommu: introduce page response function

2017-10-05 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

[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 --- drivers/iommu/intel-iommu.c | 30 ++ 1 file changed, 30 insertions(+) diff

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

2017-10-05 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 --- drivers/iommu/iommu.c | 14

Re: [PATCH RFC hack dont apply] intel_idle: support running within a VM

2017-10-04 Thread Jacob Pan
On Wed, 4 Oct 2017 20:12:28 +0300 "Michael S. Tsirkin" <m...@redhat.com> wrote: > On Wed, Oct 04, 2017 at 10:09:39AM -0700, Jacob Pan wrote: > > On Wed, 4 Oct 2017 05:09:09 +0300 > > "Michael S. Tsirkin" <m...@redhat.com> wrote: > > >

Re: [PATCH RFC hack dont apply] intel_idle: support running within a VM

2017-10-04 Thread Jacob Pan
On Wed, 4 Oct 2017 20:12:28 +0300 "Michael S. Tsirkin" wrote: > On Wed, Oct 04, 2017 at 10:09:39AM -0700, Jacob Pan wrote: > > On Wed, 4 Oct 2017 05:09:09 +0300 > > "Michael S. Tsirkin" wrote: > > > > > On Mon, Oct 02, 2017 at 10:12:49AM -07

Re: [PATCH RFC hack dont apply] intel_idle: support running within a VM

2017-10-04 Thread Jacob Pan
On Wed, 4 Oct 2017 05:09:09 +0300 "Michael S. Tsirkin" <m...@redhat.com> wrote: > On Mon, Oct 02, 2017 at 10:12:49AM -0700, Jacob Pan wrote: > > On Sat, 30 Sep 2017 01:21:43 +0200 > > "Rafael J. Wysocki" <raf...@kernel.org> wrote: > > >

Re: [PATCH RFC hack dont apply] intel_idle: support running within a VM

2017-10-04 Thread Jacob Pan
On Wed, 4 Oct 2017 05:09:09 +0300 "Michael S. Tsirkin" wrote: > On Mon, Oct 02, 2017 at 10:12:49AM -0700, Jacob Pan wrote: > > On Sat, 30 Sep 2017 01:21:43 +0200 > > "Rafael J. Wysocki" wrote: > > > > > On Sat, Sep 30, 2017 at 12:01 AM, Mic

Re: [PATCH RFC hack dont apply] intel_idle: support running within a VM

2017-10-02 Thread Jacob Pan
On Sat, 30 Sep 2017 01:21:43 +0200 "Rafael J. Wysocki" wrote: > On Sat, Sep 30, 2017 at 12:01 AM, Michael S. Tsirkin > wrote: > > intel idle driver does not DTRT when running within a VM: > > when going into a deep power state, the right thing to > > do is to

Re: [PATCH RFC hack dont apply] intel_idle: support running within a VM

2017-10-02 Thread Jacob Pan
On Sat, 30 Sep 2017 01:21:43 +0200 "Rafael J. Wysocki" wrote: > On Sat, Sep 30, 2017 at 12:01 AM, Michael S. Tsirkin > wrote: > > intel idle driver does not DTRT when running within a VM: > > when going into a deep power state, the right thing to > > do is to exit to hypervisor rather than to

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, > + 0, > + 0, > + DMA_TLB_DSI_FLUSH); > } > > static inline void unlink_domain_info(struct device_domain_info > *info) [Jacob Pan]

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

2017-08-30 Thread Jacob Pan
DMA_CCMD_DEVICE_INVL); > + iommu->flush.flush_iotlb(iommu, > + did_old, > + 0, > + 0, > + DMA_TLB_DSI_FLUSH); > } > > static inline void unlink_domain_info(struct device_domain_info > *info) [Jacob Pan]

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: [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 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 > > - per devi

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 5/9] iommu: Introduce fault notifier API

2017-06-28 Thread Jacob Pan
On Wed, 28 Jun 2017 12:16:03 +0200 Joerg Roedel 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 > > +++ b/drivers/iommu

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: [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 wrote: > On Tue, Jun 27, 2017 at 12:47:57PM -0700, Jacob Pan wrote: > > From: "Liu, Yi L" > > > > When a SVM capable device is assigned to a guest, the first level > > page tables are owned by the guest

[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 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 Signed-off-by: Liu, Yi L Sign

[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 3/9] iommu: Introduce iommu do invalidate API function

2017-06-27 Thread Jacob Pan
he generic APIs introduced in this patch to have opaque data in the tlb_invalidate_info argument. Signed-off-by: Liu, Yi L Signed-off-by: Jacob Pan Signed-off-by: Ashok Raj --- drivers/iommu/iommu.c | 14 ++ include/linux/iommu.h | 12 include/uapi/linux/io

[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 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 Signed-off-by: Ashok Raj --- drivers/iommu/intel-svm.c | 89 ++- include/linux/iommu.h | 1

[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 7/9] iommu/dmar: notify unrecoverable faults

2017-06-27 Thread Jacob Pan
with PASID transactions. Signed-off-by: Jacob Pan Signed-off-by: Ashok Raj --- drivers/iommu/dmar.c | 38 +- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c index cbf7763..459a472 100644 --- a/drivers/iommu

[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 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 Signed-off-by: Ashok Raj --- drivers/iommu/intel-svm.c | 13 ++--- include/linux/intel-svm.h | 20 +++- 2 files changed, 5 insertions(+), 28 deletions(-) diff --git a/drivers

[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

[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 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&

[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 Signed-off-by: Ashok

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

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

[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 Signed-off-by: Jacob Pan Signed-off-by: Ashok

[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 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 Signed-off-by: Ashok Raj --- drivers/iommu/intel-iommu.c | 19 +-- include/linux/intel-iommu.h | 19 +++ 2 files changed, 20 insertions(+), 18 deletions(-) diff

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: [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 wrote: > On Fri, 23 Jun 2017 11:59:28 -0700 > Jacob Pan wrote: > > > On Thu, 22 Jun 2017 16:53:17 -0600 > > Alex Williamson wrote: > > > > > On Wed, 14 Jun 2017 15:22:59 -0700 > > > Jacob

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.

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.

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 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 wrote: > On Fri, 23 Jun 2017 11:19:52 -0700 > Jacob Pan wrote: > > > On Thu, 22 Jun 2017 16:52:15 -0600 > > Alex Williamson wrote: > > > > > On Wed, 14 Jun 2017 15:22:56 -0700 > >

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 7/9] iommu/dmar: notify unrecoverable faults

2017-06-23 Thread Jacob Pan
On Thu, 22 Jun 2017 16:54:16 -0600 Alex Williamson wrote: > On Wed, 14 Jun 2017 15:23:01 -0700 > Jacob Pan wrote: > > > Currently, when device DMA faults are detected by IOMMU the fault > > reasons are printed but the offending device is not notified. > > This

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 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 wrote: > On Wed, 14 Jun 2017 15:23:02 -0700 > Jacob Pan wrote: > > > If the source device of a page request has its PASID table pointer > > bond to a guest, the first level page tables are owned by the guest. > >

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-23 Thread Jacob Pan
On Thu, 22 Jun 2017 16:53:17 -0600 Alex Williamson wrote: > On Wed, 14 Jun 2017 15:22:59 -0700 > Jacob Pan wrote: > > > Traditionally, device specific faults are detected and handled > > within their own device drivers. When IOMMU is enabled, faults such > >

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 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 wrote: > On Wed, 14 Jun 2017 15:22:55 -0700 > Jacob Pan wrote: > > > Virtual IOMMU was proposed to support Shared Virtual Memory (SVM) > > use case in the guest: > > https://lists.gnu.org/archive/html/qemu-

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 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 wrote: > On Wed, 14 Jun 2017 15:22:56 -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

[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 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 Signed-off-by: Ashok

[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 ++

[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 Signed-off-by: Ashok Raj --- drivers/iommu/intel-iommu.c | 19 +-- include/linux/intel-iommu.h | 19 +++ 2 files changed, 20 insertions(+), 18 deletions(-) diff

[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 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 Signed-off-by: Ashok Raj --- drivers/iommu/intel-svm.c | 81 ++- 1 file changed, 80 insertions

[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 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 Signed-off-by: Liu, Yi L Sign

[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 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 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 Signed-off-by: Ashok Raj --- drivers/iommu/intel-svm.c | 13 ++--- include/linux/intel-svm.h | 20 +++- 2 files changed, 5 insertions(+), 28 deletions(-) diff --git a/drivers

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

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

2017-06-14 Thread Jacob Pan
he generic APIs introduced in this patch to have opaque data in the tlb_invalidate_info argument. Signed-off-by: Liu, Yi L Signed-off-by: Jacob Pan Signed-off-by: Ashok Raj --- drivers/iommu/iommu.c | 13 + include/linux/iommu.h | 11 +++ include/uapi/linux/iommu.h |

[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 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 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 Signed-off-by: Jacob Pan Signed-off-by: Ashok

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

2017-06-14 Thread Jacob Pan
with PASID transactions. Signed-off-by: Jacob Pan Signed-off-by: Ashok Raj --- drivers/iommu/dmar.c | 37 - 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c index cbf7763..2c0b80d464 100644 --- a/drivers/iommu

Re: [PATCH] intel_idle: Use more common logging style

2017-06-12 Thread Jacob Pan
gt; Signed-off-by: Joe Perches <j...@perches.com> Acked-by: Jacob Pan <jacob.jun@linux.intel.com> Thanks, > --- > drivers/idle/intel_idle.c | 32 > 1 file changed, 16 insertions(+), 16 deletions(-) > > diff --git a/drivers/idle/i

Re: [PATCH] intel_idle: Use more common logging style

2017-06-12 Thread Jacob Pan
On Fri, 9 Jun 2017 12:29:20 -0700 Joe Perches wrote: > Remove #define PREFIX and add #define pr_fmt to use more common > logging. > > Miscellanea: > > o Add missing newline to format > o Convert a single printk without KERN_ to pr_info > > Signed-off-by: Joe Pe

Re: [PATCH] x86/intel_idle: add GLK support

2017-05-04 Thread Jacob Pan
On Thu, 27 Apr 2017 00:36:42 +0200 "Rafael J. Wysocki" wrote: > > From: "Box, David E" > > > > Gemini Lake uses the same C-states as Broxton and also uses the > > IRTL MSR's to determine maximum C-state latency. > > > > Signed-off-by: David E. Box

Re: [PATCH] x86/intel_idle: add GLK support

2017-05-04 Thread Jacob Pan
On Thu, 27 Apr 2017 00:36:42 +0200 "Rafael J. Wysocki" wrote: > > From: "Box, David E" > > > > Gemini Lake uses the same C-states as Broxton and also uses the > > IRTL MSR's to determine maximum C-state latency. > > > > Signed-off-by: David E. Box > > You could use the code names

Re: [PATCH] powercap/intel_rapl: Add support for Gemini Lake

2017-04-24 Thread Jacob Pan
MONT, > rapl_defaults_core), > + RAPL_CPU(INTEL_FAM6_ATOM_GEMINI_LAKE, > rapl_defaults_core), RAPL_CPU(INTEL_FAM6_ATOM_DENVERTON, > rapl_defaults_core), > RAPL_CPU(INTEL_FAM6_XEON_PHI_KNL, > rapl_defaults_hsw_server), [Jacob Pan]

Re: [PATCH] powercap/intel_rapl: Add support for Gemini Lake

2017-04-24 Thread Jacob Pan
ATOM_DENVERTON, > rapl_defaults_core), > RAPL_CPU(INTEL_FAM6_XEON_PHI_KNL, > rapl_defaults_hsw_server), [Jacob Pan]

[PATCH] Doc/PM: Sync with intel_powerclamp code behavior

2017-04-14 Thread Jacob Pan
Commit feb6cd6a0f9f ("thermal/intel_powerclamp: stop sched tick in forced idle") changed how idle injection accouting, so we need to update the documentation accordingly. This patch also expands more details on the behavior of cur_state. Signed-off-by: Jacob Pan <jacob.jun@li

[PATCH] Doc/PM: Sync with intel_powerclamp code behavior

2017-04-14 Thread Jacob Pan
Commit feb6cd6a0f9f ("thermal/intel_powerclamp: stop sched tick in forced idle") changed how idle injection accouting, so we need to update the documentation accordingly. This patch also expands more details on the behavior of cur_state. Signed-off-by: Jacob Pan Reported-by: Wang

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("No RMRR found\n"); [Jacob Pan]

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

2017-03-29 Thread Jacob Pan
l > left > + * them enabled > + */ > + intel_disable_iommus(); > goto out_free_dmar; > + } > > if (list_empty(_rmrr_units)) > pr_info("No RMRR found\n"); [Jacob Pan]

Re: [PATCH] thermal/intel_powerclamp: Remove set-but-not-used variables

2017-01-31 Thread Jacob Pan
ermal/intel_powerclamp.c: In function ‘poll_pkg_cstate’: > drivers/thermal/intel_powerclamp.c:464:23: warning: variable > ‘jiffies_last’ set but not used [-Wunused-but-set-variable] > static unsigned long jiffies_last; > ^ > Acked-by: Jacob Pan <jacob.jun.

Re: [PATCH] thermal/intel_powerclamp: Remove set-but-not-used variables

2017-01-31 Thread Jacob Pan
amp.c: In function ‘poll_pkg_cstate’: > drivers/thermal/intel_powerclamp.c:464:23: warning: variable > ‘jiffies_last’ set but not used [-Wunused-but-set-variable] > static unsigned long jiffies_last; > ^ > Acked-by: Jacob Pan Thanks, > Signed-off-by: Augusto Mecki

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

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 wrote: > Different encodings are used to represent supported PASID bits > and number of PASID table entries. > The current code assigns ecap_pss directly to

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

2016-12-06 Thread Jacob Pan
the allocation limitation of PASID table. cc: Mika Kuoppala <mika.kuopp...@linux.intel.com> cc: Ashok Raj <ashok@intel.com> Signed-off-by: Jacob Pan <jacob.jun@linux.intel.com> --- drivers/iommu/intel-iommu.c | 23 ++- 1 file changed, 22 insertions(+), 1

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

2016-12-06 Thread Jacob Pan
the allocation limitation of PASID table. cc: Mika Kuoppala cc: Ashok Raj Signed-off-by: Jacob Pan --- drivers/iommu/intel-iommu.c | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 27596e6

<    3   4   5   6   7   8   9   10   11   12   >