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

2017-01-25 Thread Magnus Damm
Hi Robin, Shimoda-san, everyone, Thanks for your feedback! On Thu, Jan 26, 2017 at 1:38 AM, Robin Murphy wrote: > 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

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

2017-01-25 Thread Magnus Damm
Hi Robin, Shimoda-san, everyone, On Thu, Jan 26, 2017 at 1:27 AM, Robin Murphy wrote: > 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 >> --- >

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

2017-01-25 Thread Geert Uytterhoeven
Hi Robin, On Wed, Jan 25, 2017 at 6:27 PM, Robin Murphy wrote: > On 25/01/17 16:23, Geert Uytterhoeven wrote: >> 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 Tomasz Nowicki
Hi Robin, On 25.01.2017 18:35, Robin Murphy wrote: 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 duplicati

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 and improve the propogation >> of er

Re: [PATCH V7 10/11] iommu/arm-smmu: Clean up early-probing workarounds

2017-01-25 Thread Tomasz Nowicki
On 23.01.2017 17:18, 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. Acked-by: Will Deacon Signed-off-by: Robin Murphy [Sricharan: Rebased on top of ACPI IORT SMMU serie

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 is a false positive. As shown dma_sync_single_

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

2017-01-25 Thread Tomasz Nowicki
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 and improve the propogation of errors. It's also as good a time as any to switch over from the now-just-

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/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 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 0/2] Fix incorrect warning from dma-debug

2017-01-25 Thread Geert Uytterhoeven
Hi Robin, 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 is a false positive. As shown dma_sync_single_for_device() are >> called from the dma_map_single() call path.

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

2017-01-25 Thread Yoshihiro Shimoda
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. When all pfns happen to get unmapped then ask the IOMMU driver to flush the state followed by starting from an empty iova space. Signed-off-by: Magnu

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

2017-01-25 Thread Yoshihiro Shimoda
In the future, the init_iova_rcaches will be called in atomic. Signed-off-by: Yoshihiro Shimoda --- drivers/iommu/iova.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/iova.c b/drivers/iommu/iova.c index b7268a1..866ad65 100644 --- a/drivers/iommu/iova.c +++

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

2017-01-25 Thread Yoshihiro Shimoda
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 | 2 ++ 2 files changed, 25 insertions(+), 6 deletions(-) diff

[PATCH/RFC 4/4] iommu: ipmmu-vmsa: enable force_reset_when_empty

2017-01-25 Thread Yoshihiro Shimoda
The IPMMU of R-Car Gen3 will mistake an address translation if IMCTR.FLUSH is set while some related devices that on the same doamin are running. To avoid this, this patch uses the force_reset_when_empty feature. Signed-off-by: Yoshihiro Shimoda --- drivers/iommu/ipmmu-vmsa.c | 16 ++

[PATCH/RFC 0/4] iommu: add workaround for R-Car Gen3 IPMMU

2017-01-25 Thread Yoshihiro Shimoda
This patch set is based on: iommu.git / next branch and the following patch that Magnus-san sent: [patch v6 00/07] iommu/ipmmu-vmsa: ipmmu multi-arch update v6 R-Car Gen3 IPMMU has an issue that will mistake an address translation if IMCTR.FLUSH is set while some related devices that on the same

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

2017-01-25 Thread Magnus Damm
Hi Robin, On Mon, Jan 23, 2017 at 9:34 PM, Robin Murphy wrote: > 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 i

Re: [PATCH v8 9/9] perf/amd/iommu: Enable support for multiple IOMMUs

2017-01-25 Thread Borislav Petkov
On Wed, Jan 25, 2017 at 10:46:53AM +0100, Peter Zijlstra wrote: > Which is absolutely insane. Right, IMO, the simplest thing to do for your purposes is to embed a struct amd_iommu pointer into struct perf_amd_iommu at init time so that you don't have to do all that crazy dance in the PMU function

Re: [PATCH v8 9/9] perf/amd/iommu: Enable support for multiple IOMMUs

2017-01-25 Thread Peter Zijlstra
On Mon, Jan 16, 2017 at 01:23:36AM -0600, Suravee Suthikulpanit wrote: > + pi = container_of(event->pmu, struct perf_amd_iommu, pmu); > + hwc->idx = pi->idx; > + hwc->config = event->attr.config; > + hwc->extra_reg.config = event->attr.config1; > static voi