> +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
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);
> +
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
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
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
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
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
>&
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
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
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@
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
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
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
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
>
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:
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 <
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
>>
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
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
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.
>
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
>
> [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]
>
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:
>>>>
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
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,
>>>>
>>&
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
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
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
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..
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
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
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
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
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
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..
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
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
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
@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
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
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
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
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..
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
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
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
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
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-
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
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
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 &
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..
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
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
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
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..
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
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
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(+
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..
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
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
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
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
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
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
/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
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
, 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
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
└──
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
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
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
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
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
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
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
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()
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
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
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
>
@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
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
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
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
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
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
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
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 */
= 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
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
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
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
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
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:
_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
{
> + msg->private_data = evt->iommu_private;
> + ret = domain->ops->page_response(dev, msg);
> + list_del(>list);
> + kfree(evt);
> + break;
> + }
> + }
Are above two ch
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
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
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
>>
601 - 700 of 1892 matches
Mail list logo