Re: [PATCH 2/2] iommu/arm-smmu: Add support for non-coherent page table mappings

2019-01-19 Thread Will Deacon
On Thu, Jan 17, 2019 at 02:57:18PM +0530, Vivek Gautam wrote: > Adding a device tree option for arm smmu to enable non-cacheable > memory for page tables. > We already enable a smmu feature for coherent walk based on > whether the smmu device is dma-coherent or not. Have an option > to enable

Re: [PATCH v6 2/3] iommu/io-pgtable-arm-v7s: Request DMA32 memory, and improve debugging

2019-01-19 Thread Will Deacon
On Mon, Dec 10, 2018 at 09:15:03AM +0800, Nicolas Boichat wrote: > IOMMUs using ARMv7 short-descriptor format require page tables > (level 1 and 2) to be allocated within the first 4GB of RAM, even > on 64-bit systems. > > For level 1/2 pages, ensure GFP_DMA32 is used if CONFIG_ZONE_DMA32 > is

Re: [PATCH] iommu/vt-d: Implement dma_[un]map_resource()

2019-01-19 Thread Logan Gunthorpe
On 2019-01-19 2:40 a.m., Christoph Hellwig wrote: > Which resources do you plan to map? At least for PCIe P2P adding > an address translation seems wrong to me. It's mapping a PCI BAR but not for PCIe P2P. In this case, we are using the Intel I/OAT DMA engine to copy data from a PCI BAR

[PATCH] iommu/amd: unmap all mapped pages in error path of map_sg

2019-01-19 Thread Jerry Snitselaar
In the error path of map_sg there is an incorrect if condition for breaking out of the loop that searches the scatterlist for mapped pages to unmap. Instead of breaking out of the loop once all the pages that were mapped have been unmapped, it will break out of the loop after it has unmapped 1

Re: [PATCH] iommu: amd: call free_iova_fast with pfn in map_sg

2019-01-19 Thread Jerry Snitselaar
On Thu Jan 17 19, Jerry Snitselaar wrote: In the error path of map_sg, free_iova_fast is being called with address instead of the pfn. This results in a bad value getting into the rcache, and can result in hitting a BUG_ON when iova_magazine_free_pfns is called. Cc: Joerg Roedel Cc: Suravee

Re: use generic DMA mapping code in powerpc V4

2019-01-19 Thread Christoph Hellwig
On Sat, Jan 19, 2019 at 02:02:22PM +0100, Christoph Hellwig wrote: > Interesting. This suggest it is related to the use of ZONE_DMA by > the FSL SOCs that your board uses. Let me investigate this a bit more. As a hack to check that theory I've pushed a new commit to the powerpc-dma.6-debug

Re: use generic DMA mapping code in powerpc V4

2019-01-19 Thread Christoph Hellwig
On Sat, Jan 19, 2019 at 12:52:52PM +0100, Christian Zigotzky wrote: > Hi Christoph, > > I have found a small workaround. If I add 'mem=3500M' to the boot arguments > then it detects the SATA hard disk and boots without any problems. > > X5000> setenv bootargs root=/dev/sda2 console=ttyS0,115200

Re: use generic DMA mapping code in powerpc V4

2019-01-19 Thread Christian Zigotzky
Hi Christoph, I have found a small workaround. If I add 'mem=3500M' to the boot arguments then it detects the SATA hard disk and boots without any problems. X5000> setenv bootargs root=/dev/sda2 console=ttyS0,115200 mem=3500M Cheers, Christian On 19 January 2019 at 12:40PM, Christian

Re: use generic DMA mapping code in powerpc V4

2019-01-19 Thread Christian Zigotzky
Hi Christoph, I bought a USB null modem RS-232 serial cable today so I was able to get some SATA error messages. Error messages: [   13.468538] fsl-sata ffe22.sata: Sata FSL Platform/CSB Driver init [   13.475106] fsl-sata ffe22.sata: failed to start port 0 (errno=-12) [   13.481736]

Re: [PATCH] arm64/xen: fix xen-swiotlb cache flushing

2019-01-19 Thread Christoph Hellwig
[full quote deleted, please take a little more care when quoting] On Fri, Jan 18, 2019 at 04:44:23PM -0800, Stefano Stabellini wrote: > > #ifdef CONFIG_XEN > > - if (xen_initial_domain()) { > > - dev->archdata.dev_dma_ops = dev->dma_ops; > > + if (xen_initial_domain()) > >

Re: [PATCH] iommu/vt-d: Implement dma_[un]map_resource()

2019-01-19 Thread Christoph Hellwig
On Fri, Jan 18, 2019 at 05:05:59PM -0700, Logan Gunthorpe wrote: > However, this doesn't create the IOVA entries necessary for addresses > mapped this way to work when the IOMMU is enabled. Thus, when the > IOMMU is enabled, drivers relying on dma_map_resource() will trigger > DMAR errors. We see