Re: [PATCH] driver core: platform: add device binding path 'driver_override'

2014-06-25 Thread Kim Phillips
On Mon, 2 Jun 2014 21:28:42 -0700 Greg KH wrote: > On Mon, Jun 02, 2014 at 07:42:58PM -0500, Kim Phillips wrote: > > You are the platform driver core maintainer: can you apply this to > > your driver-core tree now? > > Yes, I will after this merge window ends, it's too late for 3.16-rc1 > with t

Re: [Patch Part3 V3 00/21] Enable support of Intel DMAR device hotplug

2014-06-25 Thread Bjorn Helgaas
> iommu/vt-d: match segment number when searching for dev_iotlb capable > devices > iommu/vt-d: use correct domain id to flush virtual machine domains > iommu/vt-d: introduce helper functions to improve code readability > iommu/vt-d: introduce helper functions to make code symmetric for

Re: [PATCH v2] devicetree: Add generic IOMMU device tree bindings

2014-06-25 Thread Will Deacon
On Wed, Jun 25, 2014 at 11:12:13AM +0100, Arnd Bergmann wrote: > On Wednesday 25 June 2014 10:57:36 Will Deacon wrote: > > So far, I've been avoiding the hardcoding. However, you could potentially > > build a system with a small number of SMRs (compared to the number of > > StreamIDs) and allocate

Re: [PATCH v2] devicetree: Add generic IOMMU device tree bindings

2014-06-25 Thread Arnd Bergmann
On Wednesday 25 June 2014 10:57:36 Will Deacon wrote: > So far, I've been avoiding the hardcoding. However, you could potentially > build a system with a small number of SMRs (compared to the number of > StreamIDs) and allocate the StreamIDs in such a way that I think the dynamic > configuration wo

Re: [PATCH v2] devicetree: Add generic IOMMU device tree bindings

2014-06-25 Thread Will Deacon
On Wed, Jun 25, 2014 at 10:48:31AM +0100, Arnd Bergmann wrote: > On Wednesday 25 June 2014 10:38:25 Will Deacon wrote: > > On Wed, Jun 25, 2014 at 10:27:50AM +0100, Arnd Bergmann wrote: > > > I think the situation is a bit different here: It's less about the corner > > > cases for the SMMU, but abo

Re: [PATCH v2] devicetree: Add generic IOMMU device tree bindings

2014-06-25 Thread Arnd Bergmann
On Wednesday 25 June 2014 10:38:25 Will Deacon wrote: > On Wed, Jun 25, 2014 at 10:27:50AM +0100, Arnd Bergmann wrote: > > On Wednesday 25 June 2014 10:17:02 Will Deacon wrote: > > > On Tue, Jun 24, 2014 at 07:20:56PM +0100, Arnd Bergmann wrote: > > > > On Tuesday 24 June 2014 19:11:50 Will Deacon

Re: [PATCH v2] devicetree: Add generic IOMMU device tree bindings

2014-06-25 Thread Will Deacon
On Wed, Jun 25, 2014 at 10:27:50AM +0100, Arnd Bergmann wrote: > On Wednesday 25 June 2014 10:17:02 Will Deacon wrote: > > On Tue, Jun 24, 2014 at 07:20:56PM +0100, Arnd Bergmann wrote: > > > On Tuesday 24 June 2014 19:11:50 Will Deacon wrote: > > > > On Tue, Jun 24, 2014 at 06:57:44PM +0100, Olav

Re: [PATCH v2] devicetree: Add generic IOMMU device tree bindings

2014-06-25 Thread Arnd Bergmann
On Wednesday 25 June 2014 10:17:02 Will Deacon wrote: > On Tue, Jun 24, 2014 at 07:20:56PM +0100, Arnd Bergmann wrote: > > On Tuesday 24 June 2014 19:11:50 Will Deacon wrote: > > > On Tue, Jun 24, 2014 at 06:57:44PM +0100, Olav Haugan wrote: > > > > We do describe the masked StreamID (SID) but we n

Re: [PATCH v2] devicetree: Add generic IOMMU device tree bindings

2014-06-25 Thread Will Deacon
On Tue, Jun 24, 2014 at 10:35:54PM +0100, Olav Haugan wrote: > On 6/24/2014 11:11 AM, Will Deacon wrote: > > On Tue, Jun 24, 2014 at 06:57:44PM +0100, Olav Haugan wrote: > >> On 6/24/2014 2:18 AM, Will Deacon wrote: > >>> On Sat, Jun 21, 2014 at 12:16:25AM +0100, Olav Haugan wrote: > We have m

Re: [PATCH v2] devicetree: Add generic IOMMU device tree bindings

2014-06-25 Thread Will Deacon
On Tue, Jun 24, 2014 at 07:20:56PM +0100, Arnd Bergmann wrote: > On Tuesday 24 June 2014 19:11:50 Will Deacon wrote: > > On Tue, Jun 24, 2014 at 06:57:44PM +0100, Olav Haugan wrote: > > > We do describe the masked StreamID (SID) but we need to specify the mask > > > that the SMMU should apply to th

[Patch Part3 V3 21/21] pci, ACPI, iommu: enhance pci_root to support DMAR device hotplug

2014-06-25 Thread Jiang Liu
Finally enhance pci_root driver to support DMAR device hotplug when hot-plugging PCI host bridges. Signed-off-by: Jiang Liu --- drivers/acpi/pci_root.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index

[Patch Part3 V3 19/21] iommu/vt-d: enhance error recovery in function intel_enable_irq_remapping()

2014-06-25 Thread Jiang Liu
Enhance error recovery in function intel_enable_irq_remapping() by tearing down all created data structures. Signed-off-by: Jiang Liu --- drivers/iommu/intel_irq_remapping.c |8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/intel_irq_remapping.c b/driv

[Patch Part3 V3 20/21] iommu/vt-d: enhance intel-iommu driver to support DMAR unit hotplug

2014-06-25 Thread Jiang Liu
Implement required callback functions for intel-iommu driver to support DMAR unit hotplug. Signed-off-by: Jiang Liu --- drivers/iommu/intel-iommu.c | 206 +++ 1 file changed, 151 insertions(+), 55 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/d

[Patch Part3 V3 16/21] iommu/vt-d: implement DMAR unit hotplug framework

2014-06-25 Thread Jiang Liu
On Intel platforms, an IO Hub (PCI/PCIe host bridge) may contain DMAR units, so we need to support DMAR hotplug when supporting PCI host bridge hotplug on Intel platforms. According to Section 8.8 "Remapping Hardware Unit Hot Plug" in "Intel Virtualization Technology for Directed IO Architecture S

[Patch Part3 V3 17/21] iommu/vt-d: search _DSM method for DMAR hotplug

2014-06-25 Thread Jiang Liu
According to Intel VT-d specification, _DSM method to support DMAR hotplug should exist directly under corresponding ACPI object representing PCI host bridge. But some BIOSes doesn't conform to this, so search for _DSM method in the subtree starting from the ACPI object representing the PCI host br

[Patch Part3 V3 10/21] iommu/vt-d: simplify intel_unmap_sg() and kill duplicated code

2014-06-25 Thread Jiang Liu
Introduce intel_unmap() to reduce duplicated code in intel_unmap_sg() and intel_unmap_page(). Also let dma_pte_free_pagetable() to call dma_pte_clear_range() directly, so caller only needs to call dma_pte_free_pagetable(). Signed-off-by: Jiang Liu --- drivers/iommu/intel-iommu.c | 70

[Patch Part3 V3 11/21] iommu/vt-d: introduce helper domain_pfn_within_range() to simplify code

2014-06-25 Thread Jiang Liu
Introduce helper function domain_pfn_within_range() to simplify code and improve readability. Signed-off-by: Jiang Liu --- drivers/iommu/intel-iommu.c | 30 -- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iomm

[Patch Part3 V3 18/21] iommu/vt-d: enhance intel_irq_remapping driver to support DMAR unit hotplug

2014-06-25 Thread Jiang Liu
Implement required callback functions for intel_irq_remapping driver to support DMAR unit hotplug. Signed-off-by: Jiang Liu --- drivers/iommu/intel_irq_remapping.c | 222 ++- 1 file changed, 169 insertions(+), 53 deletions(-) diff --git a/drivers/iommu/intel_irq

[Patch Part3 V3 03/21] iommu/vt-d: introduce helper functions to improve code readability

2014-06-25 Thread Jiang Liu
Introduce domain_type_is_vm() and domain_type_is_vm_or_si() to improve code readability. Also kill useless macro DOMAIN_FLAG_P2P_MULTIPLE_DEVICES. Signed-off-by: Jiang Liu --- drivers/iommu/intel-iommu.c | 59 +++ 1 file changed, 26 insertions(+), 33 de

[Patch Part3 V3 15/21] iommu/vt-d: dynamically allocate and free seq_id for DMAR units

2014-06-25 Thread Jiang Liu
Introduce functions to support dynamic IOMMU seq_id allocating and releasing, which will be used to support DMAR hotplug. Also rename IOMMU_UNITS_SUPPORTED as DMAR_UNITS_SUPPORTED. Signed-off-by: Jiang Liu --- drivers/iommu/dmar.c| 40 ++-- drivers/

[Patch Part3 V3 08/21] iommu/VT-d: simplify include/linux/dmar.h

2014-06-25 Thread Jiang Liu
Simplify include/linux/dmar.h a bit based on the fact that both CONFIG_INTEL_IOMMU and CONFIG_IRQ_REMAP select CONFIG_DMAR_TABLE. Signed-off-by: Jiang Liu --- include/linux/dmar.h | 50 ++ 1 file changed, 18 insertions(+), 32 deletions(-) diff -

[Patch Part3 V3 07/21] iommu/vt-d: avoid freeing virtual machine domain in free_dmar_iommu()

2014-06-25 Thread Jiang Liu
Virtual machine domains are created by intel_iommu_domain_init() and should be destroyed by intel_iommu_domain_destroy(). So avoid freeing virtual machine domain data structure in free_dmar_iommu() when doamin->iommu_count reaches zero, otherwise it may cause invalid memory access because the IOMMU

[Patch Part3 V3 09/21] iommu/vt-d: change iommu_enable/disable_translation to return void

2014-06-25 Thread Jiang Liu
Simplify error handling path by changing iommu_{enable|disable}_translation to return void. Signed-off-by: Jiang Liu --- drivers/iommu/intel-iommu.c | 18 +- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c

[Patch Part3 V3 06/21] iommu/vt-d: fix possible invalid memory access caused by free_dmar_iommu()

2014-06-25 Thread Jiang Liu
Static identity and virtual machine domains may be cached in iommu->domain_ids array after corresponding IOMMUs have been removed from domain->iommu_bmp. So we should check domain->iommu_bmp before decreasing domain->iommu_count in function free_dmar_iommu(), otherwise it may cause free of inuse do

[Patch Part3 V3 14/21] IOMMU/vt-d: introduce helper function dmar_walk_resources()

2014-06-25 Thread Jiang Liu
Introduce helper function dmar_walk_resources to walk resource entries in DMAR table and ACPI buffer object returned by ACPI _DSM method for IOMMU hot-plug. Signed-off-by: Jiang Liu --- drivers/iommu/dmar.c| 208 +++ drivers/iommu/intel-iommu.c |

[Patch Part3 V3 04/21] iommu/vt-d: introduce helper functions to make code symmetric for readability

2014-06-25 Thread Jiang Liu
Introduce domain_attach_iommu()/domain_detach_iommu() and refine iommu_attach_domain()/iommu_detach_domain() to make code symmetric and improve readability. Signed-off-by: Jiang Liu --- drivers/iommu/intel-iommu.c | 146 --- 1 file changed, 80 insertions(

[Patch Part3 V3 12/21] iommu/vt-d: introduce helper function iova_size() to improve code readability

2014-06-25 Thread Jiang Liu
Signed-off-by: Jiang Liu --- drivers/iommu/intel-iommu.c |7 +++ include/linux/iova.h|5 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 0d34f33bea34..d94468ae2947 100644 --- a/drivers/iommu/i

[Patch Part3 V3 13/21] iommu/vt-d: fix bug in computing domain's iommu_snooping flag

2014-06-25 Thread Jiang Liu
IOMMU units may dynamically attached to/detached from domains, so we should scan all active IOMMU units when computing iommu_snooping flag for a domain instead of only scanning IOMMU units associated with the domain. Also check snooping and superpage capabilities when hot-adding DMAR units. Signe

[Patch Part3 V3 02/21] iommu/vt-d: use correct domain id to flush virtual machine domains

2014-06-25 Thread Jiang Liu
For virtual machine domains, domain->id is a virtual id, and the real domain id written into context entry is dynamically allocated. So use the real domain id instead of domain->id when flushing iotlbs for virtual machine domains. Signed-off-by: Jiang Liu --- drivers/iommu/intel-iommu.c |2 +

[Patch Part3 V3 05/21] iommu/vt-d: only dynamically allocate domain id for virtual domains

2014-06-25 Thread Jiang Liu
Check the same domain id is allocated for si_domain on each IOMMU, otherwise the IOTLB flush for si_domain will fail. Now the rules to allocate and manage domain id are: 1) For normal and static identity domains, domain id is allocated when creating domain structure. And this id will be written

[Patch Part3 V3 00/21] Enable support of Intel DMAR device hotplug

2014-06-25 Thread Jiang Liu
When hot plugging a descrete IOH or a physical processor with embedded IIO, we need to handle DMAR(or IOMMU) unit in the PCIe host bridge if DMAR is in use. This patch set tries to enhance current DMAR/IOMMU/IR drivers to support hotplug and is based on latest mainstream kernel v3.16-rc2. Patch 1-

[Patch Part3 V3 01/21] iommu/vt-d: match segment number when searching for dev_iotlb capable devices

2014-06-25 Thread Jiang Liu
For virtual machine and static identity domains, there may be devices from different PCI segments associated with the same domain. So function iommu_support_dev_iotlb() should also match PCI segment number (iommu unit) when searching for dev_iotlb capable devices. Signed-off-by: Jiang Liu --- dr