[PATCH v5 13/19] iommu/vt-d: Move domain helper to header

2019-08-15 Thread Jacob Pan
Move domain helper to header to be used by SVA code. Signed-off-by: Jacob Pan Reviewed-by: Eric Auger --- drivers/iommu/intel-iommu.c | 6 -- include/linux/intel-iommu.h | 6 ++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu

[PATCH v5 00/19] Shared virtual address IOMMU and VT-d support

2019-08-15 Thread Jacob Pan
o and Alex Williamson on IOASID custom allocator. - Support multiple custom IOASID allocators (vIOMMUs) and dynamic registration. Jacob Pan (14): iommu: Add a timeout parameter for PRQ response iommu: handle page response timeout iommu: Introduce attach/detach_p

[PATCH v5 05/19] iommu: Introduce attach/detach_pasid_table API

2019-08-15 Thread Jacob Pan
. A generic iommu_pasid_table_config struct is introduced in a new iommu.h uapi header. This is going to be used by the VFIO user API. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Liu, Yi L Signed-off-by: Ashok Raj Signed-off-by: Jacob Pan Signed-off-by: Eric Auger Reviewed-by: Jean

[PATCH v5 04/19] iommu: Use device fault trace event

2019-08-15 Thread Jacob Pan
From: Jean-Philippe Brucker For performance and debugging purposes, these trace events help analyzing device faults 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 [JPB: removed

Re: [PATCH v4 21/22] iommu/vt-d: Support flushing more translation cache types

2019-08-14 Thread Jacob Pan
On Thu, 18 Jul 2019 10:35:37 +0200 Auger Eric wrote: > Hi Jacob, > > On 6/9/19 3:44 PM, Jacob Pan wrote: > > When Shared Virtual Memory is exposed to a guest via vIOMMU, > > scalable IOTLB invalidation may be passed down from outside IOMMU > > subsystems. This patch

Re: [PATCH v4 20/22] iommu/vt-d: Add bind guest PASID support

2019-08-14 Thread Jacob Pan
On Fri, 5 Jul 2019 10:21:27 +0800 Lu Baolu wrote: > Hi Jacob, > > On 6/28/19 4:22 AM, Jacob Pan wrote: > >>> + } > >>> + refcount_set(>refs, 0); > >>> + ioasid_set_data(data->hpasid, svm); > >>> +

Re: [PATCH v4 13/22] iommu/vt-d: Enlightened PASID allocation

2019-08-13 Thread Jacob Pan
Hi Eric, Apologize for the delayed response below, On Tue, 16 Jul 2019 11:29:30 +0200 Auger Eric wrote: > Hi Jacob, > On 6/9/19 3:44 PM, Jacob Pan wrote: > > From: Lu Baolu > > > > If Intel IOMMU runs in caching mode, a.k.a. virtual IOMMU, the > > IOMMU drive

Re: [PATCH v4 11/22] iommu: Introduce guest PASID bind function

2019-08-05 Thread Jacob Pan
On Tue, 16 Jul 2019 18:44:56 +0200 Auger Eric wrote: > > +struct gpasid_bind_data { > other structs in iommu.h are prefixed with iommu_? Good point, will add iommu_ prefix. Thanks, Jacob ___ iommu mailing list iommu@lists.linux-foundation.org

Re: [PATCH v4 11/22] iommu: Introduce guest PASID bind function

2019-08-05 Thread Jacob Pan
On Tue, 16 Jul 2019 18:44:56 +0200 Auger Eric wrote: > Hi Jacob, > > On 6/9/19 3:44 PM, Jacob Pan wrote: > > Guest shared virtual address (SVA) may require host to shadow guest > > PASID tables. Guest PASID can also be allocated from the host via > > enlightened inte

Re: [PATCH v4 20/22] iommu/vt-d: Add bind guest PASID support

2019-06-27 Thread Jacob Pan
On Thu, 27 Jun 2019 10:50:11 +0800 Lu Baolu wrote: > Hi Jacob and Yi, > > On 6/9/19 9:44 PM, Jacob Pan wrote: > > When supporting guest SVA with emulated IOMMU, the guest PASID > > table is shadowed in VMM. Updates to guest vIOMMU PASID table > > will result

Re: [PATCH v4 15/22] iommu/vt-d: Replace Intel specific PASID allocator with IOASID

2019-06-27 Thread Jacob Pan
On Thu, 27 Jun 2019 09:53:11 +0800 Lu Baolu wrote: > Hi Jacob, > > On 6/9/19 9:44 PM, Jacob Pan wrote: > > Make use of generic IOASID code to manage PASID allocation, > > free, and lookup. Replace Intel specific code. > > > > Signed-off-by: Jacob Pan > >

Re: [PATCH v4 12/22] iommu: Add I/O ASID allocator

2019-06-25 Thread Jacob Pan
Hi Jonathan, Thanks for the review, comments inline below. I saw Jean already took in changes based on your review in his sva/api tree. This is just some additions. On Tue, 18 Jun 2019 17:50:59 +0100 Jonathan Cameron wrote: > On Sun, 9 Jun 2019 06:44:12 -0700 > Jacob Pan wrote: >

Re: [PATCH v4 19/22] iommu/vt-d: Clean up for SVM device list

2019-06-24 Thread Jacob Pan
On Tue, 18 Jun 2019 17:42:37 +0100 Jonathan Cameron wrote: > On Sun, 9 Jun 2019 06:44:19 -0700 > Jacob Pan wrote: > > > Use combined macro for_each_svm_dev() to simplify SVM device > > iteration. > > > > Suggested-by: Andy Shevchenko > > Signed-off-by:

Re: [PATCH v4 17/22] iommu/vt-d: Avoid duplicated code for PASID setup

2019-06-24 Thread Jacob Pan
On Tue, 18 Jun 2019 17:03:35 +0100 Jonathan Cameron wrote: > On Sun, 9 Jun 2019 06:44:17 -0700 > Jacob Pan wrote: > > > After each setup for PASID entry, related translation caches must > > be flushed. We can combine duplicated code into one function which &g

Re: [PATCH v4 20/22] iommu/vt-d: Add bind guest PASID support

2019-06-24 Thread Jacob Pan
On Tue, 18 Jun 2019 17:44:49 +0100 Jonathan Cameron wrote: > On Sun, 9 Jun 2019 06:44:20 -0700 > Jacob Pan wrote: > > > When supporting guest SVA with emulated IOMMU, the guest PASID > > table is shadowed in VMM. Updates to guest vIOMMU PASID table > > will result

Re: [PATCH v4 10/22] iommu: Fix compile error without IOMMU_API

2019-06-24 Thread Jacob Pan
On Tue, 18 Jun 2019 15:10:31 +0100 Jonathan Cameron wrote: > On Sun, 9 Jun 2019 06:44:10 -0700 > Jacob Pan wrote: > > > struct page_response_msg needs to be defined outside > > CONFIG_IOMMU_API. > > What was the error? > struct page_response_msg can be undef

Re: [PATCH v4 11/22] iommu: Introduce guest PASID bind function

2019-06-24 Thread Jacob Pan
On Tue, 18 Jun 2019 16:36:33 +0100 Jean-Philippe Brucker wrote: > On 09/06/2019 14:44, Jacob Pan wrote: > > Guest shared virtual address (SVA) may require host to shadow guest > > PASID tables. Guest PASID can also be allocated from the host via > > enlightened interfaces

Re: [PATCH v4 15/22] iommu/vt-d: Replace Intel specific PASID allocator with IOASID

2019-06-24 Thread Jacob Pan
On Tue, 18 Jun 2019 16:57:09 +0100 Jonathan Cameron wrote: > On Sun, 9 Jun 2019 06:44:15 -0700 > Jacob Pan wrote: > > > Make use of generic IOASID code to manage PASID allocation, > > free, and lookup. Replace Intel specific code. > > > > Signed-off-by:

[PATCH] irq_remapping/vt-d: cleanup unused variable

2019-06-24 Thread Jacob Pan
Linux IRQ number virq is not used in IRTE allocation. Remove it. Signed-off-by: Jacob Pan --- drivers/iommu/intel_irq_remapping.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c index 4160aa9

Re: [RFC PATCH v4 20/21] iommu/vt-d: hpet: Reserve an interrupt remampping table entry for watchdog

2019-06-21 Thread Jacob Pan
On Fri, 21 Jun 2019 10:31:26 -0700 Jacob Pan wrote: > On Fri, 21 Jun 2019 17:33:28 +0200 (CEST) > Thomas Gleixner wrote: > > > On Wed, 19 Jun 2019, Jacob Pan wrote: > > > On Tue, 18 Jun 2019 01:08:06 +0200 (CEST) > > > Thomas Gleixner wrote: >

Re: [RFC PATCH v4 20/21] iommu/vt-d: hpet: Reserve an interrupt remampping table entry for watchdog

2019-06-21 Thread Jacob Pan
On Fri, 21 Jun 2019 17:33:28 +0200 (CEST) Thomas Gleixner wrote: > On Wed, 19 Jun 2019, Jacob Pan wrote: > > On Tue, 18 Jun 2019 01:08:06 +0200 (CEST) > > Thomas Gleixner wrote: > > > > > > Unless this problem is not solved and I doubt it can be solved &g

Re: [RFC PATCH v4 20/21] iommu/vt-d: hpet: Reserve an interrupt remampping table entry for watchdog

2019-06-19 Thread Jacob Pan
r millisecond. No idea how big the penalty > is, but it's certainly not free. > > One possible way out would be to use a combined approach of > building CPU groups (lets say 8) where one of the CPUs gets the NMI > and IPIs the other 7 and then round robins to the next group. Whether > that's any better, I can't tell. > > Sorry that I can't come up with the magic cure and just can provide > more questions than answers. > > Thanks, > > tglx > > > > ___ > 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 v8 26/29] vfio-pci: Register an iommu fault handler

2019-06-18 Thread Jacob Pan
On Tue, 18 Jun 2019 15:04:36 +0100 Jean-Philippe Brucker wrote: > On 12/06/2019 19:53, Jacob Pan wrote: > >>> You are right, the worst case of the spurious PS is to terminate > >>> the group prematurely. Need to know the scope of the HW damage in > >>> cas

Re: [PATCH 1/8] iommu: Add I/O ASID allocator

2019-06-18 Thread Jacob Pan
On Tue, 18 Jun 2019 15:22:20 +0100 Jean-Philippe Brucker wrote: > On 11/06/2019 19:13, Jacob Pan wrote: > >>>> +/** > >>>> + * ioasid_find - Find IOASID data > >>>> + * @set: the IOASID set > >>>> + * @ioasid: the IOASID t

Re: [PATCH] iommu: Add padding to struct iommu_fault

2019-06-12 Thread Jacob Pan
{ > __u32 type; > __u32 padding; > union { > struct iommu_fault_unrecoverable event; > struct iommu_fault_page_request prm; > + __u8 padding2[56]; > }; > }; > Acked-by: Jacob Pan > /**

Re: [PATCH v2 0/4] iommu: Add device fault reporting API

2019-06-12 Thread Jacob Pan
ing the structure size to 64 bytes (currently > > 48) > > Sounds good, please submit the patch. > Could you also add padding to page response per our discussion here? https://lkml.org/lkml/2019/6/12/1131 > Regards, > > Joerg [Jacob Pan]

Re: [PATCH v8 26/29] vfio-pci: Register an iommu fault handler

2019-06-12 Thread Jacob Pan
On Tue, 11 Jun 2019 14:14:33 +0100 Jean-Philippe Brucker wrote: > On 10/06/2019 22:31, Jacob Pan wrote: > > On Mon, 10 Jun 2019 13:45:02 +0100 > > Jean-Philippe Brucker wrote: > > > >> On 07/06/2019 18:43, Jacob Pan wrote: > >>&g

Re: [PATCH 1/8] iommu: Add I/O ASID allocator

2019-06-11 Thread Jacob Pan
the IOASID should knows its own data type. My thought was that @set is only used to group IDs, permission check etc. > Jacob, could me make @set mandatory, or do you see a use for a global > search? If @set is NULL, then callers can check if the return pointer > is NULL, but will ru

Re: [PATCH 1/8] iommu: Add I/O ASID allocator

2019-06-11 Thread Jacob Pan
On Tue, 11 Jun 2019 15:37:42 +0100 Jean-Philippe Brucker wrote: > On 11/06/2019 13:26, Jacob Pan wrote: > >> +/** > >> + * ioasid_set_data - Set private data for an allocated ioasid > >> + * @ioasid: the ID to set data > >> + * @data: the pr

Re: [PATCH 1/8] iommu: Add I/O ASID allocator

2019-06-11 Thread Jacob Pan
stem but in rare > occasions drivers would like to allocate PASIDs for devices that > aren't managed by an IOMMU, using the same ID space as IOMMU. > > Signed-off-by: Jean-Philippe Brucker > Signed-off-by: Jacob Pan > --- > The most recent discussion on this patch was at: &

Re: [PATCH v8 26/29] vfio-pci: Register an iommu fault handler

2019-06-10 Thread Jacob Pan
On Mon, 10 Jun 2019 13:45:02 +0100 Jean-Philippe Brucker wrote: > On 07/06/2019 18:43, Jacob Pan wrote: > >>> So it seems we agree on the following: > >>> - iommu_unregister_device_fault_handler() will never fail > >>> - iommu driver cl

[PATCH v4 08/22] iommu: Introduce attach/detach_pasid_table API

2019-06-09 Thread Jacob Pan
. A generic iommu_pasid_table_config struct is introduced in a new iommu.h uapi header. This is going to be used by the VFIO user API. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Liu, Yi L Signed-off-by: Ashok Raj Signed-off-by: Jacob Pan Signed-off-by: Eric Auger Reviewed-by: Jean

[PATCH v4 12/22] iommu: Add I/O ASID allocator

2019-06-09 Thread Jacob Pan
. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Jacob Pan Link: https://lkml.org/lkml/2019/4/26/462 --- drivers/iommu/Kconfig | 8 + drivers/iommu/Makefile | 1 + drivers/iommu/ioasid.c | 427 + include/linux/ioasid.h | 74 + 4 files

[PATCH v4 14/22] iommu/vt-d: Add custom allocator for IOASID

2019-06-09 Thread Jacob Pan
that PASID namespace is system- wide. Signed-off-by: Lu Baolu Signed-off-by: Liu, Yi L Signed-off-by: Jacob Pan --- drivers/iommu/Kconfig | 1 + drivers/iommu/intel-iommu.c | 60 + include/linux/intel-iommu.h | 2 ++ 3 files changed, 63 insertions

[PATCH v4 15/22] iommu/vt-d: Replace Intel specific PASID allocator with IOASID

2019-06-09 Thread Jacob Pan
Make use of generic IOASID code to manage PASID allocation, free, and lookup. Replace Intel specific code. Signed-off-by: Jacob Pan --- drivers/iommu/intel-iommu.c | 11 +-- drivers/iommu/intel-pasid.c | 36 drivers/iommu/intel-svm.c | 37

[PATCH v4 07/22] iommu: Use device fault trace event

2019-06-09 Thread Jacob Pan
For performance and debugging purposes, these trace events help analyzing device faults 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 [JPB: removed invalidate event, that will be added

[PATCH v4 18/22] iommu/vt-d: Add nested translation helper function

2019-06-09 Thread Jacob Pan
physical translation and SL performs guest physical to host physical translation. Signed-off-by: Jacob Pan Signed-off-by: Liu, Yi L --- drivers/iommu/intel-pasid.c | 93 + drivers/iommu/intel-pasid.h | 11 ++ 2 files changed, 104 insertions

[PATCH v4 10/22] iommu: Fix compile error without IOMMU_API

2019-06-09 Thread Jacob Pan
struct page_response_msg needs to be defined outside CONFIG_IOMMU_API. Signed-off-by: Jacob Pan --- include/linux/iommu.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 7a37336..8d766a8 100644 --- a/include/linux/iommu.h

[PATCH v4 22/22] iommu/vt-d: Add svm/sva invalidate function

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

[PATCH v4 17/22] iommu/vt-d: Avoid duplicated code for PASID setup

2019-06-09 Thread Jacob Pan
After each setup for PASID entry, related translation caches must be flushed. We can combine duplicated code into one function which is less error prone. Signed-off-by: Jacob Pan --- drivers/iommu/intel-pasid.c | 48 + 1 file changed, 18 insertions

[PATCH v4 19/22] iommu/vt-d: Clean up for SVM device list

2019-06-09 Thread Jacob Pan
Use combined macro for_each_svm_dev() to simplify SVM device iteration. Suggested-by: Andy Shevchenko Signed-off-by: Jacob Pan Reviewed-by: Eric Auger --- drivers/iommu/intel-svm.c | 79 +++ 1 file changed, 39 insertions(+), 40 deletions(-) diff

[PATCH v4 13/22] iommu/vt-d: Enlightened PASID allocation

2019-06-09 Thread Jacob Pan
register and a virtual response register. Refer to section 10.4.42, 10.4.43, 10.4.44 for more information. This patch adds the enlightened PASID allocation/free interfaces via the virtual command register. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Signed-off-by: Liu Yi L Signed-off-by: Lu Baolu

[PATCH v4 11/22] iommu: Introduce guest PASID bind function

2019-06-09 Thread Jacob Pan
ere: - FL = First level/stage one page tables - SL = Second level/stage two page tables - GP = Guest PASID - HP = Host PASID * Conversion needed if non-identity GP-HP mapping option is chosen. Signed-off-by: Jacob Pan Signed-off-by: Liu Yi L --- drivers/iommu/iommu.c |

[PATCH v4 09/22] iommu: Introduce cache_invalidate API

2019-06-09 Thread Jacob Pan
Signed-off-by: Jacob Pan Signed-off-by: Ashok Raj Signed-off-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- drivers/iommu/iommu.c | 10 + include/linux/iommu.h | 14 ++ include/uapi/linux/iommu.h | 110 + 3 files ch

[PATCH v4 21/22] iommu/vt-d: Support flushing more translation cache types

2019-06-09 Thread Jacob Pan
When Shared Virtual Memory is exposed to a guest via vIOMMU, scalable IOTLB invalidation may be passed down from outside IOMMU subsystems. This patch adds invalidation functions that can be used for additional translation cache types. Signed-off-by: Jacob Pan --- drivers/iommu/dmar.c

[PATCH v4 04/22] iommu: Add recoverable fault reporting

2019-06-09 Thread Jacob Pan
fault handler in the host, or a guest OS. Once handled, the fault must be completed by sending a page response back to the IOMMU. Add an iommu_page_response() function to complete a page fault. Signed-off-by: Jacob Pan Signed-off-by: Jean-Philippe Brucker --- drivers/iommu/iommu.c | 77

[PATCH v4 06/22] trace/iommu: Add sva trace events

2019-06-09 Thread Jacob Pan
From: Jean-Philippe Brucker For development only, trace I/O page faults and responses. Signed-off-by: Jacob Pan [JPB: removed the invalidate trace event, that will be added later] Signed-off-by: Jean-Philippe Brucker --- include/trace/events/iommu.h | 87

[PATCH v4 20/22] iommu/vt-d: Add bind guest PASID support

2019-06-09 Thread Jacob Pan
| | | '--' '-' Where: - FL = First level/stage one page tables - SL = Second level/stage two page tables Signed-off-by: Jacob Pan Signed-off-by: Liu, Yi L --- drivers/iommu/intel-iommu.c | 4 + drivers/iommu/intel-svm.c | 187

[PATCH v4 03/22] iommu: Introduce device fault report API

2019-06-09 Thread Jacob Pan
come later. Signed-off-by: Jacob Pan Signed-off-by: Ashok Raj Signed-off-by: Jean-Philippe Brucker Signed-off-by: Eric Auger --- drivers/iommu/iommu.c | 127 +- include/linux/iommu.h | 33 - 2 files changed, 157 insertions(+), 3 deletion

[PATCH v4 00/22] Shared virtual address IOMMU and VT-d support

2019-06-09 Thread Jacob Pan
ommon APIs (https://github.com/eauger/linux/tree/v5.1-rc3-2stage-v7) - Addressed review comments from Andy Shevchenko and Alex Williamson on IOASID custom allocator. - Support multiple custom IOASID allocators (vIOMMUs) and dynamic registration. Jac

[PATCH v4 01/22] driver core: Add per device iommu param

2019-06-09 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 v4 02/22] iommu: Introduce device fault data

2019-06-09 Thread Jacob Pan
internal faults that are likely to be reported to an external subsystem. Signed-off-by: Jacob Pan Signed-off-by: Jean-Philippe Brucker Signed-off-by: Liu, Yi L Signed-off-by: Ashok Raj Signed-off-by: Eric Auger --- include/linux/iommu.h | 44 + include/uapi/linux/iommu.h

[PATCH v4 05/22] iommu: Add a timeout parameter for PRQ response

2019-06-09 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 | 29 + 2 files changed, 37 insertions(+) diff --git a/Documentation

[PATCH v4 16/22] iommu/vt-d: Move domain helper to header

2019-06-09 Thread Jacob Pan
Move domainer helper to header to be used by SVA code. Signed-off-by: Jacob Pan --- drivers/iommu/intel-iommu.c | 6 -- include/linux/intel-iommu.h | 6 ++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index

Re: [PATCH v8 26/29] vfio-pci: Register an iommu fault handler

2019-06-07 Thread Jacob Pan
On Fri, 7 Jun 2019 11:28:13 +0100 Jean-Philippe Brucker wrote: > On 06/06/2019 21:29, Jacob Pan wrote: > >>>>>> iommu_unregister_device_fault_handler(>pdev->dev); > >>>>> > >>>>> > >>>>> B

Re: [PATCH v8 26/29] vfio-pci: Register an iommu fault handler

2019-06-06 Thread Jacob Pan
On Thu, 6 Jun 2019 19:54:05 +0100 Jean-Philippe Brucker wrote: > On 05/06/2019 23:45, Jacob Pan wrote: > > On Tue, 4 Jun 2019 18:11:08 +0200 > > Auger Eric wrote: > > > >> Hi Alex, > >> > >> On 6/4/19 12:31 AM, Alex Williamson wrote: >

Re: [PATCH v8 26/29] vfio-pci: Register an iommu fault handler

2019-06-05 Thread Jacob Pan
On Tue, 4 Jun 2019 18:11:08 +0200 Auger Eric wrote: > Hi Alex, > > On 6/4/19 12:31 AM, Alex Williamson wrote: > > On Sun, 26 May 2019 18:10:01 +0200 > > Eric Auger wrote: > > > >> This patch registers a fault handler which records faults in > >> a circular buffer and then signals an

Re: [PATCH v2 2/4] iommu: Introduce device fault data

2019-06-05 Thread Jacob Pan
On Wed, 5 Jun 2019 12:24:09 +0100 Jean-Philippe Brucker wrote: > On 05/06/2019 09:51, Tian, Kevin wrote: > >> From: Jacob Pan > >> Sent: Tuesday, June 4, 2019 6:09 AM > >> > >> On Mon, 3 Jun 2019 15:57:47 +0100 > >> Jean-Philippe Br

Re: [PATCH v2 2/4] iommu: Introduce device fault data

2019-06-05 Thread Jacob Pan
On Wed, 5 Jun 2019 08:51:45 + "Tian, Kevin" wrote: > > From: Jacob Pan > > Sent: Tuesday, June 4, 2019 6:09 AM > > > > On Mon, 3 Jun 2019 15:57:47 +0100 > > Jean-Philippe Brucker wrote: > > > > > +/** > > > + * stru

Re: [PATCH v8 05/29] iommu: Add a timeout parameter for PRQ response

2019-06-04 Thread Jacob Pan
On Tue, 4 Jun 2019 11:52:18 +0100 Jean-Philippe Brucker wrote: > On 03/06/2019 23:32, Alex Williamson wrote: > > It doesn't seem to make much sense to include this patch without > > also including "iommu: handle page response timeout". Was that one > > lost? Dropped? Lives elsewhere? > >

Re: [PATCH v8 04/29] iommu: Add recoverable fault reporting

2019-06-04 Thread Jacob Pan
completed by sending a page > > response back to the IOMMU. Add an iommu_page_response() function > > to complete a page fault. > > > > Signed-off-by: Jacob Pan > > Signed-off-by: Jean-Philippe Brucker > > --- > > drivers/iommu/iommu.c | 77 > > +

Re: [PATCH v2 2/4] iommu: Introduce device fault data

2019-06-03 Thread Jacob Pan
On Mon, 3 Jun 2019 15:57:47 +0100 Jean-Philippe Brucker wrote: > +/** > + * struct iommu_fault_page_request - Page Request data > + * @flags: encodes whether the corresponding fields are valid and > whether this > + * is the last page in group (IOMMU_FAULT_PAGE_REQUEST_* > values) > + *

Re: [PATCH v2 0/4] iommu: Add device fault reporting API

2019-06-03 Thread Jacob Pan
tps://lore.kernel.org/lkml/20190523180613.55049-1-jean-philippe.bruc...@arm.com/ > > Jacob Pan (3): > driver core: Add per device iommu param > iommu: Introduce device fault data > iommu: Introduce device fault report API > > Jean-Philippe Brucker (1): > iommu: Add recov

Re: [PATCH 4/4] iommu: Add recoverable fault reporting

2019-05-24 Thread Jacob Pan
The consumer of the fault can be either an I/O page fault handler in > the host, or a guest OS. > > Once handled, the fault must be completed by sending a page response > back to the IOMMU. Add an iommu_page_response() function to complete > a page fault. > > Signed-off-by:

Re: [PATCH 3/4] iommu: Introduce device fault report API

2019-05-24 Thread Jacob Pan
On Thu, 23 May 2019 19:56:54 +0100 Robin Murphy wrote: > On 23/05/2019 19:06, Jean-Philippe Brucker wrote: > > From: Jacob Pan > > > > Traditionally, device specific faults are detected and handled > > within their own device drivers. When IOMMU is enabled, fau

Re: [PATCH 2/4] iommu: Introduce device fault data

2019-05-24 Thread Jacob Pan
On Fri, 24 May 2019 17:14:30 +0100 Jean-Philippe Brucker wrote: > On 24/05/2019 14:49, Jacob Pan wrote: > > On Thu, 23 May 2019 19:43:46 +0100 > > Robin Murphy wrote: > >>> +/** > >>> + * struct iommu_fault_event - Generic fault event > >>

Re: [PATCH 2/4] iommu: Introduce device fault data

2019-05-24 Thread Jacob Pan
On Thu, 23 May 2019 19:43:46 +0100 Robin Murphy wrote: > On 23/05/2019 19:06, Jean-Philippe Brucker wrote: > > From: Jacob Pan > > > > Device faults detected by IOMMU can be reported outside the IOMMU > > subsystem for further processing. This patch introduces >

Re: [PATCH v3 04/16] ioasid: Add custom IOASID allocator

2019-05-23 Thread Jacob Pan
On Thu, 23 May 2019 09:14:07 +0200 Auger Eric wrote: > Hi Jacob, > > On 5/22/19 9:42 PM, Jacob Pan wrote: > > On Tue, 21 May 2019 11:55:55 +0200 > > Auger Eric wrote: > > > >> Hi Jacob, > >> > >> On 5/4/19 12:32 AM, Jacob Pan wrote

Re: [PATCH v3 04/16] ioasid: Add custom IOASID allocator

2019-05-22 Thread Jacob Pan
On Tue, 21 May 2019 11:55:55 +0200 Auger Eric wrote: > Hi Jacob, > > On 5/4/19 12:32 AM, Jacob Pan wrote: > > Sometimes, IOASID allocation must be handled by platform specific > > code. The use cases are guest vIOMMU and pvIOMMU where IOASIDs need > > to be allocated

Re: [PATCH v3 09/16] iommu: Introduce guest PASID bind function

2019-05-22 Thread Jacob Pan
On Wed, 22 May 2019 16:05:53 +0100 Jean-Philippe Brucker wrote: > On 21/05/2019 23:50, Jacob Pan wrote: > >>> /** > >>> * struct gpasid_bind_data - Information about device and guest > >>> PASID binding > >>> * @version: Version of this

Re: [PATCH v3 09/16] iommu: Introduce guest PASID bind function

2019-05-21 Thread Jacob Pan
On Tue, 21 May 2019 17:09:40 +0100 Jean-Philippe Brucker wrote: > On 20/05/2019 20:22, Jacob Pan wrote: > > On Thu, 16 May 2019 09:14:29 -0700 > > Jacob Pan wrote: > > > >> On Thu, 16 May 2019 15:14:40 +0100 > >> Jean-Philippe Brucker wrote: > >

Re: [PATCH v3 03/16] iommu: Add I/O ASID allocator

2019-05-21 Thread Jacob Pan
On Tue, 21 May 2019 11:41:52 +0200 Auger Eric wrote: > Hi, > > On 5/4/19 12:32 AM, Jacob Pan wrote: > > From: Jean-Philippe Brucker > > > > Some devices might support multiple DMA address spaces, in > > particular those that have the PCI PASID feature. PA

Re: [PATCH v3 03/16] iommu: Add I/O ASID allocator

2019-05-21 Thread Jacob Pan
On Tue, 21 May 2019 10:21:55 +0200 Auger Eric wrote: > Hi, > > On 5/4/19 12:32 AM, Jacob Pan wrote: > > From: Jean-Philippe Brucker > > > > Some devices might support multiple DMA address spaces, in > > particular those that have the PCI PASID feature. PA

Re: [PATCH v3 09/16] iommu: Introduce guest PASID bind function

2019-05-20 Thread Jacob Pan
On Thu, 16 May 2019 09:14:29 -0700 Jacob Pan wrote: > On Thu, 16 May 2019 15:14:40 +0100 > Jean-Philippe Brucker wrote: > > > Hi Jacob, > > > > On 03/05/2019 23:32, Jacob Pan wrote: > > > +/** > > > + * struct gpasid_bind_data - Informati

Re: [PATCH] iommu/vt-d: Fix bind svm with multiple devices

2019-05-20 Thread Jacob Pan
Hi Joerg & David, Any feedback on this one? Thanks. On Wed, 8 May 2019 12:22:46 -0700 Jacob Pan wrote: > If multiple devices try to bind to the same mm/PASID, we need to > set up first level PASID entries for all the devices. The current > code does not consider this case

Re: [PATCH v3 09/16] iommu: Introduce guest PASID bind function

2019-05-16 Thread Jacob Pan
On Thu, 16 May 2019 15:14:40 +0100 Jean-Philippe Brucker wrote: > Hi Jacob, > > On 03/05/2019 23:32, Jacob Pan wrote: > > +/** > > + * struct gpasid_bind_data - Information about device and guest > > PASID binding > > + * @gcr3: Guest CR3 value from guest m

Re: [PATCH v3 00/16] Shared virtual address IOMMU and VT-d support

2019-05-15 Thread Jacob Pan
additional comments together. Thanks! Jacob On Fri, 3 May 2019 15:32:01 -0700 Jacob Pan wrote: > Shared virtual address (SVA), a.k.a, Shared virtual memory (SVM) on > Intel platforms allow address space sharing between device DMA and > applications. SVA can reduce programming complexity an

Re: [PATCH v3 02/16] iommu: Introduce cache_invalidate API

2019-05-15 Thread Jacob Pan
On Wed, 15 May 2019 16:52:46 +0100 Jean-Philippe Brucker wrote: > On 14/05/2019 18:55, Jacob Pan wrote: > > Yes, I agree to replace the standalone __64 pasid with this struct. > > Looks more inline with address selective info., Just to double > > confirm the new struct. &g

Re: [PATCH v3 02/16] iommu: Introduce cache_invalidate API

2019-05-14 Thread Jacob Pan
On Tue, 14 May 2019 10:44:01 -0700 Jacob Pan wrote: > Hi Thank you both for the explanation. > > On Tue, 14 May 2019 11:41:24 +0100 > Jean-Philippe Brucker wrote: > > > On 14/05/2019 08:36, Auger Eric wrote: > > > Hi Jacob, > > > >

Re: [PATCH v3 02/16] iommu: Introduce cache_invalidate API

2019-05-14 Thread Jacob Pan
On Tue, 14 May 2019 13:02:47 +0200 Auger Eric wrote: > Hi Jean, > > On 5/14/19 12:42 PM, Jean-Philippe Brucker wrote: > > On 14/05/2019 08:46, Auger Eric wrote: > >> Hi Jean, > >> > >> On 5/13/19 7:09 PM, Jean-Philippe Brucker wrote: > >>> On 13/05/2019 17:50, Auger Eric wrote: > >

Re: [PATCH v3 02/16] iommu: Introduce cache_invalidate API

2019-05-14 Thread Jacob Pan
Hi Thank you both for the explanation. On Tue, 14 May 2019 11:41:24 +0100 Jean-Philippe Brucker wrote: > On 14/05/2019 08:36, Auger Eric wrote: > > Hi Jacob, > > > > On 5/14/19 12:16 AM, Jacob Pan wrote: > >> On Mon, 13 May 2019 18:09:48 +0100 >

Re: [PATCH v3 02/16] iommu: Introduce cache_invalidate API

2019-05-13 Thread Jacob Pan
plain a little more on ARCHID use cases. We have three fileds called pasid under this struct iommu_cache_invalidate_info{} Gets confusing :) > Thanks, > Jean > > > > > Domain invalidation would invalidate all the contexts belonging to > > that domain. > > > >

Re: [PATCH 3/4] iommu/vt-d: Handle RMRR with PCI bridge device scopes

2019-05-13 Thread Jacob Pan
t; for_each_active_dev_scope(rmrr->devices, > rmrr->devices_cnt, i, tmp) > - if (tmp == dev) { > + if (tmp == dev || > + is_downstream_to_pci_bridge(dev, tmp)) { > rcu_read_unlock(); > return true; > } [Jacob Pan] ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

[PATCH] iommu/vt-d: Fix bind svm with multiple devices

2019-05-08 Thread Jacob Pan
If multiple devices try to bind to the same mm/PASID, we need to set up first level PASID entries for all the devices. The current code does not consider this case which results in failed DMA for devices after the first bind. Signed-off-by: Jacob Pan Reported-by: Mike Campin --- drivers/iommu

Re: [PATCH v2 08/19] ioasid: Add custom IOASID allocator

2019-05-06 Thread Jacob Pan
On Fri, 26 Apr 2019 08:19:03 -0700 Jacob Pan wrote: > > >>> + default_allocator_used = 1; > > >> shouldn't default_allocator_used be protected as well? > > [...] > > >> wouldn't it be possible to integrate the default io

[PATCH v3 15/16] iommu/vt-d: Support flushing more translation cache types

2019-05-03 Thread Jacob Pan
When Shared Virtual Memory is exposed to a guest via vIOMMU, scalable IOTLB invalidation may be passed down from outside IOMMU subsystems. This patch adds invalidation functions that can be used for additional translation cache types. Signed-off-by: Jacob Pan --- drivers/iommu/dmar.c

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

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

[PATCH v3 09/16] iommu: Introduce guest PASID bind function

2019-05-03 Thread Jacob Pan
/stage two page tables Signed-off-by: Jacob Pan Signed-off-by: Liu Yi L --- drivers/iommu/iommu.c | 20 include/linux/iommu.h | 10 ++ include/uapi/linux/iommu.h | 15 ++- 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/drivers/iommu

[PATCH v3 12/16] iommu/vt-d: Add nested translation helper function

2019-05-03 Thread Jacob Pan
physical translation and SL performs guest physical to host physical translation. Signed-off-by: Jacob Pan Signed-off-by: Liu, Yi L --- drivers/iommu/intel-pasid.c | 93 + drivers/iommu/intel-pasid.h | 11 ++ 2 files changed, 104 insertions

[PATCH v3 14/16] iommu/vt-d: Add bind guest PASID support

2019-05-03 Thread Jacob Pan
| | | '--' '-' Where: - FL = First level/stage one page tables - SL = Second level/stage two page tables Signed-off-by: Jacob Pan Signed-off-by: Liu, Yi L --- drivers/iommu/intel-iommu.c | 4 + drivers/iommu/intel-svm.c | 175

[PATCH v3 11/16] iommu/vt-d: Avoid duplicated code for PASID setup

2019-05-03 Thread Jacob Pan
After each setup for PASID entry, related translation caches must be flushed. We can combine duplicated code into one function which is less error prone. Signed-off-by: Jacob Pan --- drivers/iommu/intel-pasid.c | 48 + 1 file changed, 18 insertions

[PATCH v3 13/16] iommu/vt-d: Clean up for SVM device list

2019-05-03 Thread Jacob Pan
Use combined macro for_each_svm_dev() to simplify SVM device iteration. Suggested-by: Andy Shevchenko Signed-off-by: Jacob Pan Reviewed-by: Eric Auger --- drivers/iommu/intel-svm.c | 79 +++ 1 file changed, 39 insertions(+), 40 deletions(-) diff

[PATCH v3 10/16] iommu/vt-d: Move domain helper to header

2019-05-03 Thread Jacob Pan
Move domainer helper to header to be used by SVA code. Signed-off-by: Jacob Pan --- drivers/iommu/intel-iommu.c | 6 -- include/linux/intel-iommu.h | 6 ++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index

[PATCH v3 06/16] iommu/vt-d: Add custom allocator for IOASID

2019-05-03 Thread Jacob Pan
that PASID namespace is system- wide. Signed-off-by: Lu Baolu Signed-off-by: Liu, Yi L Signed-off-by: Jacob Pan --- drivers/iommu/Kconfig | 1 + drivers/iommu/intel-iommu.c | 60 + include/linux/intel-iommu.h | 2 ++ 3 files changed, 63 insertions

[PATCH v3 02/16] iommu: Introduce cache_invalidate API

2019-05-03 Thread Jacob Pan
y: Liu, Yi L Signed-off-by: Jean-Philippe Brucker Signed-off-by: Jacob Pan Signed-off-by: Ashok Raj Signed-off-by: Eric Auger --- v6 -> v7: - detail which fields are used for each invalidation type - add a comment about multiple cache invalidation v5 -> v6: - fix merge issue v3 ->

[PATCH v3 07/16] iommu/vtd: Optimize tlb invalidation for vIOMMU

2019-05-03 Thread Jacob Pan
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/drivers/iommu/intel-svm.c index 8f87304..f5d1e1e 100644 --- a/drivers/iommu/intel-svm.c +++ b/drivers/iommu/intel-svm.c @@ -211,7 +211,9

[PATCH v3 01/16] iommu: Introduce attach/detach_pasid_table API

2019-05-03 Thread Jacob Pan
. A generic iommu_pasid_table_config struct is introduced in a new iommu.h uapi header. This is going to be used by the VFIO user API. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Liu, Yi L Signed-off-by: Ashok Raj Signed-off-by: Jacob Pan Signed-off-by: Eric Auger Reviewed-by: Jean

[PATCH v3 08/16] iommu/vt-d: Replace Intel specific PASID allocator with IOASID

2019-05-03 Thread Jacob Pan
Make use of generic IOASID code to manage PASID allocation, free, and lookup. Replace Intel specific code. Signed-off-by: Jacob Pan --- drivers/iommu/intel-iommu.c | 11 +-- drivers/iommu/intel-pasid.c | 36 drivers/iommu/intel-svm.c | 37

[PATCH v3 04/16] ioasid: Add custom IOASID allocator

2019-05-03 Thread Jacob Pan
by the default XA allocator. Signed-off-by: Jacob Pan --- drivers/iommu/ioasid.c | 125 + 1 file changed, 125 insertions(+) diff --git a/drivers/iommu/ioasid.c b/drivers/iommu/ioasid.c index 99f5e0a..ed2915a 100644 --- a/drivers/iommu/ioasid.c +++ b/drivers

[PATCH v3 03/16] iommu: Add I/O ASID allocator

2019-05-03 Thread Jacob Pan
, using the same ID space as IOMMU. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Jacob Pan Link: https://lkml.org/lkml/2019/4/26/462 --- drivers/iommu/Kconfig | 6 +++ drivers/iommu/Makefile | 1 + drivers/iommu/ioasid.c | 140 + include

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