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 Joerg's iommu/next
branch.
Patch
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
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 jiang@linux.intel.com
---
drivers/iommu/intel-iommu.c | 59 +++
1 file
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 jiang@linux.intel.com
---
drivers/iommu/intel-iommu.c | 147 +++
1
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 jiang@linux.intel.com
---
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
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.
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 jiang@linux.intel.com
---
include/linux/dmar.h | 50 ++
1 file changed, 18
Simplify error handling path by changing iommu_{enable|disable}_translation
to return void.
Signed-off-by: Jiang Liu jiang@linux.intel.com
---
drivers/iommu/intel-iommu.c | 18 +-
1 file changed, 5 insertions(+), 13 deletions(-)
diff --git a/drivers/iommu/intel-iommu.c
Introduce helper function domain_pfn_within_range() to simplify code
and improve readability.
Signed-off-by: Jiang Liu jiang@linux.intel.com
---
drivers/iommu/intel-iommu.c | 30 --
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git
Signed-off-by: Jiang Liu jiang@linux.intel.com
---
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 c9e65edaa2ad..cd1ba24c766a
Implement required callback functions for intel_irq_remapping driver
to support DMAR unit hotplug.
Signed-off-by: Jiang Liu jiang@linux.intel.com
---
drivers/iommu/intel_irq_remapping.c | 222 ++-
1 file changed, 169 insertions(+), 53 deletions(-)
diff --git
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
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
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 jiang@linux.intel.com
---
drivers/iommu/dmar.c| 40
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
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
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 jiang@linux.intel.com
---
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 jiang@linux.intel.com
---
drivers/iommu/dmar.c| 208 +++
Implement required callback functions for intel-iommu driver
to support DMAR unit hotplug.
Signed-off-by: Jiang Liu jiang@linux.intel.com
---
drivers/iommu/intel-iommu.c | 206 +++
1 file changed, 151 insertions(+), 55 deletions(-)
diff --git
On Thu, Jul 10, 2014 at 11:32:16PM +0100, Olav Haugan wrote:
On 7/9/2014 3:54 AM, Will Deacon wrote:
On Wed, Jul 09, 2014 at 02:07:38AM +0100, Olav Haugan wrote:
So how does an algorithm figure this out in both my examples? The
algorithm would have to know about both (all) bus masters and
On Wed, Jul 02, 2014 at 03:32:59PM +0200, Joerg Roedel wrote:
Hi David,
On Wed, Apr 30, 2014 at 11:49:33AM +0100, David Woodhouse wrote:
There could be all kinds of existing mappings in the DMA page tables,
and I'm not sure it's safe to preserve them. What prevents the crashdump
kernel
On Fri, Jul 4, 2014 at 11:29 AM, Thierry Reding
thierry.red...@gmail.com wrote:
From: Thierry Reding tred...@nvidia.com
This commit introduces a generic device tree binding for IOMMU devices.
Only a very minimal subset is described here, but it is enough to cover
the requirements of both the
23 matches
Mail list logo