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

2018-05-13 Thread Lu Baolu
> +out_unlock: > + spin_unlock(>lock); > + spin_unlock_irqrestore(_domain_lock, flags); > + > + return ret; > +} > + > static int intel_iommu_map(struct iommu_domain *domain, > unsigned long iova, phys_addr_t hpa, > size_t size, int iommu_prot) > @@ -5401,6 +5529,7 @@ const struct iommu_ops intel_iommu_ops = { > #ifdef CONFIG_INTEL_IOMMU_SVM > .bind_pasid_table = intel_iommu_bind_pasid_table, > .unbind_pasid_table = intel_iommu_unbind_pasid_table, > + .sva_invalidate = intel_iommu_sva_invalidate, > #endif > .map= intel_iommu_map, > .unmap = intel_iommu_unmap, Best regards, Lu Baolu

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

2018-05-14 Thread Lu Baolu
page_req_group_id == evt->page_req_group_id) { > + msg->private_data = evt->iommu_private; > + ret = domain->ops->page_response(dev, msg); > + list_del(>list); > + kfree(evt); > +

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

2018-05-14 Thread Lu Baolu
r_t handler, > + void *data); > + > +extern int iommu_unregister_device_fault_handler(struct device *dev); > + > +extern int iommu_report_device_fault(struct device *dev, struct > iommu_fault_event *evt); > + > extern int iommu_group_id(struct iommu_group *group); > extern struct iommu_group *iommu_group_get_for_dev(struct device *dev); > extern struct iommu_domain *iommu_group_default_domain(struct iommu_group *); > @@ -727,6 +741,23 @@ static inline int iommu_group_unregister_notifier(struct > iommu_group *group, > return 0; > } > > +static inline int iommu_register_device_fault_handler(struct device *dev, > + iommu_dev_fault_handler_t > handler, > + void *data) > +{ > + return -ENODEV; > +} > + > +static inline int iommu_unregister_device_fault_handler(struct device *dev) > +{ > + return 0; > +} > + > +static inline int iommu_report_device_fault(struct device *dev, struct > iommu_fault_event *evt) > +{ > + return -ENODEV; > +} > + > static inline int iommu_group_id(struct iommu_group *group) > { > return -ENODEV; Best regards, Lu Baolu

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

2018-05-13 Thread Lu Baolu
is to create a parent pointer under device struct and move previous iommu_group and iommu_fwspec together with the iommu fault related data into it. Best regards, Lu Baolu > > Suggested-by: Greg Kroah-Hartman <gre...@linuxfoundation.org> > Reviewed-by: Greg Kroah-Hartman <gre...@linu

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

2018-05-14 Thread Lu Baolu
1, F2, F3 timeout won't be handled until the timer expires again at 20s. That means a fault might be pending there until about (2 * prq_timeout) seconds later. Out of curiosity, Why not adding a timer in iommu_fault_event, starting it in iommu_report_device_fault() and removing it in iommu_page_response()? Best regards, Lu B

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

2018-05-14 Thread Lu Baolu
ble_iommu; > } > #endif > - ret = dmar_set_interrupt(iommu); > + ret = dmar_set_interrupt(iommu, true); > if (ret) > goto disable_iommu; > > diff --git a/include/linux/dmar.h b/include/linux/dmar.h > index e2433bc..21f2162 100644 > --- a/include/linux/dmar.h > +++ b/include/linux/dmar.h > @@ -278,7 +278,7 @@ extern void dmar_msi_unmask(struct irq_data *data); > extern void dmar_msi_mask(struct irq_data *data); > extern void dmar_msi_read(int irq, struct msi_msg *msg); > extern void dmar_msi_write(int irq, struct msi_msg *msg); > -extern int dmar_set_interrupt(struct intel_iommu *iommu); > +extern int dmar_set_interrupt(struct intel_iommu *iommu, bool queue_fault); > extern irqreturn_t dmar_fault(int irq, void *dev_id); > extern int dmar_alloc_hwirq(int id, int node, void *arg); > extern void dmar_free_hwirq(int irq); > diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h > index 5ac0c28..b3a26c7 100644 > --- a/include/linux/intel-iommu.h > +++ b/include/linux/intel-iommu.h > @@ -472,6 +472,7 @@ struct intel_iommu { > struct iommu_device iommu; /* IOMMU core code handle */ > int node; > u32 flags; /* Software defined flags */ > + struct workqueue_struct *fault_wq; /* Reporting IOMMU fault to device */ > }; > > /* PCI domain-device relationship */ Best regards, Lu Baolu

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

2018-05-15 Thread Lu Baolu
Hi, On 05/15/2018 04:55 AM, Jacob Pan wrote: > On Mon, 14 May 2018 14:01:06 +0800 > Lu Baolu <baolu...@linux.intel.com> wrote: > >> Hi, >> >> On 05/12/2018 04:54 AM, Jacob Pan wrote: >>> Traditionally, device specific faults are detected and handled >&

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

2018-05-13 Thread Lu Baolu
iommu_ops = { > .domain_free= intel_iommu_domain_free, > .attach_dev = intel_iommu_attach_device, > .detach_dev = intel_iommu_detach_device, > +#ifdef CONFIG_INTEL_IOMMU_SVM > + .bind_pasid_table = intel_iommu_bind_pasid_table, > + .unbind_pasid_table = intel_iommu_unbind_pasid_table, > +#endif > .map= intel_iommu_map, > .unmap = intel_iommu_unmap, > .map_sg = default_iommu_map_sg, > diff --git a/include/linux/dma_remapping.h b/include/linux/dma_remapping.h > index 21b3e7d..db290b2 100644 > --- a/include/linux/dma_remapping.h > +++ b/include/linux/dma_remapping.h > @@ -28,6 +28,7 @@ > > #define CONTEXT_DINVE(1ULL << 8) > #define CONTEXT_PRS (1ULL << 9) > +#define CONTEXT_NESTE(1ULL << 10) > #define CONTEXT_PASIDE (1ULL << 11) > > struct intel_iommu; Best regards, Lu Baolu

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

2018-05-13 Thread Lu Baolu
nabled:1; > u8 ats_supported:1; > u8 ats_enabled:1; > + u8 pasid_table_bound:1; Can you please add some comments here? So that, people can understand the purpose for this bit exactly. Best regards, Lu Baolu > u8 ats_qdep; > u64 fault_mask; /* selected IOMMU fa

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

2018-05-13 Thread Lu Baolu
Hi, On 05/12/2018 04:53 AM, Jacob Pan wrote: > Adding a flag in device domain into to track whether a guest or typo: ^^info Best regards, Lu Baolu > user PASID table is bound to a device. > > Signed-off-by: Jacob Pan <jacob.jun@

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

2018-05-13 Thread Lu Baolu
struct list_head global; /* link to global list */ > u8 bus; /* PCI bus number */ > u8 devfn; /* PCI devfn number */ > + u16 pfsid; /* SRIOV physical function source ID */ > u8 pasid_supported:3; > u8 pasid_enabled:1; > u8 pri_supported:1; Best regards, Lu Baolu

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

2018-05-13 Thread Lu Baolu
unsigned int size_order, u64 type); > -extern void qi_flush_dev_iotlb(struct intel_iommu *iommu, u16 sid, u16 qdep, > - u64 addr, unsigned mask); > - > +extern void qi_flush_dev_iotlb(struct intel_iommu *iommu, u16 sid, u16 pfsid, > + u16 qdep, u64 addr, unsigned mask); Alignment should match open parenthesis. > extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu); > > extern int dmar_ir_support(void); Best regards, Lu Baolu

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

2018-05-13 Thread Lu Baolu
struct intel_iommu *iommu, u16 sid, u16 pfsid, > u16 qdep, u64 addr, unsigned mask); > + > +extern void qi_flush_dev_eiotlb(struct intel_iommu *iommu, u16 sid, > + u32 pasid, u16 qdep, u64 addr, unsigned size, u64 > granu); > +extern void qi_flush_pasid(struct intel_iommu *iommu, u16 did, u64 granu, > int pasid); > + > extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu); > > extern int dmar_ir_support(void); Best regards, Lu Baolu

Re: [PATCH v2 0/9] iommu/vt-d: Improve PASID id and table management

2018-05-16 Thread Lu Baolu
Hi Joerg, Thank you for looking at my patches. On 05/15/2018 10:11 PM, Joerg Roedel wrote: > On Fri, May 04, 2018 at 09:41:15AM +0800, Lu Baolu wrote: >> PATCH 4~9 implement per domain PASID table. Current per IOMMU >> PASID table implementation is insecure in the cases where >

Re: [PATCH v2 0/9] iommu/vt-d: Improve PASID id and table management

2018-05-16 Thread Lu Baolu
Hi, On 05/16/2018 04:56 PM, Tian, Kevin wrote: >> From: Lu Baolu [mailto:baolu...@linux.intel.com] >> Sent: Wednesday, May 16, 2018 4:01 PM >> >> Hi Joerg, >> >> Thank you for looking at my patches. >> >> On 05/15/2018 10:11 PM, Joerg Roedel wrote:

Re: [PATCHv4 2/2] iommu/vt-d: Limit number of faults to clear in irq handler

2018-05-02 Thread Lu Baolu
gisters full of faults, hence new faults will be dropped without logging? And even worse, new faults will not generate interrupts? Best regards, Lu Baolu > > Cc: Alex Williamson <alex.william...@redhat.com> > Cc: David Woodhouse <dw...@infradead.org> > Cc: Ingo Molnar <

Re: [PATCH 8/9] iommu/vt-d: Use per-domain pasid table

2018-05-01 Thread Lu Baolu
Hi, On 05/01/2018 05:23 PM, Liu, Yi L wrote: >> From: Lu Baolu [mailto:baolu...@linux.intel.com] >> Sent: Tuesday, April 17, 2018 11:03 AM >> >> This patch replaces current per iommu pasid table with >> the new added per domain pasid table. Each svm-capable >>

Re: [PATCH 5/9] iommu/vt-d: Per domain pasid table interfaces

2018-05-01 Thread Lu Baolu
Hi Yi, Thank you very much for reviewing my patches. On 05/01/2018 05:22 PM, Liu, Yi L wrote: >> From: Lu Baolu [mailto:baolu...@linux.intel.com] >> Sent: Tuesday, April 17, 2018 11:03 AM >> >> This patch adds the interfaces for per domain pasid table >> managem

Re: [PATCH 6/9] iommu/vt-d: Allocate and free pasid table

2018-05-01 Thread Lu Baolu
Hi, On 05/01/2018 05:22 PM, Liu, Yi L wrote: >> From: Lu Baolu [mailto:baolu...@linux.intel.com] >> Sent: Tuesday, April 17, 2018 11:03 AM >> >> This patch allocates PASID table for a domain at the time when >> it is being created (if any devices using this do

Re: [PATCH 9/9] iommu/vt-d: Clean up PASID talbe management for SVM

2018-05-01 Thread Lu Baolu
Hi, On 05/01/2018 05:24 PM, Liu, Yi L wrote: >> From: Lu Baolu [mailto:baolu...@linux.intel.com] >> Sent: Tuesday, April 17, 2018 11:03 AM >> >> The previous per iommu pasid table alloc/free interfaces >> are no longer used. Clean up the driver by removing it. >

Re: [PATCHv4 2/2] iommu/vt-d: Limit number of faults to clear in irq handler

2018-05-02 Thread Lu Baolu
Hi, On 05/02/2018 08:38 PM, Dmitry Safonov wrote: > Hi Lu, > > On Wed, 2018-05-02 at 14:34 +0800, Lu Baolu wrote: >> Hi, >> >> On 03/31/2018 08:33 AM, Dmitry Safonov wrote: >>> Theoretically, on some machines faults might be generated faster >>> than

Re: [RESEND][PATCH] iommu/vt-d: fix shift-out-of-bounds in bug checking

2018-05-02 Thread Lu Baolu
> > [3.932382] cpuidle_enter_state+0xb4/0x470 > [3.936558] do_idle+0x222/0x310 > [3.939779] cpu_startup_entry+0x78/0x90 > [3.943693] start_secondary+0x205/0x2e0 > [3.947607] secondary_startup_64+0xa5/0xb0 > [3.951783] >

Re: [PATCHv4 2/2] iommu/vt-d: Limit number of faults to clear in irq handler

2018-05-02 Thread Lu Baolu
Hi, On 05/03/2018 08:52 AM, Dmitry Safonov wrote: > On Thu, 2018-05-03 at 07:49 +0800, Lu Baolu wrote: >> Hi, >> >> On 05/02/2018 08:38 PM, Dmitry Safonov wrote: >>> Hi Lu, >>> >>> On Wed, 2018-05-02 at 14:34 +0800, Lu Baolu wrote: >>>>

Re: [PATCHv4 2/2] iommu/vt-d: Limit number of faults to clear in irq handler

2018-05-02 Thread Lu Baolu
Hi, On 05/03/2018 10:16 AM, Lu Baolu wrote: > Hi, > > On 05/03/2018 09:59 AM, Dmitry Safonov wrote: >> On Thu, 2018-05-03 at 09:32 +0800, Lu Baolu wrote: >>> Hi, >>> >>> On 05/03/2018 08:52 AM, Dmitry Safonov wrote: >>>> AFAICS, w

Re: [PATCHv4 2/2] iommu/vt-d: Limit number of faults to clear in irq handler

2018-05-02 Thread Lu Baolu
Hi, On 05/03/2018 10:34 AM, Dmitry Safonov wrote: > On Thu, 2018-05-03 at 10:16 +0800, Lu Baolu wrote: >> Hi, >> >> On 05/03/2018 09:59 AM, Dmitry Safonov wrote: >>> On Thu, 2018-05-03 at 09:32 +0800, Lu Baolu wrote: >>>> Hi, >>>> >>&

Re: [PATCHv4 2/2] iommu/vt-d: Limit number of faults to clear in irq handler

2018-05-02 Thread Lu Baolu
Hi, On 05/03/2018 09:59 AM, Dmitry Safonov wrote: > On Thu, 2018-05-03 at 09:32 +0800, Lu Baolu wrote: >> Hi, >> >> On 05/03/2018 08:52 AM, Dmitry Safonov wrote: >>> AFAICS, we're doing fault-clearing in a loop inside irq handler. >>> That means that while

[PATCH v2 4/9] iommu/vt-d: Move device_domain_info to header

2018-05-03 Thread Lu Baolu
This allows the per device iommu data to be accessed from other files. Cc: Ashok Raj <ashok@intel.com> Cc: Jacob Pan <jacob.jun@linux.intel.com> Cc: Kevin Tian <kevin.t...@intel.com> Cc: Liu Yi L <yi.l@intel.com> Signed-off-by: Lu Baolu <baolu...@linux.intel

[PATCH v2 0/9] iommu/vt-d: Improve PASID id and table management

2018-05-03 Thread Lu Baolu
achieve finer protection and isolation granularity. Best regards, Lu Baolu Change log: v1->v2: - Patches have been reviewed by "Liu Yi L <yi.l@intel.com>". - An error case handling was added in PATCH 6/9. - Some commit messages are refined to be more accurate. Lu Baol

[PATCH v2 3/9] iommu/vt-d: Use global PASID for SVM usage

2018-05-03 Thread Lu Baolu
This patch switches PASID management for SVM from per iommu idr to the global idr. Cc: Ashok Raj <ashok@intel.com> Cc: Jacob Pan <jacob.jun@linux.intel.com> Cc: Kevin Tian <kevin.t...@intel.com> Cc: Liu Yi L <yi.l@intel.com> Signed-off-by: Lu Baolu <baolu..

[PATCH v2 9/9] iommu/vt-d: Clean up PASID talbe management for SVM

2018-05-03 Thread Lu Baolu
The previous per iommu pasid table alloc/free interfaces are no longer used. Clean up the driver by removing it. Cc: Ashok Raj <ashok@intel.com> Cc: Jacob Pan <jacob.jun@linux.intel.com> Cc: Kevin Tian <kevin.t...@intel.com> Cc: Liu Yi L <yi.l@intel.com> Signed

[PATCH v2 6/9] iommu/vt-d: Allocate and free pasid table

2018-05-03 Thread Lu Baolu
ian <kevin.t...@intel.com> Cc: Liu Yi L <yi.l@intel.com> Signed-off-by: Lu Baolu <baolu...@linux.intel.com> Reviewed-by: Liu Yi L <yi.l@intel.com> --- drivers/iommu/intel-iommu.c | 19 +++ drivers/iommu/intel-svm.c | 8 include/linux/intel-iommu.h

[PATCH v2 8/9] iommu/vt-d: Use per-domain pasid table

2018-05-03 Thread Lu Baolu
jacob.jun@linux.intel.com> Cc: Kevin Tian <kevin.t...@intel.com> Cc: Liu Yi L <yi.l@intel.com> Signed-off-by: Lu Baolu <baolu...@linux.intel.com> Reviewed-by: Liu Yi L <yi.l@intel.com> --- drivers/iommu/intel-iommu.c | 6 +++--- drivers/iommu/intel-svm.c | 37

[PATCH v2 5/9] iommu/vt-d: Per domain pasid table interfaces

2018-05-03 Thread Lu Baolu
finer protection and isolation granularity. Cc: Ashok Raj <ashok@intel.com> Cc: Jacob Pan <jacob.jun@linux.intel.com> Cc: Kevin Tian <kevin.t...@intel.com> Cc: Liu Yi L <yi.l@intel.com> Suggested-by: Ashok Raj <ashok@intel.com> Signed-off-by: Lu B

[PATCH v2 7/9] iommu/vt-d: Calculate PTS value

2018-05-03 Thread Lu Baolu
Calculate PTS (PASID Table Size) value for the extended context entry from the real size of the PASID table for a domain. Cc: Ashok Raj <ashok@intel.com> Cc: Jacob Pan <jacob.jun@linux.intel.com> Cc: Kevin Tian <kevin.t...@intel.com> Cc: Liu Yi L <yi.l@intel.c

[PATCH v2 2/9] iommu/vt-d: Decouple idr bond pointer from svm

2018-05-03 Thread Lu Baolu
code. It's required to replace the SVM-specific idr with the global PASID idr. Cc: Ashok Raj <ashok@intel.com> Cc: Jacob Pan <jacob.jun@linux.intel.com> Cc: Kevin Tian <kevin.t...@intel.com> Cc: Liu Yi L <yi.l@intel.com> Signed-off-by: Lu Baolu <baolu..

[PATCH v2 1/9] iommu/vt-d: Global PASID name space

2018-05-03 Thread Lu Baolu
reside behind two different IOMMU units. Cc: Ashok Raj <ashok@intel.com> Cc: Jacob Pan <jacob.jun@linux.intel.com> Cc: Kevin Tian <kevin.t...@intel.com> Cc: Liu Yi L <yi.l@intel.com> Suggested-by: Ashok Raj <ashok@intel.com> Signed-off-by: Lu B

[PATCH 4/4] iommu/vt-d: Remove unnecessary parentheses

2018-05-03 Thread Lu Baolu
Remove unnecessary parentheses to comply with preferred coding style. Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/iommu/intel-svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/intel-svm.c b/drivers/iommu/intel-svm.c index e8cd984..4

[PATCH 2/4] iommu/vt-d: Clean up unused variable in find_or_alloc_domain

2018-05-03 Thread Lu Baolu
Remove it to make the code more concise. Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/iommu/intel-iommu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 749d8f2..9064607 100644 --- a/d

[PATCH 1/4] iommu: Clean up the comments for iommu_group_alloc

2018-05-03 Thread Lu Baolu
@name parameter has been removed. Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/iommu/iommu.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index d2aa2320..d87e7c2 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/i

[PATCH 3/4] iommu/vt-d: Clean up pasid quirk for pre-production devices

2018-05-03 Thread Lu Baolu
The pasid28 quirk is needed only for some pre-production devices. Remove it to make the code concise. Signed-off-by: Ashok Raj <ashok@intel.com> Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/iommu/intel-iommu.c | 32 ++-- include

[PATCH 0/4] iommu/vt-d: Several cleanup patches

2018-05-03 Thread Lu Baolu
Hi, This includes several cleanup patches which aim to make the code more concise and easier for reading. There aren't any functionality changes. Best regards, Lu Baolu Lu Baolu (4): iommu: Clean up the comments for iommu_group_alloc iommu/vt-d: Clean up unused variable

Re: [PATCH v3 0/2] iommu/vt-d: Fix mapping PSI missing for iommu_map()

2018-05-04 Thread Lu Baolu
n mapping > will trigger the MAP PSI notifications. > > Without the patchset, nested device assignment (assign one device > firstly to L1 guest, then to L2 guest) won't work for QEMU. After > applying the patchset, it works. > > Please review. Thanks. Both patches l

Re: [PATCH 1/3] iommu/vt-d: Missing checks for pasid tables if allocation fails

2017-10-19 Thread Lu Baolu
Hi Yi, On 10/19/2017 02:40 PM, Liu, Yi L wrote: > >> -Original Message- >> From: iommu-boun...@lists.linux-foundation.org [mailto:iommu- >> boun...@lists.linux-foundation.org] On Behalf Of Lu Baolu >> Sent: Thursday, October 19, 2017 8:39 AM >> To: j..

[PATCH 1/1] usb: xhci: dbc: Add SPDX identifiers to dbc files

2017-12-21 Thread Lu Baolu
Update the xhci dbc files with the correct SPDX license identifiers. Fixes: dfba2174dc42 ("usb: xhci: Add DbC support in xHCI driver") Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/xhci-dbgcap.c | 1 + drivers/usb/host/xhci-dbgcap.h | 2 +- drive

Re: [PATCH 1/1] usb: xhci: dbc: Add SPDX identifiers to dbc files

2017-12-22 Thread Lu Baolu
Hi, On 12/22/2017 04:32 PM, Philippe Ombredanne wrote: > Lu, > > On Fri, Dec 22, 2017 at 2:34 AM, Lu Baolu <baolu...@linux.intel.com> wrote: >> Update the xhci dbc files with the correct SPDX license identifiers. >> >> Fixes: dfba2174dc42 ("usb: xhci: Add

[PATCH v2 1/1] usb: xhci: dbc: Add SPDX identifiers to dbc files

2017-12-22 Thread Lu Baolu
Update the xhci dbc files with the correct SPDX license identifiers. Fixes: dfba2174dc42 ("usb: xhci: Add DbC support in xHCI driver") Cc: Philippe Ombredanne <pombreda...@nexb.com> Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- changes from v1: * Use plain C st

[PATCH 1/2] usb: xhci: Remove ep_trb from xhci_cleanup_halted_endpoint()

2018-01-09 Thread Lu Baolu
Function argument ep_trb for xhci_cleanup_halted_endpoint() isn't needed anymore. Cleanup it. Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/xhci-ring.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/d

[PATCH 2/2] usb: xhci: Remove ep_trb from finish_td()

2018-01-09 Thread Lu Baolu
Function argument ep_trb for finish_td() isn't needed anymore. Cleanup it. Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/xhci-ring.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-

[PATCH 1/1] iommu/vt-d: Fix a potential memory leak

2018-02-23 Thread Lu Baolu
A memory block was allocated in intel_svm_bind_mm() but never freed in a failure path. This patch fixes this by free it to avoid memory leakage. Cc: Ashok Raj <ashok@intel.com> Cc: Jacob Pan <jacob.jun@linux.intel.com> Cc: <sta...@vger.kernel.org> # v4.4+ Signed-off-b

[PATCH 1/1] iommu/vt-d: Use real PASID for flush in caching mode

2018-03-15 Thread Lu Baolu
is not reserved for this case. Cc: Jacob Pan <jacob.jun@linux.intel.com> Cc: Kevin Tian <kevin.t...@intel.com> Cc: Sankaran Rajesh <rajesh.sanka...@intel.com> Suggested-by: Ashok Raj <ashok@intel.com> Signed-off-by: Liu Yi L <yi.l@intel.com> Signed-off-by: Lu B

[PATCH 3/3] iommu/vt-d: Use global PASID for SVM usage

2018-03-14 Thread Lu Baolu
This patch switches PASID management for SVM from SVM specific idr to the global idr. Cc: Ashok Raj <ashok@intel.com> Cc: Jacob Pan <jacob.jun@linux.intel.com> Cc: Kevin Tian <kevin.t...@intel.com> Cc: Liu Yi L <yi.l@intel.com> Signed-off-by: Lu Baolu &

[PATCH 2/3] iommu/vt-d: Decouple idr bond pointer from svm

2018-03-14 Thread Lu Baolu
code. It's required to replace the SVM-specific idr with the global PASID idr. Cc: Ashok Raj <ashok@intel.com> Cc: Jacob Pan <jacob.jun@linux.intel.com> Cc: Kevin Tian <kevin.t...@intel.com> Cc: Liu Yi L <yi.l@intel.com> Signed-off-by: Lu Baolu <baolu..

[PATCH 1/3] iommu/vt-d: Global PASID name space

2018-03-14 Thread Lu Baolu
simultaneously where two devices could reside behind two different IOMMU units. Cc: Ashok Raj <ashok@intel.com> Cc: Jacob Pan <jacob.jun@linux.intel.com> Cc: Kevin Tian <kevin.t...@intel.com> Cc: Liu Yi L <yi.l@intel.com> Suggested-by: Ashok Raj <ashok@intel.c

[PATCH 0/3] iommu/vt-d: Global PASID name space

2018-03-14 Thread Lu Baolu
physical devices simultaneously where two devices could reside behind two different IOMMU units. Best regards, Lu Baolu Lu Baolu (3): iommu/vt-d: Global PASID name space iommu/vt-d: Decouple idr bond pointer from svm iommu/vt-d: Use global PASID for SVM usage drivers/iommu/intel-iommu.c

[PATCH 9/9] iommu/vt-d: Clean up PASID talbe management for SVM

2018-04-16 Thread Lu Baolu
The previous per iommu pasid table alloc/free interfaces are no longer used. Clean up the driver by removing it. Cc: Ashok Raj <ashok@intel.com> Cc: Jacob Pan <jacob.jun@linux.intel.com> Cc: Kevin Tian <kevin.t...@intel.com> Cc: Liu Yi L <yi.l@intel.com> Signed

[PATCH 3/9] iommu/vt-d: Use global PASID for SVM usage

2018-04-16 Thread Lu Baolu
This patch switches PASID management for SVM from per iommu idr to the global idr. Cc: Ashok Raj <ashok@intel.com> Cc: Jacob Pan <jacob.jun@linux.intel.com> Cc: Kevin Tian <kevin.t...@intel.com> Cc: Liu Yi L <yi.l@intel.com> Signed-off-by: Lu Baolu <baolu..

[PATCH 8/9] iommu/vt-d: Use per-domain pasid table

2018-04-16 Thread Lu Baolu
Cc: Liu Yi L <yi.l@intel.com> Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/iommu/intel-iommu.c | 6 +++--- drivers/iommu/intel-svm.c | 37 + 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/drivers/iommu/intel-iommu.c

[PATCH 1/9] iommu/vt-d: Global PASID name space

2018-04-16 Thread Lu Baolu
reside behind two different IOMMU units. Cc: Ashok Raj <ashok@intel.com> Cc: Jacob Pan <jacob.jun@linux.intel.com> Cc: Kevin Tian <kevin.t...@intel.com> Cc: Liu Yi L <yi.l@intel.com> Suggested-by: Ashok Raj <ashok@intel.com> Signed-off-by: Lu B

[PATCH 6/9] iommu/vt-d: Allocate and free pasid table

2018-04-16 Thread Lu Baolu
ian <kevin.t...@intel.com> Cc: Liu Yi L <yi.l@intel.com> Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/iommu/intel-iommu.c | 13 + drivers/iommu/intel-svm.c | 8 include/linux/intel-iommu.h | 10 -- 3 files changed, 21 insertions(+

[PATCH 2/9] iommu/vt-d: Decouple idr bond pointer from svm

2018-04-16 Thread Lu Baolu
code. It's required to replace the SVM-specific idr with the global PASID idr. Cc: Ashok Raj <ashok@intel.com> Cc: Jacob Pan <jacob.jun@linux.intel.com> Cc: Kevin Tian <kevin.t...@intel.com> Cc: Liu Yi L <yi.l@intel.com> Signed-off-by: Lu Baolu <baolu..

[PATCH 0/9] iommu/vt-d: Improve PASID id and table management

2018-04-16 Thread Lu Baolu
achieve finer protection and isolation granularity. Best regards, Lu Baolu Lu Baolu (9): iommu/vt-d: Global PASID name space iommu/vt-d: Decouple idr bond pointer from svm iommu/vt-d: Use global PASID for SVM usage iommu/vt-d: Move device_domain_info to header iommu/vt-d: Per domain pasid

[PATCH 4/9] iommu/vt-d: Move device_domain_info to header

2018-04-16 Thread Lu Baolu
This allows the per device iommu data to be accessed from other files. Cc: Ashok Raj <ashok@intel.com> Cc: Jacob Pan <jacob.jun@linux.intel.com> Cc: Kevin Tian <kevin.t...@intel.com> Cc: Liu Yi L <yi.l@intel.com> Signed-off-by: Lu Baolu <baolu...@linux.in

[PATCH 5/9] iommu/vt-d: Per domain pasid table interfaces

2018-04-16 Thread Lu Baolu
finer protection and isolation granularity. Cc: Ashok Raj <ashok@intel.com> Cc: Jacob Pan <jacob.jun@linux.intel.com> Cc: Kevin Tian <kevin.t...@intel.com> Cc: Liu Yi L <yi.l@intel.com> Suggested-by: Ashok Raj <ashok@intel.com> Signed-off-by: Lu B

[PATCH 7/9] iommu/vt-d: Calculate PTS value

2018-04-16 Thread Lu Baolu
Calculate PTS (PASID Table Size) value for the extended context entry from the real size of the PASID table for a domain. Cc: Ashok Raj <ashok@intel.com> Cc: Jacob Pan <jacob.jun@linux.intel.com> Cc: Kevin Tian <kevin.t...@intel.com> Cc: Liu Yi L <yi.l@intel.c

Re: [PATCH 0/3] iommu/vt-d: Global PASID name space

2018-03-29 Thread Lu Baolu
Hi, On 03/29/2018 04:52 PM, Joerg Roedel wrote: > On Mon, Mar 26, 2018 at 08:38:21AM +0800, Lu Baolu wrote: >> Hi Joerg, >> >> A gentle ping. :-) >> >> Any comments on this patch set? > Yes, it doesn't apply on-top of my x86/vt-d branch. Please rebase it &g

Re: [PATCH 0/3] iommu/vt-d: Global PASID name space

2018-03-25 Thread Lu Baolu
Hi Joerg, A gentle ping. :-) Any comments on this patch set? Best regards, Lu Baolu On 03/15/2018 10:38 AM, Lu Baolu wrote: > Hi, > > This patch series is trying to change the scope of PASID management > used in Intel IOMMU driver from per IOMMU to driver global. This is > re

[PATCH v4 4/8] iommu/vt-d: Attach/detach domains in auxiliary mode

2018-11-04 Thread Lu Baolu
/detach_device() ops to support managing PASID granular translation structures when the device driver has enabled multiple domains per device. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Signed-off-by: Sanjay Kumar Signed-off-by: Lu Baolu Signed-off-by: Liu Yi L --- drivers/iommu/intel-iommu.c | 192

[PATCH 1/1] xhci: clear root port wake on bits if controller isn't wake-up capable

2014-06-11 Thread Lu Baolu
When the xHCI PCI host is suspended, if do_wakeup is false in xhci_pci_suspend, xhci_bus_suspend needs to clear all root port wake on bits. Otherwise some Intel platform may get a spurious wakeup, even if PCI PME# is disabled. http://marc.info/?l=linux-usb=138194006009255=2 Signed-off-by: Lu

[PATCH v2 1/1] xhci: clear root port wake on bits if controller isn't wake-up capable

2014-06-12 Thread Lu Baolu
, that contains the commit 9777e3ce907d4cb5a513902a87ecd03b52499569 "USB: xHCI: bus power management implementation". Signed-off-by: Lu Baolu --- drivers/usb/host/xhci-hub.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-h

[asus-nb-wmi] thermal device detected by asus-nb-wmi platform driver

2014-03-20 Thread Lu, Baolu
Hi, I booted Ubuntu13.10 onto ASUS T100 Tablet and upgraded it with upstream kernel (3.14.0-rc7+). There is a thermal device under /sys/devices/platform/asus-nb-wmi. root@t100:~/linux# tree /sys/class/hwmon/ /sys/class/hwmon/ ├── hwmon0 -> ../../devices/platform/coretemp.0/hwmon/hwmon0 └──

[PATCH 0/3] iommu/vt-d: Global PASID name space

2018-03-14 Thread Lu Baolu
physical devices simultaneously where two devices could reside behind two different IOMMU units. Best regards, Lu Baolu Lu Baolu (3): iommu/vt-d: Global PASID name space iommu/vt-d: Decouple idr bond pointer from svm iommu/vt-d: Use global PASID for SVM usage drivers/iommu/intel-iommu.c

[PATCH 2/3] iommu/vt-d: Decouple idr bond pointer from svm

2018-03-14 Thread Lu Baolu
code. It's required to replace the SVM-specific idr with the global PASID idr. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Cc: Liu Yi L Signed-off-by: Lu Baolu Reviewed-by: Kevin Tian --- drivers/iommu/intel-svm.c | 14 ++ include/linux/intel-iommu.h | 1 + 2 files changed, 11

[PATCH 3/3] iommu/vt-d: Use global PASID for SVM usage

2018-03-14 Thread Lu Baolu
This patch switches PASID management for SVM from SVM specific idr to the global idr. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Cc: Liu Yi L Signed-off-by: Lu Baolu Reviewed-by: Kevin Tian --- drivers/iommu/intel-svm.c | 20 +--- include/linux/intel-iommu.h | 1 - 2

[PATCH 1/3] iommu/vt-d: Global PASID name space

2018-03-14 Thread Lu Baolu
simultaneously where two devices could reside behind two different IOMMU units. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Cc: Liu Yi L Suggested-by: Ashok Raj Signed-off-by: Lu Baolu Reviewed-by: Kevin Tian --- drivers/iommu/intel-iommu.c | 64 + include

Re: [PATCH 0/3] iommu/vt-d: Global PASID name space

2018-03-25 Thread Lu Baolu
Hi Joerg, A gentle ping. :-) Any comments on this patch set? Best regards, Lu Baolu On 03/15/2018 10:38 AM, Lu Baolu wrote: > Hi, > > This patch series is trying to change the scope of PASID management > used in Intel IOMMU driver from per IOMMU to driver global. This is > re

Re: [PATCH 0/3] iommu/vt-d: Global PASID name space

2018-03-29 Thread Lu Baolu
Hi, On 03/29/2018 04:52 PM, Joerg Roedel wrote: > On Mon, Mar 26, 2018 at 08:38:21AM +0800, Lu Baolu wrote: >> Hi Joerg, >> >> A gentle ping. :-) >> >> Any comments on this patch set? > Yes, it doesn't apply on-top of my x86/vt-d branch. Please rebase it &g

[PATCH 1/1] iommu/vt-d: Use real PASID for flush in caching mode

2018-03-15 Thread Lu Baolu
is not reserved for this case. Cc: Jacob Pan Cc: Kevin Tian Cc: Sankaran Rajesh Suggested-by: Ashok Raj Signed-off-by: Liu Yi L Signed-off-by: Lu Baolu --- drivers/iommu/intel-svm.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/iommu/intel-svm.c b

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

2018-05-14 Thread Lu Baolu
ght be pending there until about (2 * prq_timeout) seconds later. Out of curiosity, Why not adding a timer in iommu_fault_event, starting it in iommu_report_device_fault() and removing it in iommu_page_response()? Best regards, Lu Baolu > /** > * iommu_register_device_fault_handler()

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

2018-05-14 Thread Lu Baolu
interrupt(iommu, true); > if (ret) > goto disable_iommu; > > diff --git a/include/linux/dmar.h b/include/linux/dmar.h > index e2433bc..21f2162 100644 > --- a/include/linux/dmar.h > +++ b/include/linux/dmar.h > @@ -278,7 +278,7 @@ extern void dmar_msi_unmask(struct irq_data *data); > extern void dmar_msi_mask(struct irq_data *data); > extern void dmar_msi_read(int irq, struct msi_msg *msg); > extern void dmar_msi_write(int irq, struct msi_msg *msg); > -extern int dmar_set_interrupt(struct intel_iommu *iommu); > +extern int dmar_set_interrupt(struct intel_iommu *iommu, bool queue_fault); > extern irqreturn_t dmar_fault(int irq, void *dev_id); > extern int dmar_alloc_hwirq(int id, int node, void *arg); > extern void dmar_free_hwirq(int irq); > diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h > index 5ac0c28..b3a26c7 100644 > --- a/include/linux/intel-iommu.h > +++ b/include/linux/intel-iommu.h > @@ -472,6 +472,7 @@ struct intel_iommu { > struct iommu_device iommu; /* IOMMU core code handle */ > int node; > u32 flags; /* Software defined flags */ > + struct workqueue_struct *fault_wq; /* Reporting IOMMU fault to device */ > }; > > /* PCI domain-device relationship */ Best regards, Lu Baolu

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

2018-05-15 Thread Lu Baolu
Hi, On 05/15/2018 04:55 AM, Jacob Pan wrote: > On Mon, 14 May 2018 14:01:06 +0800 > Lu Baolu wrote: > >> Hi, >> >> On 05/12/2018 04:54 AM, Jacob Pan wrote: >>> Traditionally, device specific faults are detected and handled >>> within their own

Re: [PATCH v2 0/9] iommu/vt-d: Improve PASID id and table management

2018-05-16 Thread Lu Baolu
Hi Joerg, Thank you for looking at my patches. On 05/15/2018 10:11 PM, Joerg Roedel wrote: > On Fri, May 04, 2018 at 09:41:15AM +0800, Lu Baolu wrote: >> PATCH 4~9 implement per domain PASID table. Current per IOMMU >> PASID table implementation is insecure in the cases where >

[PATCH 1/4] iommu: Clean up the comments for iommu_group_alloc

2018-05-03 Thread Lu Baolu
@name parameter has been removed. Signed-off-by: Lu Baolu --- drivers/iommu/iommu.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index d2aa2320..d87e7c2 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -322,7 +322,6 @@ static

[PATCH 3/4] iommu/vt-d: Clean up pasid quirk for pre-production devices

2018-05-03 Thread Lu Baolu
The pasid28 quirk is needed only for some pre-production devices. Remove it to make the code concise. Signed-off-by: Ashok Raj Signed-off-by: Lu Baolu --- drivers/iommu/intel-iommu.c | 32 ++-- include/linux/intel-iommu.h | 1 - 2 files changed, 2 insertions(+), 31

[PATCH 4/4] iommu/vt-d: Remove unnecessary parentheses

2018-05-03 Thread Lu Baolu
Remove unnecessary parentheses to comply with preferred coding style. Signed-off-by: Lu Baolu --- drivers/iommu/intel-svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/intel-svm.c b/drivers/iommu/intel-svm.c index e8cd984..45f6e58 100644 --- a/drivers/iommu

[PATCH 2/4] iommu/vt-d: Clean up unused variable in find_or_alloc_domain

2018-05-03 Thread Lu Baolu
Remove it to make the code more concise. Signed-off-by: Lu Baolu --- drivers/iommu/intel-iommu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 749d8f2..9064607 100644 --- a/drivers/iommu/intel-iommu.c +++ b

[PATCH 0/4] iommu/vt-d: Several cleanup patches

2018-05-03 Thread Lu Baolu
Hi, This includes several cleanup patches which aim to make the code more concise and easier for reading. There aren't any functionality changes. Best regards, Lu Baolu Lu Baolu (4): iommu: Clean up the comments for iommu_group_alloc iommu/vt-d: Clean up unused variable

Re: [PATCH v3 0/2] iommu/vt-d: Fix mapping PSI missing for iommu_map()

2018-05-04 Thread Lu Baolu
n mapping > will trigger the MAP PSI notifications. > > Without the patchset, nested device assignment (assign one device > firstly to L1 guest, then to L2 guest) won't work for QEMU. After > applying the patchset, it works. > > Please review. Thanks. Both patches l

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

2018-05-13 Thread Lu Baolu
Hi, On 05/12/2018 04:53 AM, Jacob Pan wrote: > Adding a flag in device domain into to track whether a guest or typo: ^^info Best regards, Lu Baolu > user PASID table is bound to a device. > > Signed-off-by: Jacob Pan > --- > include/l

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

2018-05-13 Thread Lu Baolu
orted:1; > u8 ats_enabled:1; > + u8 pasid_table_bound:1; Can you please add some comments here? So that, people can understand the purpose for this bit exactly. Best regards, Lu Baolu > u8 ats_qdep; > u64 fault_mask; /* selected IOMMU faults to be reported */ > struct device *dev; /* it's NULL for PCIe-to-PCI bridge */

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

2018-05-13 Thread Lu Baolu
= intel_iommu_attach_device, > .detach_dev = intel_iommu_detach_device, > +#ifdef CONFIG_INTEL_IOMMU_SVM > + .bind_pasid_table = intel_iommu_bind_pasid_table, > + .unbind_pasid_table = intel_iommu_unbind_pasid_table, > +#endif > .map= intel_iommu_map, > .unmap = intel_iommu_unmap, > .map_sg = default_iommu_map_sg, > diff --git a/include/linux/dma_remapping.h b/include/linux/dma_remapping.h > index 21b3e7d..db290b2 100644 > --- a/include/linux/dma_remapping.h > +++ b/include/linux/dma_remapping.h > @@ -28,6 +28,7 @@ > > #define CONTEXT_DINVE(1ULL << 8) > #define CONTEXT_PRS (1ULL << 9) > +#define CONTEXT_NESTE(1ULL << 10) > #define CONTEXT_PASIDE (1ULL << 11) > > struct intel_iommu; Best regards, Lu Baolu

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

2018-05-13 Thread Lu Baolu
o global list */ > u8 bus; /* PCI bus number */ > u8 devfn; /* PCI devfn number */ > + u16 pfsid; /* SRIOV physical function source ID */ > u8 pasid_supported:3; > u8 pasid_enabled:1; > u8 pri_supported:1; Best regards, Lu Baolu

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

2018-05-13 Thread Lu Baolu
type); > -extern void qi_flush_dev_iotlb(struct intel_iommu *iommu, u16 sid, u16 qdep, > -u64 addr, unsigned mask); > - > +extern void qi_flush_dev_iotlb(struct intel_iommu *iommu, u16 sid, u16 pfsid, > + u16 qdep, u64 addr, unsigned mask); Alignment should match open parenthesis. > extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu); > > extern int dmar_ir_support(void); Best regards, Lu Baolu

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

2018-05-13 Thread Lu Baolu
unsigned int size_order, u64 type); > +extern void qi_flush_eiotlb(struct intel_iommu *iommu, u16 did, u64 addr, > + u32 pasid, unsigned int size_order, u64 type, bool > global); > extern void qi_flush_dev_iotlb(struct intel_iommu *iommu, u16 sid, u16 pfsid, > u16 qdep, u64 addr, unsigned mask); > + > +extern void qi_flush_dev_eiotlb(struct intel_iommu *iommu, u16 sid, > + u32 pasid, u16 qdep, u64 addr, unsigned size, u64 > granu); > +extern void qi_flush_pasid(struct intel_iommu *iommu, u16 did, u64 granu, > int pasid); > + > extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu); > > extern int dmar_ir_support(void); Best regards, Lu Baolu

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

2018-05-13 Thread Lu Baolu
OMMU_INV_TYPE_TLB, IOMMU_INV_TYPE_PASID, IOMMU_INV_NR_TYPE }; So "unsupported" looks better than "unknown" in the message. > + ret = -EINVAL; > + } > +out_unlock: > + spin_unlock(>lock); > + spin_unlock_irqrestore(_domain_lock, flags); > + > + return ret; > +} > + > static int intel_iommu_map(struct iommu_domain *domain, > unsigned long iova, phys_addr_t hpa, > size_t size, int iommu_prot) > @@ -5401,6 +5529,7 @@ const struct iommu_ops intel_iommu_ops = { > #ifdef CONFIG_INTEL_IOMMU_SVM > .bind_pasid_table = intel_iommu_bind_pasid_table, > .unbind_pasid_table = intel_iommu_unbind_pasid_table, > + .sva_invalidate = intel_iommu_sva_invalidate, > #endif > .map= intel_iommu_map, > .unmap = intel_iommu_unmap, Best regards, Lu Baolu

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

2018-05-13 Thread Lu Baolu
is to create a parent pointer under device struct and move previous iommu_group and iommu_fwspec together with the iommu fault related data into it. Best regards, Lu Baolu > > Suggested-by: Greg Kroah-Hartman > Reviewed-by: Greg Kroah-Hartman > Signed-off-by: Jacob Pan > Link: https:

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

2018-05-14 Thread Lu Baolu
_unregister_device_fault_handler(struct device *dev); > + > +extern int iommu_report_device_fault(struct device *dev, struct > iommu_fault_event *evt); > + > extern int iommu_group_id(struct iommu_group *group); > extern struct iommu_group *iommu_group_get_for_dev(struct device *dev); > extern struct iommu_domain *iommu_group_default_domain(struct iommu_group *); > @@ -727,6 +741,23 @@ static inline int iommu_group_unregister_notifier(struct > iommu_group *group, > return 0; > } > > +static inline int iommu_register_device_fault_handler(struct device *dev, > + iommu_dev_fault_handler_t > handler, > + void *data) > +{ > + return -ENODEV; > +} > + > +static inline int iommu_unregister_device_fault_handler(struct device *dev) > +{ > + return 0; > +} > + > +static inline int iommu_report_device_fault(struct device *dev, struct > iommu_fault_event *evt) > +{ > + return -ENODEV; > +} > + > static inline int iommu_group_id(struct iommu_group *group) > { > return -ENODEV; Best regards, Lu Baolu

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

2018-05-14 Thread Lu Baolu
{ > + msg->private_data = evt->iommu_private; > + ret = domain->ops->page_response(dev, msg); > + list_del(>list); > + kfree(evt); > + break; > + } > + } Are above two ch

Re: [PATCH 5/9] iommu/vt-d: Per domain pasid table interfaces

2018-05-01 Thread Lu Baolu
Hi Yi, Thank you very much for reviewing my patches. On 05/01/2018 05:22 PM, Liu, Yi L wrote: >> From: Lu Baolu [mailto:baolu...@linux.intel.com] >> Sent: Tuesday, April 17, 2018 11:03 AM >> >> This patch adds the interfaces for per domain pasid table >> managem

Re: [PATCH 6/9] iommu/vt-d: Allocate and free pasid table

2018-05-01 Thread Lu Baolu
Hi, On 05/01/2018 05:22 PM, Liu, Yi L wrote: >> From: Lu Baolu [mailto:baolu...@linux.intel.com] >> Sent: Tuesday, April 17, 2018 11:03 AM >> >> This patch allocates PASID table for a domain at the time when >> it is being created (if any devices using this do

Re: [PATCH 8/9] iommu/vt-d: Use per-domain pasid table

2018-05-01 Thread Lu Baolu
Hi, On 05/01/2018 05:23 PM, Liu, Yi L wrote: >> From: Lu Baolu [mailto:baolu...@linux.intel.com] >> Sent: Tuesday, April 17, 2018 11:03 AM >> >> This patch replaces current per iommu pasid table with >> the new added per domain pasid table. Each svm-capable >>

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