Re: [RESEND PATCH V6 0/6] Add support for privileged mappings

2016-12-02 Thread Robin Murphy
ds/mh/dma-priv > The following patch to the ARM SMMU driver: > > commit d346180e70b91b3d5a1ae7e5603e65593d4622bc > Author: Robin Murphy > Date: Tue Jan 26 18:06:34 2016 + > > iommu/arm-smmu: Treat all device transactions as unprivileged

Re: [RFC v3 03/10] iommu: Add new reserved IOMMU attributes

2016-12-06 Thread Robin Murphy
On 15/11/16 13:09, Eric Auger wrote: > IOMMU_RESV_NOMAP is used to tag reserved IOVAs that are not > supposed to be IOMMU mapped. IOMMU_RESV_MSI tags IOVAs > corresponding to MSIs that need to be IOMMU mapped. > > IOMMU_RESV_MASK allows to check if the IOVA is reserved. > > Signed-off-by: Eric Au

Re: [RFC v3 02/10] iommu: Rename iommu_dm_regions into iommu_resv_regions

2016-12-06 Thread Robin Murphy
long to another address space or because > they are not translated by the IOMMU and need special handling) > > So let's rename the struct and also the callbacks. Acked-by: Robin Murphy > Signed-off-by: Eric Auger > --- > drivers/iommu/amd_iommu.c | 20 ++--

Re: [RFC v3 04/10] iommu: iommu_alloc_resv_region

2016-12-06 Thread Robin Murphy
On 15/11/16 13:09, Eric Auger wrote: > Introduce a new helper serving the purpose to allocate a reserved > region. This will be used in iommu driver implementing reserved > region callbacks. > > Signed-off-by: Eric Auger > --- > drivers/iommu/iommu.c | 16 > include/linux/iommu

Re: [RFC v3 05/10] iommu: Do not map reserved regions

2016-12-06 Thread Robin Murphy
On 15/11/16 13:09, Eric Auger wrote: > As we introduced IOMMU_RESV_NOMAP and IOMMU_RESV_MSI regions, > let's prevent those new regions from being mapped. > > Signed-off-by: Eric Auger > --- > drivers/iommu/iommu.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/iommu/iommu.c

Re: [RFC v3 06/10] iommu: iommu_get_group_resv_regions

2016-12-06 Thread Robin Murphy
On 15/11/16 13:09, Eric Auger wrote: > Introduce iommu_get_group_resv_regions whose role consists in > enumerating all devices from the group and collecting their > reserved regions. It checks duplicates. > > Signed-off-by: Eric Auger > > --- > > - we do not move list elements from device to gr

Re: [RFC v3 09/10] iommu/arm-smmu: Implement reserved region get/put callbacks

2016-12-06 Thread Robin Murphy
On 15/11/16 13:09, Eric Auger wrote: > The get() populates the list with the PCI host bridge windows > and the MSI IOVA range. > > At the moment an arbitray MSI IOVA window is set at 0x800 > of size 1MB. This will allow to report those info in iommu-group > sysfs? > > Signed-off-by: Eric Auge

Re: [RESEND PATCH V6 0/6] Add support for privileged mappings

2016-12-06 Thread Robin Murphy
On 04/12/16 07:48, Sricharan wrote: > Hi Robin, > >> Hi Sricharan, >> >> On 02/12/16 14:55, Sricharan R wrote: >>> This series is a resend of the V5 that Mitch sent sometime back [2] >>> All the patches are the same and i have just rebased. Not sure why this >>> finally did not make it last time.

Re: [RFC v3 09/10] iommu/arm-smmu: Implement reserved region get/put callbacks

2016-12-07 Thread Robin Murphy
On 07/12/16 15:02, Auger Eric wrote: > Hi Robin, > On 06/12/2016 19:55, Robin Murphy wrote: >> On 15/11/16 13:09, Eric Auger wrote: >>> The get() populates the list with the PCI host bridge windows >>> and the MSI IOVA range. >>> >>> At the moment

Re: [RFC v3 00/10] KVM PCIe/MSI passthrough on ARM/ARM64 and IOVA reserved regions

2016-12-08 Thread Robin Murphy
On 08/12/16 09:36, Auger Eric wrote: > Hi, > > On 15/11/2016 14:09, Eric Auger wrote: >> Following LPC discussions, we now report reserved regions through >> iommu-group sysfs reserved_regions attribute file. > > > While I am respinning this series into v4, here is a tentative summary > of techn

Re: [RFC v3 00/10] KVM PCIe/MSI passthrough on ARM/ARM64 and IOVA reserved regions

2016-12-08 Thread Robin Murphy
On 08/12/16 13:36, Auger Eric wrote: > Hi Robin, > > On 08/12/2016 14:14, Robin Murphy wrote: >> On 08/12/16 09:36, Auger Eric wrote: >>> Hi, >>> >>> On 15/11/2016 14:09, Eric Auger wrote: >>>> Following LPC discussions, we now

Re: [RFC v3 00/10] KVM PCIe/MSI passthrough on ARM/ARM64 and IOVA reserved regions

2016-12-08 Thread Robin Murphy
On 08/12/16 17:01, Alex Williamson wrote: > On Thu, 8 Dec 2016 13:14:04 + > Robin Murphy wrote: >> On 08/12/16 09:36, Auger Eric wrote: >>> 3) RMRR reporting in the iommu group sysfs? Joerg: yes; Don: no >>>My current series does not expose them in iommu gr

Re: [PATCH V7 7/8] iommu/arm-smmu: Set privileged attribute to 'default' instead of 'unprivileged'

2016-12-13 Thread Robin Murphy
g to unprivileged, instead > set it to default as incoming and let it be controlled by the pagetable > settings. > > Acked-by: Will Deacon > Signed-off-by: Sricharan R Since everything else has already got my tags on it: Reviewed-by: Robin Murphy I'd say the whole series looks goo

Re: [PATCH V7 4/8] common: DMA-mapping: add DMA_ATTR_PRIVILEGED attribute

2016-12-13 Thread Robin Murphy
t; > Cc: linux-...@vger.kernel.org > Reviewed-by: Robin Murphy > Tested-by: Robin Murphy > Acked-by: Will Deacon > Signed-off-by: Mitchel Humpherys > --- > Documentation/DMA-attributes.txt | 10 ++ > include/linux/dma-mapping.h | 7 +++ > 2 file

Re: [PATCH V7 5/8] arm64/dma-mapping: Implement DMA_ATTR_PRIVILEGED

2016-12-13 Thread Robin Murphy
gt; > Reviewed-by: Robin Murphy > Tested-by: Robin Murphy > Acked-by: Will Deacon > Signed-off-by: Mitchel Humpherys > --- > arch/arm64/mm/dma-mapping.c | 6 +++--- > drivers/iommu/dma-iommu.c | 10 -- > include/linux/dma-iommu.h | 3 ++- > 3 files change

Re: [PATCH V7 5/8] arm64/dma-mapping: Implement DMA_ATTR_PRIVILEGED

2016-12-13 Thread Robin Murphy
On 13/12/16 14:38, Sricharan wrote: > Hi Robin, > >> -Original Message- >> From: linux-arm-kernel [mailto:linux-arm-kernel-boun...@lists.infradead.org] >> On Behalf Of Robin Murphy >> Sent: Tuesday, December 13, 2016 7:33 PM >> To: Srichara

Re: [PATCH V7 5/8] arm64/dma-mapping: Implement DMA_ATTR_PRIVILEGED

2016-12-13 Thread Robin Murphy
ing->domain, iova, phys, len, prot); > if (ret < 0) > @@ -1930,7 +1936,7 @@ static dma_addr_t arm_coherent_iommu_map_page(struct > device *dev, struct page *p > if (dma_addr == DMA_ERROR_CODE) > return dma_addr; > > - prot = __dma_direction_to_prot(dir); > + prot = __dma_info_to_prot(dir, attrs); > > ret = iommu_map(mapping->domain, dma_addr, page_to_phys(page), len, > prot); > if (ret < 0) > @@ -2036,7 +2042,7 @@ static dma_addr_t arm_iommu_map_resource(struct device > *dev, > if (dma_addr == DMA_ERROR_CODE) > return dma_addr; > > - prot = __dma_direction_to_prot(dir) | IOMMU_MMIO; > + prot = __dma_info_to_prot(dir, attrs) | IOMMU_MMIO; > > ret = iommu_map(mapping->domain, dma_addr, addr, len, prot); > if (ret < 0) > Looks reasonable to me. Assuming it survives testing: Acked-by: Robin Murphy ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: RFC: extend iommu-map binding to support #iommu-cells > 1

2016-12-16 Thread Robin Murphy
On 16/12/16 02:36, Stuart Yoder wrote: > For context, please see the thread: > https://www.spinics.net/lists/arm-kernel/msg539066.html > > The existing iommu-map binding did not account for the situation where > #iommu-cells == 2, as permitted in the ARM SMMU binding. The 2nd cell > of the IOMMU

[RFC PATCH] iommu/arm-smmu: Add global SMR masking property

2016-12-16 Thread Robin Murphy
. for MMU-500 configurations where the appended TBU number gets in the way unnecessarily). Let's add a new property to allow a single global mask value to better fit the latter situation. CC: Stuart Yoder Signed-off-by: Robin Murphy --- Compile-tested only... Documentation/devicetree/bin

Re: RFC: extend iommu-map binding to support #iommu-cells > 1

2016-12-16 Thread Robin Murphy
On 16/12/16 14:21, Stuart Yoder wrote: > > >> -Original Message- >> From: Mark Rutland [mailto:mark.rutl...@arm.com] >> Sent: Friday, December 16, 2016 5:39 AM >> To: Stuart Yoder >> Cc: robin.mur...@arm.com; will.dea...@arm.com; robh...@kernel.org; Bharat >> Bhushan >> ; Nipun Gupta ;

Re: RFC: extend iommu-map binding to support #iommu-cells > 1

2016-12-16 Thread Robin Murphy
On 16/12/16 15:56, Stuart Yoder wrote: > The existing iommu-map binding did not account for the situation where > #iommu-cells == 2, as permitted in the ARM SMMU binding. The 2nd cell > of the IOMMU specifier being the SMR mask. The existing binding defines > the mapping as: >

Re: [PATCH] iommu: Drop the of_iommu_{set/get}_ops() interface

2017-01-04 Thread Robin Murphy
egister/retrieve > IOMMU instances and remove the of_iommu_{set/get}_ops() remaining glue > code in order to complete the interface rework. Reviewed-by: Robin Murphy Looking at before-and-after disassemblies, of_iommu.o is binary identical, and exynos-iommu.o differs only in the use of dev-&

Re: [PATCH 02/10] iommu/of: Prepare for deferred IOMMU configuration

2017-01-05 Thread Robin Murphy
On 05/01/17 12:27, Lorenzo Pieralisi wrote: > On Thu, Jan 05, 2017 at 02:04:37PM +0530, Sricharan wrote: >> Hi Robin/Lorenzo, >> >>> Hi Robin,Lorenzo, >>> >>>> On Wed, Nov 30, 2016 at 04:42:27PM +, Robin Murphy wrote: >>>>> On 30/1

Re: [RFC 1/3] iommu/arm-smmu: Add support to opt-in to stalling

2017-01-05 Thread Robin Murphy
On 05/01/17 14:47, Will Deacon wrote: > On Thu, Jan 05, 2017 at 02:07:31PM +, Mark Rutland wrote: >> On Thu, Jan 05, 2017 at 02:00:05PM +, Will Deacon wrote: >>> On Thu, Jan 05, 2017 at 12:08:57PM +, Mark Rutland wrote: On Thu, Jan 05, 2017 at 11:55:29AM +, Will Deacon wrote: >

Re: [RFC 1/3] iommu/arm-smmu: Add support to opt-in to stalling

2017-01-05 Thread Robin Murphy
On 05/01/17 16:07, Will Deacon wrote: > On Thu, Jan 05, 2017 at 03:32:50PM +0000, Robin Murphy wrote: >> On 05/01/17 14:47, Will Deacon wrote: >>> On Thu, Jan 05, 2017 at 02:07:31PM +, Mark Rutland wrote: >>>> Ok. It would be good to elaborate on what "sta

Re: [PATCH v6 01/18] iommu/dma: Allow MSI-only cookies

2017-01-06 Thread Robin Murphy
On 06/01/17 11:46, Auger Eric wrote: > > > On 06/01/2017 11:59, Joerg Roedel wrote: >> On Thu, Jan 05, 2017 at 07:04:29PM +, Eric Auger wrote: >>> struct iommu_dma_cookie { >>> - struct iova_domain iovad; >>> - struct list_headmsi_page_list; >>> - spinlock_t m

Re: [PATCH v2 3/4] iommu/exynos: Ensure that SYSMMU is added only once to its master device

2017-01-09 Thread Robin Murphy
Hi Marek, On 09/01/17 12:03, Marek Szyprowski wrote: > This patch prepares Exynos IOMMU driver for deferred probing > support. Once it gets added, of_xlate() callback might be called > more than once for the same SYSMMU controller and master device > (for example it happens when masters device dri

Re: [PATCH v7 01/19] iommu/dma: Implement PCI allocation optimisation

2017-01-10 Thread Robin Murphy
On 09/01/17 13:45, Eric Auger wrote: > From: Robin Murphy > > Whilst PCI devices may have 64-bit DMA masks, they still benefit from > using 32-bit addresses wherever possible in order to avoid DAC (PCI) or > longer address packets (PCIe), which may incur a performance overhead.

Re: [PATCH 1/1] iommu/arm-smmu: Fix for ThunderX erratum #27704

2017-01-11 Thread Robin Murphy
- we enable 16-bit VMID unconditionally where supported, so I don't see any reason not to handle 16-bit ASIDs in the same manner. > + cfg->fmt == ARM_SMMU_CTX_FMT_AARCH64) > + reg2 |= TTBCR2_AS; > } > if (smmu->version &g

Re: [RFC PATCH] IOMMU: SMMUv2: Support for Extended Stream ID (16 bit)

2017-01-11 Thread Robin Murphy
On 10/01/17 11:57, Aleksey Makarov wrote: > Enable the Extended Stream ID feature when available. > > This patch on top of series "[PATCH v7 00/19] KVM PCIe/MSI passthrough > on ARM/ARM64 and IOVA reserved regions" by Eric Auger allows > to passthrough an external PCIe network card on a ThunderX s

Re: [PATCH 1/1] iommu/arm-smmu: Fix for ThunderX erratum #27704

2017-01-13 Thread Robin Murphy
On 13/01/17 10:43, Tomasz Nowicki wrote: > On 12.01.2017 07:41, Tomasz Nowicki wrote: >> On 11.01.2017 13:19, Robin Murphy wrote: >>> On 11/01/17 11:51, Tomasz Nowicki wrote: >>>> The goal of erratum #27704 workaround was to make sure that ASIDs and >>>

Re: [PATCH] iommu/dma: Add support for DMA_ATTR_FORCE_CONTIGUOUS

2017-01-13 Thread Robin Murphy
On 13/01/17 11:07, Geert Uytterhoeven wrote: > Add support for DMA_ATTR_FORCE_CONTIGUOUS to the generic IOMMU DMA code. > This allows to allocate physically contiguous DMA buffers on arm64 > systems with an IOMMU. Can anyone explain what this attribute is actually used for? I've never quite figure

Re: [PATCH] iommu/dma: Add support for DMA_ATTR_FORCE_CONTIGUOUS

2017-01-13 Thread Robin Murphy
On 13/01/17 11:59, Geert Uytterhoeven wrote: > Hi Robin, > > On Fri, Jan 13, 2017 at 12:32 PM, Robin Murphy wrote: >> On 13/01/17 11:07, Geert Uytterhoeven wrote: >>> Add support for DMA_ATTR_FORCE_CONTIGUOUS to the generic IOMMU DMA code. >>> This allows to a

[PATCH] iommu: Handle default domain attach failure

2017-01-16 Thread Robin Murphy
h_device() on the default domain, and refactor the error handling paths to cope with its failure and clean up correctly in such cases. Fixes: e39cb8a3aa98 ("iommu: Make sure a device is always attached to a domain") Reported-by: Punit Agrawal Signed-off-by: Robin Murphy --- dri

[PATCH v2 1/2] iommu/dma: Stop getting dma_32bit_pfn wrong

2017-01-16 Thread Robin Murphy
a subset of the available 64-bit space. Signed-off-by: Robin Murphy --- Sending this as a v2 since both patches have been seen before, and #1 is ever so slightly tweaked. #2 applies on top of Eric's MSI series, since that seems ready to go now - there is a trivial merge conflict otherwise a

[PATCH v2 2/2] iommu/dma: Implement PCI allocation optimisation

2017-01-16 Thread Robin Murphy
first, only falling back to the full mask if that fails. Signed-off-by: Robin Murphy --- drivers/iommu/dma-iommu.c | 21 +++-- 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index 9aa432e8fbd3..8adff5f83b38

Re: [PATCH v2] IOMMU: SMMUv2: Support for Extended Stream ID (16 bit)

2017-01-16 Thread Robin Murphy
.com > > Signed-off-by: Aleksey Makarov > --- > v2: > - remove unnecessary parentheses (Robin Murphy) > - refactor testing SMR fields to after setting sCR0 as theirs width > depends on sCR0_EXIDENABLE (Robin Murphy) > > v1 (rfc): > https://lkml.kernel.org/r/201

Re: [PATCH V5 05/12] drivers: platform: Configure dma operations at probe time

2017-01-19 Thread Robin Murphy
On 19/01/17 15:05, Sricharan R wrote: > Configuring DMA ops at probe time will allow deferring device probe when > the IOMMU isn't available yet. The dma_configure for the device is > now called from the generic device_attach callback just before the > bus/driver probe is called. This way, configur

Re: [PATCH V5 08/12] iommu/arm-smmu: Clean up early-probing workarounds

2017-01-19 Thread Robin Murphy
On 19/01/17 16:50, Lorenzo Pieralisi wrote: > On Thu, Jan 19, 2017 at 08:35:52PM +0530, Sricharan R wrote: >> From: Robin Murphy >> >> Now that the appropriate ordering is enforced via profe-deferral of >> masters in core code, rip it all out and bask in the simplicity.

Re: [PATCH 1/5] iommu/arm-smmu: Restrict domain attributes to UNMANAGED domains

2017-01-19 Thread Robin Murphy
On 19/01/17 18:19, Will Deacon wrote: > The ARM SMMU drivers provide a DOMAIN_ATTR_NESTING domain attribute, > which allows callers of the IOMMU API to request that the page table > for a domain is installed at stage-2, if supported by the hardware. > > Since setting this attribute only makes sens

Re: [PATCH 2/5] iommu/arm-smmu: Install bypass S2CRs for IOMMU_DOMAIN_IDENTITY domains

2017-01-19 Thread Robin Murphy
lly more abundant. Reviewed-by: Robin Murphy > Signed-off-by: Will Deacon > --- > drivers/iommu/arm-smmu.c | 20 +--- > 1 file changed, 17 insertions(+), 3 deletions(-) > > diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c > index a328ffb75509..

Re: [PATCH 3/5] iommu/arm-smmu-v3: Install bypass STEs for IOMMU_DOMAIN_IDENTITY domains

2017-01-19 Thread Robin Murphy
On 19/01/17 18:19, Will Deacon wrote: > In preparation for allowing the default domain type to be overridden, > this patch adds support for IOMMU_DOMAIN_IDENTITY domains to the > ARM SMMUv3 driver. > > An identity domain is created by placing the corresponding stream table > entries into "bypass"

Re: [PATCH 4/5] arm64: dma-mapping: Only swizzle DMA ops for IOMMU_DOMAIN_DMA

2017-01-19 Thread Robin Murphy
traight away. The DMA ops can't be expected to work successfully on any old domain, so it's a reasonable sanity check regardless. Reviewed-by: Robin Murphy > Signed-off-by: Will Deacon > --- > arch/arm64/mm/dma-mapping.c | 17 - > 1 file changed, 12 inser

Re: [PATCH/RFC 1/2] arm64: mm: Silently allow devices lacking IOMMU group

2017-01-23 Thread Robin Murphy
Hi Magnus, On 23/01/17 12:12, Magnus Damm wrote: > From: Magnus Damm > > Consider failure of iommu_get_domain_for_dev() as non-critical and > get rid of the warning printout. This allows IOMMU properties to be > included in the DTB even though the kernel is configured with > CONFIG_IOMMU_API=n o

Re: [PATCH/RFC 2/4] iommu: iova: use __alloc_percpu_gfp() with GFP_NOWAIT in init_iova_rcaches()

2017-01-25 Thread Robin Murphy
On 25/01/17 12:54, Yoshihiro Shimoda wrote: > In the future, the init_iova_rcaches will be called in atomic. That screams "doing the wrong thing". The sole point of the rcaches is to reuse IOVAs, whereas the main point of this series seems to involve not reusing IOVAs. The fact that we have to aff

Re: [PATCH/RFC 1/4] iommu: dma: track mapped iova

2017-01-25 Thread Robin Murphy
On 25/01/17 12:53, Yoshihiro Shimoda wrote: > From: Magnus Damm > > To track mapped iova for a workaround code in the future. > > Signed-off-by: Magnus Damm > Signed-off-by: Yoshihiro Shimoda > --- > drivers/iommu/dma-iommu.c | 29 +++-- > include/linux/iommu.h |

Re: [PATCH/RFC 3/4] iommu: dma: iommu iova domain reset

2017-01-25 Thread Robin Murphy
On 25/01/17 12:54, Yoshihiro Shimoda wrote: > From: Magnus Damm > > To add a workaround code for ipmmu-vmsa driver, this patch adds > a new geometry "force_reset_when_empty" not to reuse iova space. The domain geometry is absolutely not the appropriate place for that. If anything, it could possi

Re: [PATCH 0/2] Fix incorrect warning from dma-debug

2017-01-25 Thread Robin Murphy
On 25/01/17 16:23, Geert Uytterhoeven wrote: > Hi Robin, Hi Geert, > On Mon, May 9, 2016 at 11:37 AM, Robin Murphy wrote: >> On 08/05/16 11:59, Niklas Söderlund wrote: >>> While using CONFIG_DMA_API_DEBUG i came across this warning which I >>> think

Re: [PATCH V7 01/11] iommu/of: Refactor of_iommu_configure() for error handling

2017-01-25 Thread Robin Murphy
Hi Tomasz, On 25/01/17 17:17, Tomasz Nowicki wrote: > Hi Sricharan, > > On 23.01.2017 17:18, Sricharan R wrote: >> From: Robin Murphy >> >> In preparation for some upcoming cleverness, rework the control flow in >> of_iommu_configure() to minimise duplication

Re: [PATCH/RFC] iommu/ipmmu-vmsa: Restrict IOMMU Domain Geometry to 32-bit address space

2017-01-26 Thread Robin Murphy
SYS-DMAC) rightfully configures a 40-bit DMA > mask, it will still be handed out a 40-bit IOVA, outside the 32-bit IOVA > space, leading to out-of-bounds accesses of the PGD when mapping the > IOVA. > > Force a 32-bit IOMMU Domain Geometry to fix this. Reviewed-by: Robin Murphy

Re: [PATCH 5/5] iommu: Allow default domain type to be set on the kernel command line

2017-01-26 Thread Robin Murphy
On 26/01/17 17:15, Joerg Roedel wrote: > On Thu, Jan 19, 2017 at 06:19:15PM +, Will Deacon wrote: >> Rather than modify each IOMMU driver to provide different semantics for >> DMA domains, instead we introduce a command line parameter that can be >> used to change the type of the default domain

[PATCH] iommu: Better document the IOMMU_PRIV flag

2017-01-27 Thread Robin Murphy
This is a fairly subtle thing - let's make sure it's described as clearly as possible to avoid potential misunderstandings. Signed-off-by: Robin Murphy --- Having another look through the IOMMU_PRIV series, I wasn't convinced that the original comment was really all that helpful

Re: [PATCH/RFC] iommu/dma: Per-domain flag to control size-alignment

2017-01-27 Thread Robin Murphy
Hi Magnus, On 27/01/17 06:24, Magnus Damm wrote: > From: Magnus Damm > > Introduce the flag "no_size_align" to allow disabling size-alignment > on a per-domain basis. This follows the suggestion by the comment > in the code, however a per-device control may be preferred? > > Needed to make virt

Re: [PATCH v2 1/2] iommu/dma: Add support for DMA_ATTR_FORCE_CONTIGUOUS

2017-01-27 Thread Robin Murphy
er. > > Signed-off-by: Geert Uytterhoeven > --- > v2: > - Provide standalone iommu_dma_{alloc,free}_contiguous() functions, as > requested by Robin Murphy, > - Simplify operations by getting rid of the page array/scatterlist > dance, as the buffer is contiguous, >

Re: [PATCH V7 01/11] iommu/of: Refactor of_iommu_configure() for error handling

2017-01-27 Thread Robin Murphy
On 27/01/17 18:00, Sricharan wrote: > Hi Robin, > > [..] > +const struct iommu_ops *of_iommu_configure(struct device *dev, + struct device_node *master_np) +{ +const struct iommu_ops *ops; + +if (!master_np) +return NULL; >>

Re: [PATCH/RFC] iommu/dma: Per-domain flag to control size-alignment

2017-01-30 Thread Robin Murphy
On 30/01/17 07:20, Yoshihiro Shimoda wrote: > Hi Robin, Magnus, > >> -Original Message----- >> From: Robin Murphy >> Sent: Saturday, January 28, 2017 2:38 AM >> >> Hi Magnus, >> >> On 27/01/17 06:24, Magnus Damm wrote: >>> From: Magnus

Re: [PATCH V7 08/11] drivers: acpi: Handle IOMMU lookup failure with deferred probing or error

2017-01-30 Thread Robin Murphy
On 29/01/17 17:53, Sinan Kaya wrote: > On 1/24/2017 7:37 AM, Lorenzo Pieralisi wrote: >> [+hanjun, tomasz, sinan] >> >> It is quite a key patchset, I would be glad if they can test on their >> respective platforms with IORT. >> > > Tested on top of 4.10-rc5. > > 1.Platform Hidma device passed

Re: [PATCH V7 01/11] iommu/of: Refactor of_iommu_configure() for error handling

2017-01-30 Thread Robin Murphy
On 30/01/17 07:00, Sricharan wrote: > Hi Robin, > >>> [..] >>> >> +const struct iommu_ops *of_iommu_configure(struct device *dev, >> + struct device_node *master_np) >> +{ >> +const struct iommu_ops *ops; >> + >> +if (!master_np) >> +

[PATCH] iommu/dma: Remove bogus dma_supported() implementation

2017-02-01 Thread Robin Murphy
othing but duplicate the current default behaviour; we already constrain IOVA allocations to the iommu_domain aperture where necessary, so let's leave DMA mask business to architecture-specific code where it belongs. Signed-off-by: Robin Murphy --- Techincally an IOMMU patch, but could possib

Re: [PATCH v3] arm64: Add support for DMA_ATTR_FORCE_CONTIGUOUS to IOMMU

2017-02-02 Thread Robin Murphy
- > v3: > - Add Acked-by, > - Update comment to "one of _4_ things", > - Call dma_alloc_from_contiguous() and iommu_dma_map_page() directly, > as suggested by Robin Murphy, > > v2: > - New, handle dispatching in the arc

Re: [PATCH 1/1] iommu: to avoid an unnecessary assignment

2017-02-03 Thread Robin Murphy
sn't uninitialised, but still directly equivalent to the old one, I don't see an issue with moving the assignemnt there, plus it does avoid a redundant reassignment the first time through. Reviewed-by: Robin Murphy > return 0; > } > EXPORT_SYMBOL_GPL(iommu_fwspe

Re: [PATCH V8 08/11] drivers: acpi: Handle IOMMU lookup failure with deferred probing or error

2017-02-03 Thread Robin Murphy
On 03/02/17 16:15, Sricharan wrote: > Hi Lorenzo, Robin, > >> -Original Message- >> From: linux-arm-kernel [mailto:linux-arm-kernel-boun...@lists.infradead.org] >> On Behalf Of Sricharan R >> Sent: Friday, February 03, 2017 9:19 PM >> To: robin.mur...@arm.com; will.dea...@arm.com; j...@8b

Re: [PATCH V2 1/3] iommu/arm-smmu: Add pm_runtime/sleep ops

2017-02-08 Thread Robin Murphy
On 08/02/17 12:30, Sricharan wrote: > Hi Mark, > >> On Wed, Feb 08, 2017 at 04:23:17PM +0530, Sricharan wrote: On Thu, Feb 02, 2017 at 10:40:18PM +0530, Sricharan R wrote: > +- clock-names:Should be a pair of "smmu_iface_clk" and "smmu_bus_clk" > + required for sm

Re: [PATCH V2 1/3] iommu/arm-smmu: Add pm_runtime/sleep ops

2017-02-08 Thread Robin Murphy
On 08/02/17 13:52, Mark Rutland wrote: > On Wed, Feb 08, 2017 at 07:15:37PM +0530, Sricharan wrote: >>> Clocks are not architectural, so it only makes sense to associate them >>> with an implementation-specific compatible string. There's also no >> >> ok, it for this the QCOM specific implementatio

Re: [PATCH 01/11] iommu: Rename iommu_get_instance()

2017-02-10 Thread Robin Murphy
Hi Joerg, I'm really liking this series! Superficially it doesn't seem to break anything on my Juno, but I'll give it a more thorough workout soon. Just a few comments from skimming through... On 09/02/17 11:32, Joerg Roedel wrote: > From: Joerg Roedel > > Rename the function to iommu_ops_from

Re: [PATCH 06/11] iommu: Add iommu_device_set_fwnode() interface

2017-02-10 Thread Robin Murphy
On 09/02/17 11:32, Joerg Roedel wrote: > From: Joerg Roedel > > Allow to store a fwnode in 'struct iommu_device'; > > Signed-off-by: Joerg Roedel > --- > include/linux/iommu.h | 12 > 1 file changed, 12 insertions(+) > > diff --git a/include/linux/iommu.h b/include/linux/iommu.h

Re: [PATCH 07/11] iommu/arm-smmu: Make use of the iommu_register interface

2017-02-10 Thread Robin Murphy
On 09/02/17 11:32, Joerg Roedel wrote: > From: Joerg Roedel > > Also add the smmu devices to sysfs. > > Signed-off-by: Joerg Roedel > --- > drivers/iommu/arm-smmu-v3.c | 22 +- > drivers/iommu/arm-smmu.c| 30 ++ > 2 files changed, 51 insertio

Re: [PATCH 08/11] iommu/msm: Make use of iommu_device_register interface

2017-02-10 Thread Robin Murphy
On 09/02/17 11:32, Joerg Roedel wrote: > From: Joerg Roedel > > Register the MSM IOMMUs to the iommu core and add sysfs > entries for that driver. > > Signed-off-by: Joerg Roedel > --- > drivers/iommu/msm_iommu.c | 73 > +++ > drivers/iommu/msm_iomm

Re: [PATCH 06/11] iommu: Add iommu_device_set_fwnode() interface

2017-02-10 Thread Robin Murphy
On 10/02/17 15:22, Joerg Roedel wrote: > Hi Robin, > > On Fri, Feb 10, 2017 at 02:16:54PM +0000, Robin Murphy wrote: >>> +static inline void iommu_device_set_fwnode(struct iommu_device *iommu, >>> + struct fwnode_handle *fwnode) &

Re: [PATCH 06/11] iommu: Add iommu_device_set_fwnode() interface

2017-02-10 Thread Robin Murphy
On 10/02/17 16:11, Joerg Roedel wrote: > On Fri, Feb 10, 2017 at 04:03:07PM +0000, Robin Murphy wrote: >> Yeah, on reflection explicit initialisation is certainly easier to read >> than a bunch of arguments handled implicitly by register(), but then >> from that angle, even m

Re: [PATCH 07/11] iommu/arm-smmu: Make use of the iommu_register interface

2017-02-10 Thread Robin Murphy
On 10/02/17 15:25, Joerg Roedel wrote: > On Fri, Feb 10, 2017 at 02:20:34PM +0000, Robin Murphy wrote: >>> @@ -1795,8 +1798,10 @@ static int arm_smmu_add_device(struct device *dev) >>> } >>> >>> group = iommu_group_get_for_dev(dev); >>> -

Re: [PATCH 08/11] iommu/msm: Make use of iommu_device_register interface

2017-02-10 Thread Robin Murphy
On 10/02/17 15:33, Joerg Roedel wrote: > On Fri, Feb 10, 2017 at 02:35:39PM +0000, Robin Murphy wrote: >> On 09/02/17 11:32, Joerg Roedel wrote: >>> + ret = iommu_device_sysfs_add(&iommu->iommu, iommu->dev, NULL, >>> +&quo

Re: RFC on No ACS Support and SMMUv3 Support

2017-02-14 Thread Robin Murphy
On 14/02/17 01:54, Sinan Kaya wrote: > On 2/13/2017 8:46 PM, Alex Williamson wrote: >>> My first goal is to support virtual function passthrough for device's that >>> are directly >>> connected. This will be possible with the quirk I proposed and it will be >>> the most >>> secure solution. It ca

Re: [RFC 2/2] iommu/arm-smmu: support qcom implementation

2017-02-14 Thread Robin Murphy
Hi Rob, On 10/02/17 18:41, Rob Clark wrote: > For devices with iommu(s) in secure mode, we cannot touch global > registers, and we have to live with the context -> sid mapping that > the secure world has set up for us. > > This enables, for example db410c (apq8016) devices to use the up- > stream

Re: [PATCH v4] arm64: Add support for DMA_ATTR_FORCE_CONTIGUOUS to IOMMU

2017-02-17 Thread Robin Murphy
always uses physically contiguous buffers (up to > IO_TLB_SEGSIZE = 128 pages), > - arm64's __dma_alloc_coherent() already calls > dma_alloc_from_contiguous() when CMA is available. I think this looks about as good as it ever could now :) Reviewed-by: Robin Murphy Thanks, Robin

Re: [RFC PATCH v1] iommu/io-pgtable-arm-v7s: Check for leaf entry right after finding it

2017-02-21 Thread Robin Murphy
On 16/02/17 13:52, Oleksandr Tyshchenko wrote: > From: Oleksandr Tyshchenko > > Do a check for already installed leaf entry at the current level before > performing any actions when trying to map. > > This check is already present in arm_v7s_init_pte(), i.e. before > installing new leaf entry at

Re: [bug report] iommu/arm-smmu: Make use of the iommu_register interface

2017-02-22 Thread Robin Murphy
On 22/02/17 11:00, Joerg Roedel wrote: > Hi Dan, > > thanks for the report! There are more bogus things going on here. > > On Wed, Feb 15, 2017 at 11:36:48AM +0300, Dan Carpenter wrote: >> The patch 9648cbc9625b: "iommu/arm-smmu: Make use of the >> iommu_register interface" from Feb 1, 2017, lea

Re: Partial BAR Address Allocation

2017-02-23 Thread Robin Murphy
On 22/02/17 23:39, Bjorn Helgaas wrote: > [+cc Joerg, iommu list] > > On Wed, Feb 22, 2017 at 03:44:53PM -0500, Sinan Kaya wrote: >> On 2/22/2017 1:44 PM, Bjorn Helgaas wrote: >>> There is no way for a driver to say "I only need this memory BAR and >>> not the other ones." The reason is because t

Re: [PATCH] iommu: iova: Consolidate code for adding new node to iovad domain rbtree

2017-02-23 Thread Robin Murphy
On 23/02/17 08:17, Marek Szyprowski wrote: > This patch consolidates almost the same code used in iova_insert_rbtree() > and __alloc_and_insert_iova_range() functions. There is no functional change. > > Signed-off-by: Marek Szyprowski > --- > drivers/iommu/iova.c | 85 > +++-

Re: [PATCH v2] iommu: iova: Consolidate code for adding new node to iovad domain rbtree

2017-02-24 Thread Robin Murphy
ed iova tree or incorrect calls. Thanks Marek! Tested-by: Robin Murphy Reviewed-by: Robin Murphy > Signed-off-by: Marek Szyprowski > --- > v2: > - replaced BUG() with WARN_ON(1) as suggested by Robin Murphy > > v1: > - initial version &

Re: [RFC PATCH] iommu/arm-smmu: Add global SMR masking property

2017-03-02 Thread Robin Murphy
e reminder. I'll send an rc1-based version out next week to reboot the discussion. Robin. > > Thanks, > Nipun > > >> -Original Message- >> From: Nipun Gupta >> Sent: Sunday, December 18, 2016 2:37 >> To: Robin Murphy ; iommu@lists.linux- &

Re: [PATCH] iommu/arm-smmu: Report smmu type in dmesg

2017-03-06 Thread Robin Murphy
On 06/03/17 13:58, Robert Richter wrote: > The ARM SMMU detection especially depends from system firmware. For > better diagnostic, log the detected type in dmesg. This paragraph especially depends from grammar. I think. > The smmu type's name is now stored in struct arm_smmu_type and ACPI > code

Re: [PATCH 5/9] iommu: add qcom_iommu

2017-03-07 Thread Robin Murphy
On 01/03/17 17:42, Rob Clark wrote: > An iommu driver for Qualcomm "B" family devices which do not completely > implement the ARM SMMU spec. Is that actually true, or is it just that it's a compliant SMMU on which firmware has set SCR1.GASRAE? (which makes the global address space secure-access-on

[PATCH 1/4] iommu/arm-smmu: Handle size mismatches better

2017-03-07 Thread Robin Murphy
aving. And at worst, if the firmware is wrong enough to have not mapped something we actually try to use, the resulting out-of-bounds access will hopefully provide a much more obvious clue. Signed-off-by: Robin Murphy --- drivers/iommu/arm-smmu.c | 4 +++- 1 file changed, 3 insertions(+), 1 del

[PATCH 0/4] ARM SMMU per-context TLB sync

2017-03-07 Thread Robin Murphy
s somewhat of a fix in its own right, in that it's really an entirely unrelated thing which came up in parallel, but happens to be inherent to code I'm touching here anyway. Robin. Robin Murphy (4): iommu/arm-smmu: Handle size mismatches better iommu/arm-smmu: Simplify ASID/VMID handl

[PATCH 2/4] iommu/arm-smmu: Simplify ASID/VMID handling

2017-03-07 Thread Robin Murphy
arm_smmu_cfg; let's just precalculate an ASID/VMID, plop it in there, and tidy up the users accordingly. We'd also need something like this anyway if we ever get near to thinking about SVM, so it's no bad thing. Signed-off-by: Robin Murphy --- drivers/iommu/

[PATCH 3/4] iommu/arm-smmu: Tidy up context bank indexing

2017-03-07 Thread Robin Murphy
round so that we just maintain the CB_BASE address directly. Signed-off-by: Robin Murphy --- drivers/iommu/arm-smmu.c | 31 +++ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 0b64852baa6a..c8aafe3

[PATCH 4/4] iommu/arm-smmu: Use per-context TLB sync as appropriate

2017-03-07 Thread Robin Murphy
o the already unwieldy monolithic TLB maintenance ops, break them up into smaller, neater, functions which we can then mix and match as appropriate. Signed-off-by: Robin Murphy --- drivers/iommu/arm-smmu.c | 156 ++- 1 file changed, 100 insertions(+

[PATCH] iommu/arm-smmu: Add global SMR masking property

2017-03-07 Thread Robin Murphy
. for MMU-500 configurations where the appended TBU number gets in the way unnecessarily). Let's add a new property to allow a single global mask value to better fit the latter situation. Tested-by: Nipun Gupta Signed-off-by: Robin Murphy --- Time to rekindle the discussion about wheth

Re: [PATCH] iommu/arm-smmu: Report smmu type in dmesg

2017-03-07 Thread Robin Murphy
On 07/03/17 14:06, Robert Richter wrote: > On 06.03.17 18:22:08, Robin Murphy wrote: >> On 06/03/17 13:58, Robert Richter wrote: >>> The ARM SMMU detection especially depends from system firmware. For >>> better diagnostic, log the detected type in dmesg. >> >

Re: [PATCH v3 01/09] iommu/ipmmu-vmsa: Introduce features, break out alias

2017-03-08 Thread Robin Murphy
Hi Magnus, On 08/03/17 11:01, Magnus Damm wrote: > From: Magnus Damm > > Introduce struct ipmmu_features to track various hardware > and software implementation changes inside the driver for > different kinds of IPMMU hardware. Add use_ns_alias_offset > as a first example of a feature to control

Re: [PATCH v3 03/09] iommu/ipmmu-vmsa: Enable multi context support

2017-03-08 Thread Robin Murphy
On 08/03/17 11:01, Magnus Damm wrote: > From: Magnus Damm > > Add support for up to 8 contexts. Each context is mapped to one > domain. One domain is assigned one or more slave devices. Contexts > are allocated dynamically and slave devices are grouped together > based on which IPMMU device they

Re: [PATCH v3 06/09] iommu/ipmmu-vmsa: Write IMCTR twice

2017-03-08 Thread Robin Murphy
On 08/03/17 11:02, Magnus Damm wrote: > From: Magnus Damm > > Write IMCTR both in the root device and the leaf node. > > Signed-off-by: Magnus Damm > --- > > Changes since V2: > - None > > Changes since V1: > - None > > drivers/iommu/ipmmu-vmsa.c | 17 ++--- > 1 file chang

Re: [PATCH v7 06/07] iommu/ipmmu-vmsa: ARM and ARM64 archdata access

2017-03-08 Thread Robin Murphy
On 07/03/17 03:17, Magnus Damm wrote: > From: Magnus Damm > > Not all architectures have an iommu member in their archdata, so > use #ifdefs support build with COMPILE_TEST on any architecture. I have a feeling I might be repeating myself, but ipmmu_vmsa_archdata looks to be trivially convertibl

Re: [PATCH v7 05/07] iommu/ipmmu-vmsa: Add new IOMMU_DOMAIN_DMA ops

2017-03-08 Thread Robin Murphy
On 07/03/17 03:17, Magnus Damm wrote: > From: Magnus Damm > > Introduce an alternative set of iommu_ops suitable for 64-bit ARM > as well as 32-bit ARM when CONFIG_IOMMU_DMA=y. Also adjust the > Kconfig to depend on ARM or IOMMU_DMA. Initialize the device > from ->xlate() when CONFIG_IOMMU_DMA=y.

Re: [PATCH V8 01/11] iommu/of: Refactor of_iommu_configure() for error handling

2017-03-08 Thread Robin Murphy
On 08/03/17 18:58, Jean-Philippe Brucker wrote: [...] >> static const struct iommu_ops >> -*of_pci_iommu_configure(struct pci_dev *pdev, struct device_node *bridge_np) >> +*of_pci_iommu_init(struct pci_dev *pdev, struct device_node *bridge_np) >> { >> const struct iommu_ops *ops; >> str

Re: [PATCH V8 01/11] iommu/of: Refactor of_iommu_configure() for error handling

2017-03-09 Thread Robin Murphy
On 09/03/17 09:52, sricharan wrote: > Hi Robin, > >> On 08/03/17 18:58, Jean-Philippe Brucker wrote: >> [...] static const struct iommu_ops -*of_pci_iommu_configure(struct pci_dev *pdev, struct device_node *bridge_np) +*of_pci_iommu_init(struct pci_dev *pdev, struct device_nod

Re: [PATCH v7 06/07] iommu/ipmmu-vmsa: ARM and ARM64 archdata access

2017-03-09 Thread Robin Murphy
On 09/03/17 03:44, Magnus Damm wrote: > Hi Robin, > > On Wed, Mar 8, 2017 at 9:48 PM, Robin Murphy wrote: >> On 07/03/17 03:17, Magnus Damm wrote: >>> From: Magnus Damm >>> >>> Not all architectures have an iommu member in their archdata, so >>

Re: [PATCH] iommu/arm-smmu: Report smmu type in dmesg

2017-03-09 Thread Robin Murphy
On 09/03/17 12:02, Robert Richter wrote: > On 07.03.17 18:41:33, Robin Murphy wrote: >> On 07/03/17 14:06, Robert Richter wrote: >>> On 06.03.17 18:22:08, Robin Murphy wrote: >>>> On 06/03/17 13:58, Robert Richter wrote: >>>>> The ARM SMMU detection

[PATCH 1/3] iommu: Disambiguate MSI region types

2017-03-09 Thread Robin Murphy
iommu-dma). Fixes: d30ddcaa7b02 ("iommu: Add a new type field in iommu_resv_region") CC: Eric Auger CC: Alex Williamson CC: David Woodhouse CC: k...@vger.kernel.org Signed-off-by: Robin Murphy --- drivers/iommu/amd_iommu.c | 2 +- drivers/iommu/arm-smmu-v3.c | 2 +- dr

  1   2   3   4   5   6   7   8   9   10   >