[PATCH v3 4/7] DMA-API: Add dma_(un)map_resource() documentation

2015-05-29 Thread wdavis
From: Will Davis Add references to both the general API documentation as well as the HOWTO. Signed-off-by: Will Davis --- Documentation/DMA-API-HOWTO.txt | 36 ++-- Documentation/DMA-API.txt | 31 ++- 2 files changed, 60 inserti

[PATCH v3 5/7] iommu/amd: Implement (un)map_resource

2015-05-29 Thread wdavis
From: Will Davis Implement 'map_resource' for the AMD IOMMU driver. Generalize the existing map_page implementation to operate on a physical address, and make both map_page and map_resource wrappers around that helper (and similiarly, for unmap_page and unmap_resource). This allows a device to m

[PATCH v3 3/7] dma-mapping: pci: add pci_(un)map_resource

2015-05-29 Thread wdavis
From: Will Davis Simply route these through to the new dma_(un)map_resource APIs. Signed-off-by: Will Davis Reviewed-by: Terence Ripperda Reviewed-by: John Hubbard --- include/asm-generic/pci-dma-compat.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/include/asm-generic

[PATCH v3 1/7] dma-debug: add checking for map/unmap_resource

2015-05-29 Thread wdavis
From: Will Davis Add debug callbacks for the new dma_map_resource and dma_unmap_resource functions. Signed-off-by: Will Davis Reviewed-by: Terence Ripperda Reviewed-by: John Hubbard --- include/linux/dma-debug.h | 20 lib/dma-debug.c | 47 ++

[PATCH v3 7/7] x86: add pci-nommu implementation of map_resource

2015-05-29 Thread wdavis
From: Will Davis Lookup the bus address of the resource by finding the parent host bridge, which may be different than the parent host bridge of the target device. Signed-off-by: Will Davis --- arch/x86/kernel/pci-nommu.c | 32 1 file changed, 32 insertions(+)

[PATCH v3 6/7] iommu/vt-d: implement (un)map_resource

2015-05-29 Thread wdavis
From: Will Davis Implement 'map_resource' for the Intel IOMMU driver. Simply translate the resource to a physical address and route it to the same handlers used by the 'map_page' API. This allows a device to map another's resource, to enable peer-to-peer transactions. Signed-off-by: Will Davis

[PATCH v3 2/7] DMA-API: Introduce dma_(un)map_resource

2015-05-29 Thread wdavis
From: Will Davis Add functions to DMA-map and -unmap a resource for a given device. This will allow devices to DMA-map a peer device's resource (for example, another device's BAR region on PCI) to enable peer-to-peer transactions. Signed-off-by: Will Davis --- include/asm-generic/dma-mapping-b

[PATCH v3 0/7] IOMMU/DMA map_resource support for peer-to-peer

2015-05-29 Thread wdavis
From: Will Davis Hi, This is the third version of a patchset to add the DMA APIs necessary to map and unmap a struct resource to and from a PCI device's IOVA domain. This allows a PCI device to access a peer device's BAR resource when a hardware IOMMU is enabled. Thanks, Will Changelog: v3: -

[PATCH v2 6/7] iommu/vt-d: implement (un)map_resource

2015-05-18 Thread wdavis
From: Will Davis Implement 'map_resource' for the Intel IOMMU driver. Simply translate the resource to a physical address and route it to the same handlers used by the 'map_page' API. This allows a device to map another's resource, to enable peer-to-peer transactions. Signed-off-by: Will Davis

[PATCH v2 7/7] x86: add pci-nommu implementation of map_resource

2015-05-18 Thread wdavis
From: Will Davis Lookup the bus address of the resource by finding the parent host bridge, which may be different than the parent host bridge of the target device. Signed-off-by: Will Davis --- arch/x86/kernel/pci-nommu.c | 32 1 file changed, 32 insertions(+)

[PATCH v2 5/7] iommu/amd: Implement (un)map_resource

2015-05-18 Thread wdavis
From: Will Davis Implement 'map_resource' for the AMD IOMMU driver. Generalize the existing map_page implementation to operate on a physical address, and make both map_page and map_resource wrappers around that helper (and similiarly, for unmap_page and unmap_resource). This allows a device to m

[PATCH v2 4/7] DMA-API: Add dma_(un)map_resource() documentation

2015-05-18 Thread wdavis
From: Will Davis Add references to both the general API documentation as well as the HOWTO. Signed-off-by: Will Davis --- Documentation/DMA-API-HOWTO.txt | 39 +-- Documentation/DMA-API.txt | 36 +++- 2 files changed, 68

[PATCH v2 0/7] IOMMU/DMA map_resource support for peer-to-peer

2015-05-18 Thread wdavis
From: Will Davis Hi, This is a second attempt at adding the DMA APIs necessary to map and unmap a struct resource to and from a PCI device's IOVA domain. This allows a PCI device to access a peer device's BAR resource when a hardware IOMMU is enabled. Thanks, Will Changelog: v2: - added docum

[PATCH v2 2/7] DMA-API: Introduce dma_(un)map_resource

2015-05-18 Thread wdavis
From: Will Davis Add functions to DMA-map and -unmap a resource for a given device. This will allow devices to DMA-map a peer device's resource (for example, another device's BAR region on PCI) to enable peer-to-peer transactions. Signed-off-by: Will Davis Reviewed-by: Terence Ripperda Reviewe

[PATCH v2 3/7] dma-mapping: pci: add pci_(un)map_resource

2015-05-18 Thread wdavis
From: Will Davis Simply route these through to the new dma_(un)map_resource APIs. Signed-off-by: Will Davis Reviewed-by: Terence Ripperda Reviewed-by: John Hubbard --- include/asm-generic/pci-dma-compat.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/include/asm-generic

[PATCH v2 1/7] dma-debug: add checking for map/unmap_resource

2015-05-18 Thread wdavis
From: Will Davis Add debug callbacks for the new dma_map_resource and dma_unmap_resource functions. Signed-off-by: Will Davis Reviewed-by: Terence Ripperda Reviewed-by: John Hubbard --- include/linux/dma-debug.h | 20 lib/dma-debug.c | 47 ++

[PATCH 5/6] iommu/vt-d: implement (un)map_resource

2015-05-01 Thread wdavis
From: Will Davis Implement 'map_resource' for the Intel IOMMU driver. Simply translate the resource to a physical address and route it to the same handlers used by the 'map_page' API. This allows a device to map another's resource, to enable peer-to-peer transactions. Signed-off-by: Will Davis

[PATCH 4/6] iommu/amd: Implement (un)map_resource

2015-05-01 Thread wdavis
From: Will Davis Implement 'map_resource' for the AMD IOMMU driver. Generalize the existing map_page implementation to operate on a physical address, and make both map_page and map_resource wrappers around that helper (and similiarly, for unmap_page and unmap_resource). This allows a device to m

[PATCH 6/6] x86: add pci-nommu implementation of map_resource

2015-05-01 Thread wdavis
From: Will Davis Simply pass through the physical address as the DMA address. Signed-off-by: Will Davis Reviewed-by: Terence Ripperda Reviewed-by: John Hubbard --- arch/x86/kernel/pci-nommu.c | 17 + 1 file changed, 17 insertions(+) diff --git a/arch/x86/kernel/pci-nommu.c b

[PATCH 3/6] dma-mapping: pci: add pci_(un)map_resource

2015-05-01 Thread wdavis
From: Will Davis Simply route these through to the new dma_(un)map_resource APIs. Signed-off-by: Will Davis Reviewed-by: Terence Ripperda Reviewed-by: John Hubbard --- include/asm-generic/pci-dma-compat.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/include/asm-generic

[PATCH 1/6] dma-debug: add checking for map/unmap_resource

2015-05-01 Thread wdavis
From: Will Davis Add debug callbacks for the new dma_map_resource and dma_unmap_resource functions. Signed-off-by: Will Davis Reviewed-by: Terence Ripperda Reviewed-by: John Hubbard --- include/linux/dma-debug.h | 20 lib/dma-debug.c | 48 ++

[PATCH 0/6] IOMMU/DMA map_resource support for peer-to-peer

2015-05-01 Thread wdavis
From: Will Davis Hi, This patch series adds DMA APIs to map and unmap a struct resource to and from a PCI device's IOVA domain, and implements the AMD, Intel, and nommu versions of these interfaces. This solves a long-standing problem with the existing DMA-remapping interfaces, which require th

[PATCH 2/6] DMA-API: Introduce dma_(un)map_resource

2015-05-01 Thread wdavis
From: Will Davis Add functions to DMA-map and -unmap a resource for a given device. This will allow devices to DMA-map a peer device's resource (for example, another device's BAR region on PCI) to enable peer-to-peer transactions. Signed-off-by: Will Davis Reviewed-by: Terence Ripperda Reviewe