Re: [PATCH v5 01/23] iommu: introduce bind_pasid_table API function

2018-08-27 Thread Jacob Pan
On Fri, 24 Aug 2018 17:00:51 +0200 Auger Eric wrote: > Hi Jacob, > > On 05/11/2018 10:53 PM, Jacob Pan wrote: > > Virtual IOMMU was proposed to support Shared Virtual Memory (SVM) > > use in the guest: > > https://lists.gnu.org/archive/html/qemu-devel/2016-11/msg05311.html > > > > As part of

Re: new SBus related DMA warnings in 4.18+git

2018-08-27 Thread David Miller
From: Sam Ravnborg Date: Mon, 27 Aug 2018 21:15:18 +0200 > Why not fix the drivers rather than papering over the fact > that they are missing the DMA mask? > > We are in the lucky situation the Meelis can test any patches. SBUS drivers never set the mask because they never needed to and could

Re: new SBus related DMA warnings in 4.18+git

2018-08-27 Thread Sam Ravnborg
Hi Christoph. On Mon, Aug 27, 2018 at 05:47:16PM +0200, Christoph Hellwig wrote: > On Sun, Aug 26, 2018 at 10:48:44AM +0300, Meelis Roos wrote: > > Tried yesterdays git 4.18.0-12789-gaa5b105 on a Sun Ultra 1 with SBus > > and several SBus connected devicess give DMA mapping related warnings: >

Re: new SBus related DMA warnings in 4.18+git

2018-08-27 Thread Meelis Roos
> On Sun, Aug 26, 2018 at 10:48:44AM +0300, Meelis Roos wrote: > > Tried yesterdays git 4.18.0-12789-gaa5b105 on a Sun Ultra 1 with SBus > > and several SBus connected devicess give DMA mapping related warnings: > > This should have been around since the warning was added. > > The patch below

Re: swiotlb cleanup (resend)

2018-08-27 Thread Konrad Rzeszutek Wilk
On Mon, Aug 27, 2018 at 08:33:08PM +0200, Christoph Hellwig wrote: > On Mon, Aug 27, 2018 at 02:13:11PM -0400, Konrad Rzeszutek Wilk wrote: > > On Wed, Jul 25, 2018 at 01:37:56PM +0200, Christoph Hellwig wrote: > > > Hi Konrad, > > > > > > below are a few swiotlb patches. Mostly just cleanups,

Re: swiotlb cleanup (resend)

2018-08-27 Thread Christoph Hellwig
On Mon, Aug 27, 2018 at 02:13:11PM -0400, Konrad Rzeszutek Wilk wrote: > On Wed, Jul 25, 2018 at 01:37:56PM +0200, Christoph Hellwig wrote: > > Hi Konrad, > > > > below are a few swiotlb patches. Mostly just cleanups, but the removal > > of the panic option is an actual change in (rarely used)

Re: [RFC PATCH 11/11] powerpc/svm: Increase SWIOTLB buffer size

2018-08-27 Thread Konrad Rzeszutek Wilk
On Fri, Aug 24, 2018 at 01:25:35PM -0300, Thiago Jung Bauermann wrote: > From: Anshuman Khandual > > SWIOTLB buffer default size (64MB) is not enough for large sequential write > operations which eventually leads to kernel crash like here. > > virtio-pci :00:05.0: swiotlb buffer is full

Re: swiotlb cleanup (resend)

2018-08-27 Thread Konrad Rzeszutek Wilk
On Wed, Jul 25, 2018 at 01:37:56PM +0200, Christoph Hellwig wrote: > Hi Konrad, > > below are a few swiotlb patches. Mostly just cleanups, but the removal > of the panic option is an actual change in (rarely used) functionality. > > I'd be happy to pick them up through the dma-mapping tree if

Re: [PATCH 05/20] swiotlb: allow the architecture to provide a get_required_mask hook

2018-08-27 Thread Konrad Rzeszutek Wilk
On Mon, Jul 30, 2018 at 06:38:09PM +0200, Christoph Hellwig wrote: > For now this allows consolidating the powerpc code. In the long run > we should grow a generic implementation of dma_get_required_mask that > returns the dma mask required to avoid bounce buffering. > > Signed-off-by: Christoph

Re: new SBus related DMA warnings in 4.18+git

2018-08-27 Thread Christoph Hellwig
On Sun, Aug 26, 2018 at 10:48:44AM +0300, Meelis Roos wrote: > Tried yesterdays git 4.18.0-12789-gaa5b105 on a Sun Ultra 1 with SBus > and several SBus connected devicess give DMA mapping related warnings: This should have been around since the warning was added. The patch below should fix it:

[PATCH 5/5] dma-mapping: support non-coherent devices in dma_common_get_sgtable

2018-08-27 Thread Christoph Hellwig
We can use the arch_dma_coherent_to_pfn hook to provide a ->get_sgtable implementation. Note that this isn't an endorsement of this interface (which is a horrible bad idea), but it is required to move arm64 over to the generic code without a loss of functionality. Signed-off-by: Christoph

[PATCH 4/5] dma-mapping: consolidate the dma mmap implementations

2018-08-27 Thread Christoph Hellwig
The only functional differences (modulo a few missing fixes in the arch code) is that architectures without coherent caches need a hook to convert a virtual or dma address into a pfn, given that we don't have the kernel linear mapping available for the otherwise easy virt_to_page call. As a side

[PATCH 2/5] dma-mapping: move the dma_coherent flag to struct device

2018-08-27 Thread Christoph Hellwig
Various architectures support both coherent and non-coherent dma on a per-device basis. Move the dma_noncoherent flag from mips the mips archdata field to struct device proper to prepare the infrastructure for reuse on other architectures. Signed-off-by: Christoph Hellwig --- arch/mips/Kconfig

[PATCH 1/5] MIPS: don't select DMA_MAYBE_COHERENT from DMA_PERDEV_COHERENT

2018-08-27 Thread Christoph Hellwig
While both option select a form of conditional dma coherence they don't actually share any code in the implementation, so untangle them. Signed-off-by: Christoph Hellwig --- arch/mips/Kconfig| 2 +- arch/mips/kernel/setup.c | 2 +- arch/mips/mm/c-r4k.c | 17 - 3

[no subject]

2018-08-27 Thread Christoph Hellwig
Subject: [RFC] merge dma_direct_ops and dma_noncoherent_ops While most architectures are either always or never dma coherent for a given build, the arm, arm64, mips and soon arc architectures can have different dma coherent settings on a per-device basis. Additionally some mips builds can decide

Re: [PATCH v1] iommu/ipmmu-vmsa: Don't register as BUS IOMMU if machine doesn't have IPMMU-VMSA

2018-08-27 Thread Geert Uytterhoeven
Hi Laurent, On Fri, Jul 27, 2018 at 11:09 AM Laurent Pinchart wrote: > (CC'ing Geert and Magnus) > > Thank you for the patch. > > On Friday, 27 July 2018 00:19:16 EEST Dmitry Osipenko wrote: > > This fixes kernel crashing on NVIDIA Tegra if kernel is compiled in > > a multiplatform configuration

Re: [PATCH v2 1/2] iommu/ipmmu-vmsa: Hook up R8A774A1 DT maching code

2018-08-27 Thread Simon Horman
On Thu, Aug 23, 2018 at 04:33:04PM +0100, Fabrizio Castro wrote: > Add support for RZ/G2M (R8A774A1) SoC IPMMUs. > > Signed-off-by: Fabrizio Castro > Reviewed-by: Biju Das > --- > v1-v2: > * taken out IOMMU_OF_DECLARE Reviewed-by: Simon Horman ___

Re: [PATCH v2 3/3] dts: arm64/sdm845: Add node for qcom,smmu-v2

2018-08-27 Thread Vivek Gautam
On 8/27/2018 2:26 PM, Vivek Gautam wrote: Hi Rob, Robin, On 8/15/2018 4:27 AM, Rob Herring wrote: On Wed, Aug 15, 2018 at 01:09:43AM +0530, Vivek Gautam wrote: Adding Jordan here. On Tue, Aug 14, 2018 at 4:19 PM, Robin Murphy wrote: Hi Vivek, On 14/08/18 11:27, Vivek Gautam wrote:

Re: [PATCH] iommu/rockchip: Free irqs in shutdown handler

2018-08-27 Thread Enric Balletbo Serra
Heiko, Thanks for the patch Missatge de Heiko Stuebner del dia dl., 27 d’ag. 2018 a les 12:57: > > In the iommu's shutdown handler we disable runtime-pm which could > result in the irq-handler running unclocked and since commit > 3fc7c5c0cff3 ("iommu/rockchip: Handle errors returned from PM

[Patch v15 5/5] iommu/arm-smmu: Add support for qcom,smmu-v2 variant

2018-08-27 Thread Vivek Gautam
qcom,smmu-v2 is an arm,smmu-v2 implementation with specific clock and power requirements. On msm8996, multiple cores, viz. mdss, video, etc. use this smmu. On sdm845, this smmu is used with gpu. Add bindings for the same. Signed-off-by: Vivek Gautam Reviewed-by: Rob Herring Reviewed-by: Tomasz

[Patch v15 4/5] dt-bindings: arm-smmu: Add bindings for qcom,smmu-v2

2018-08-27 Thread Vivek Gautam
Add bindings doc for Qcom's smmu-v2 implementation. Signed-off-by: Vivek Gautam Reviewed-by: Tomasz Figa Tested-by: Srinivas Kandagatla --- Changes since v14: - This is a new patch added in v15 after noticing the new checkpatch warning for separate dt-bindings doc. - This patch also

[Patch v15 2/5] iommu/arm-smmu: Invoke pm_runtime during probe, add/remove device

2018-08-27 Thread Vivek Gautam
From: Sricharan R The smmu device probe/remove and add/remove master device callbacks gets called when the smmu is not linked to its master, that is without the context of the master device. So calling runtime apis in those places separately. Signed-off-by: Sricharan R [vivek: Cleanup pm

[Patch v15 3/5] iommu/arm-smmu: Add the device_link between masters and smmu

2018-08-27 Thread Vivek Gautam
From: Sricharan R Finally add the device link between the master device and smmu, so that the smmu gets runtime enabled/disabled only when the master needs it. This is done from add_device callback which gets called once when the master is added to the smmu. Signed-off-by: Sricharan R

[Patch v15 1/5] iommu/arm-smmu: Add pm_runtime/sleep ops

2018-08-27 Thread Vivek Gautam
From: Sricharan R The smmu needs to be functional only when the respective master's using it are active. The device_link feature helps to track such functional dependencies, so that the iommu gets powered when the master device enables itself using pm_runtime. So by adapting the smmu driver for

[Patch v15 0/5] iommu/arm-smmu: Add runtime pm/sleep support

2018-08-27 Thread Vivek Gautam
This series provides the support for turning on the arm-smmu's clocks/power domains using runtime pm. This is done using device links between smmu and client devices. The device link framework keeps the two devices in correct order for power-cycling across runtime PM or across system-wide PM.

[PATCH] iommu/rockchip: Free irqs in shutdown handler

2018-08-27 Thread Heiko Stuebner
In the iommu's shutdown handler we disable runtime-pm which could result in the irq-handler running unclocked and since commit 3fc7c5c0cff3 ("iommu/rockchip: Handle errors returned from PM framework") we warn about that fact. This can cause warnings on shutdown on some Rockchip machines, so

Re: [PATCH 16/20] powerpc/dma: use dma_direct_{alloc,free}

2018-08-27 Thread Scott Wood
On Thu, 2018-08-09 at 10:52 +1000, Benjamin Herrenschmidt wrote: > On Mon, 2018-07-30 at 18:38 +0200, Christoph Hellwig wrote: > > These do the same functionality as the existing helpers, but do it > > simpler, and also allow the (optional) use of CMA. > > > > Note that the swiotlb code now calls

Re: [PATCH v2 3/3] dts: arm64/sdm845: Add node for qcom,smmu-v2

2018-08-27 Thread Vivek Gautam
Hi Rob, Robin, On 8/15/2018 4:27 AM, Rob Herring wrote: On Wed, Aug 15, 2018 at 01:09:43AM +0530, Vivek Gautam wrote: Adding Jordan here. On Tue, Aug 14, 2018 at 4:19 PM, Robin Murphy wrote: Hi Vivek, On 14/08/18 11:27, Vivek Gautam wrote: Add device node for qcom,smmu-v2 available on

[PATCH 4/4] dma-mapping: clear dev->dma_ops in arch_teardown_dma_ops

2018-08-27 Thread Christoph Hellwig
There is no reason to leave the per-device dma_ops around when deconfiguring a device, so move this code from arm64 into the common code. Signed-off-by: Christoph Hellwig --- arch/arm64/include/asm/dma-mapping.h | 5 - arch/arm64/mm/dma-mapping.c | 5 -

[PATCH 2/4] dma-mapping: remove dma_configure

2018-08-27 Thread Christoph Hellwig
There is no good reason for this indirection given that the method always exists. Signed-off-by: Christoph Hellwig --- drivers/base/dd.c | 8 +--- include/linux/dma-mapping.h | 6 -- kernel/dma/mapping.c| 10 -- 3 files changed, 5 insertions(+), 19

[PATCH 3/4] dma-mapping: remove dma_deconfigure

2018-08-27 Thread Christoph Hellwig
This goes through a lot of hooks just to call arch_teardown_dma_ops. Replace it with a direct call instead. Signed-off-by: Christoph Hellwig --- drivers/acpi/arm64/iort.c | 2 +- drivers/acpi/scan.c | 10 -- drivers/base/dd.c | 4 ++-- drivers/of/device.c |

[PATCH 1/4] arm-nommu: don't define arch_teardown_dma_ops

2018-08-27 Thread Christoph Hellwig
We can just use the default implementation. Signed-off-by: Christoph Hellwig --- arch/arm/include/asm/dma-mapping.h | 2 ++ arch/arm/mm/dma-mapping-nommu.c| 4 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/arm/include/asm/dma-mapping.h

cleanup ->dma_configure calling conventions

2018-08-27 Thread Christoph Hellwig
Hi all, this series cleans up a bit how we call ->dma_configure and how we clean up after tearing down a device that the method did set up. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH 1/3] hexagon: remove the sync_single_for_cpu DMA operation

2018-08-27 Thread Christoph Hellwig
Given that it didn't make 4.19-rc1, I'll pull this into the dma-mapping tree first thing for 4.20 as I have some other changes that will go on top of it. ___ iommu mailing list iommu@lists.linux-foundation.org

Re: [PATCH v5 3/5] iommu/io-pgtable-arm: add support for non-strict mode

2018-08-27 Thread Leizhen (ThunderTown)
On 2018/8/23 1:52, Robin Murphy wrote: > On 15/08/18 02:28, Zhen Lei wrote: >> To support the non-strict mode, now we only tlbi and sync for the strict >> mode. But for the non-leaf case, always follow strict mode. >> >> Signed-off-by: Zhen Lei >> --- >> drivers/iommu/io-pgtable-arm.c | 20

Re: [PATCH v2 13/40] vfio: Add support for Shared Virtual Addressing

2018-08-27 Thread Xu Zaibo
Hi Jean, On 2018/5/12 3:06, Jean-Philippe Brucker wrote: diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h index 1aa7b82e8169..dc07752c8fe8 100644 --- a/include/uapi/linux/vfio.h +++ b/include/uapi/linux/vfio.h @@ -665,6 +665,82 @@ struct vfio_iommu_type1_dma_unmap { #define

Re: [PATCH] Changing the AMD IOMMU API path to work in an atomic context which is necessary for any custom drivers using the IOMMU API while holding a spinlock.

2018-08-27 Thread Christoph Hellwig
On Fri, Aug 24, 2018 at 11:55:53PM +0100, Tom Murphy wrote: > We were going to do this by using the iommu-dma api and replacing all the > existing calls to the DMA api functions in the amd driver with their > iommu-dma equivalent like in this driver: >

Re: [PATCH v5 5/5] iommu/arm-smmu-v3: add bootup option "iommu.non_strict"

2018-08-27 Thread Leizhen (ThunderTown)
On 2018/8/23 1:02, Robin Murphy wrote: > On 15/08/18 02:28, Zhen Lei wrote: >> Add a bootup option to make the system manager can choose which mode to >> be used. The default mode is strict. >> >> Signed-off-by: Zhen Lei >> --- >> Documentation/admin-guide/kernel-parameters.txt | 13

Re: [PATCH] Changing the AMD IOMMU API path to work in an atomic context which is necessary for any custom drivers using the IOMMU API while holding a spinlock.

2018-08-27 Thread Christoph Hellwig
On Fri, Aug 24, 2018 at 04:24:49PM +0100, Robin Murphy wrote: > Although IIRC the AMD driver is in fact the only one whose map/unmap > callbacks aren't already spinlock-safe (or at least it was last time I was > looking). Stuff like iommu-dma is already relying on this in order to > implement

Re: [PATCH v9 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU

2018-08-27 Thread Geert Uytterhoeven
Hi Gary, On Tue, Jun 12, 2018 at 11:42 PM Gary R Hook wrote: > Implement a skeleton framework for debugfs support in the AMD > IOMMU. Add an AMD-specific Kconfig boolean that depends upon > general enablement of DebugFS in the IOMMU. > > Signed-off-by: Gary R Hook This is now commit