Re: [PATCH v3 1/4] iommu: Add gfp parameter to iommu_ops::map

2019-06-04 Thread Christoph Hellwig
On Mon, May 06, 2019 at 07:52:03PM +0100, Tom Murphy via iommu wrote: > We can remove the mutex lock from amd_iommu_map and amd_iommu_unmap. > iommu_map doesn’t lock while mapping and so no two calls should touch > the same iova range. The AMD driver already handles the page table page >

Re: [PATCH] iommu: io-pgtable: Support non-coherent page tables

2019-06-04 Thread Bjorn Andersson
On Wed 15 May 23:47 PDT 2019, Vivek Gautam wrote: > On Thu, May 16, 2019 at 5:03 AM Bjorn Andersson > wrote: > > > > Describe the memory related to page table walks as non-cachable for iommu > > instances that are not DMA coherent. > > > > Signed-off-by: Bjorn Andersson > > --- > >

Re: [PATCH v3 1/4] iommu: Add gfp parameter to iommu_ops::map

2019-06-04 Thread Rob Clark
On Tue, Jun 4, 2019 at 11:11 AM Robin Murphy wrote: > > On 06/05/2019 19:52, Tom Murphy wrote: > > Add a gfp_t parameter to the iommu_ops::map function. > > Remove the needless locking in the AMD iommu driver. > > > > The iommu_ops::map function (or the iommu_map function which calls it) > > was

Re: [PATCH v3 1/4] iommu: Add gfp parameter to iommu_ops::map

2019-06-04 Thread Tom Murphy
On Tue, Jun 4, 2019 at 7:11 PM Robin Murphy wrote: > > On 06/05/2019 19:52, Tom Murphy wrote: > > Add a gfp_t parameter to the iommu_ops::map function. > > Remove the needless locking in the AMD iommu driver. > > > > The iommu_ops::map function (or the iommu_map function which calls it) > > was

Re: [PATCH v3 1/4] iommu: Add gfp parameter to iommu_ops::map

2019-06-04 Thread Robin Murphy
On 06/05/2019 19:52, Tom Murphy wrote: Add a gfp_t parameter to the iommu_ops::map function. Remove the needless locking in the AMD iommu driver. The iommu_ops::map function (or the iommu_map function which calls it) was always supposed to be sleepable (according to Joerg's comment in this

Re: [PATCH v8 28/29] vfio-pci: Add VFIO_PCI_DMA_FAULT_IRQ_INDEX

2019-06-04 Thread Auger Eric
Hi Alex, On 6/4/19 12:31 AM, Alex Williamson wrote: > On Sun, 26 May 2019 18:10:03 +0200 > Eric Auger wrote: > >> Add a new VFIO_PCI_DMA_FAULT_IRQ_INDEX index. This allows to >> set/unset an eventfd that will be triggered when DMA translation >> faults are detected at physical level when the

Re: [PATCH v8 26/29] vfio-pci: Register an iommu fault handler

2019-06-04 Thread Auger Eric
Hi Alex, On 6/4/19 12:31 AM, Alex Williamson wrote: > On Sun, 26 May 2019 18:10:01 +0200 > Eric Auger wrote: > >> This patch registers a fault handler which records faults in >> a circular buffer and then signals an eventfd. This buffer is >> exposed within the fault region. >> >>

Re: [PATCH v8 05/29] iommu: Add a timeout parameter for PRQ response

2019-06-04 Thread Jacob Pan
On Tue, 4 Jun 2019 11:52:18 +0100 Jean-Philippe Brucker wrote: > On 03/06/2019 23:32, Alex Williamson wrote: > > It doesn't seem to make much sense to include this patch without > > also including "iommu: handle page response timeout". Was that one > > lost? Dropped? Lives elsewhere? > >

Re: [PATCH v8 04/29] iommu: Add recoverable fault reporting

2019-06-04 Thread Jacob Pan
On Mon, 3 Jun 2019 16:31:45 -0600 Alex Williamson wrote: > On Sun, 26 May 2019 18:09:39 +0200 > Eric Auger wrote: > > > From: Jean-Philippe Brucker > > > > Some IOMMU hardware features, for example PCI's PRI and Arm SMMU's > > Stall, enable recoverable I/O page faults. Allow IOMMU drivers to

Re: [PATCH 07/26] iommu/dma: move the arm64 wrappers to common code

2019-06-04 Thread Jon Hunter
On 04/06/2019 07:05, Christoph Hellwig wrote: > On Mon, Jun 03, 2019 at 08:47:57PM +0100, Jon Hunter wrote: >> Since next-20190529 one of our tests for MMC has started failing, where >> the symptom is that the data written to the MMC does not match the >> source. Bisecting this is pointing to

Re: [PATCH v8 05/29] iommu: Add a timeout parameter for PRQ response

2019-06-04 Thread Jean-Philippe Brucker
On 03/06/2019 23:32, Alex Williamson wrote: > It doesn't seem to make much sense to include this patch without also > including "iommu: handle page response timeout". Was that one lost? > Dropped? Lives elsewhere? The first 7 patches come from my sva/api branch, where I had forgotten to add the

Re: [PATCH v4 7/9] iommu/vt-d: Add trace events for domain map/unmap

2019-06-04 Thread Steven Rostedt
On Mon, 3 Jun 2019 09:16:18 +0800 Lu Baolu wrote: > +TRACE_EVENT(bounce_unmap_single, > + TP_PROTO(struct device *dev, dma_addr_t dev_addr, size_t size), > + > + TP_ARGS(dev, dev_addr, size), > + > + TP_STRUCT__entry( > + __string(dev_name, dev_name(dev)) > +

[PATCH 1/3] vmalloc: lift the arm flag for coherent mappings to common code

2019-06-04 Thread Christoph Hellwig
The arm architecture had a VM_ARM_DMA_CONSISTENT flag to mark DMA coherent remapping for a while. Lift this flag to common code so that we can use it generically. We also check it in the only place VM_USERMAP is directly check so that we can entirely replace that flag as well (although I'm not

[PATCH 3/3] dma-mapping: introduce a dma_common_find_pages helper

2019-06-04 Thread Christoph Hellwig
A helper to find the backing page array based on a virtual address. This also ensures we do the same vm_flags check everywhere instead of slightly different or missing ones in a few places. Signed-off-by: Christoph Hellwig --- arch/arm/mm/dma-mapping.c | 7 +-- drivers/iommu/dma-iommu.c

[PATCH 2/3] dma-mapping: always use VM_DMA_COHERENT for generic DMA remap

2019-06-04 Thread Christoph Hellwig
Currently the generic dma remap allocator gets a vm_flags passed by the caller that is a little confusing. We just introduced a generic vmalloc-level flag to identify the dma coherent allocations, so use that everywhere and remove the now pointless argument. Signed-off-by: Christoph Hellwig ---

cleanup vmap usage in the dma-mapping layer

2019-06-04 Thread Christoph Hellwig
Hi all, the common DMA remapping code uses the vmalloc/vmap code to create page table entries for DMA mappings. This series lifts the currently arm specific VM_* flag for that into common code, and also exposes it to userspace in procfs to better understand the mappings, and cleans up a couple

Re: [PATCH 07/26] iommu/dma: move the arm64 wrappers to common code

2019-06-04 Thread Christoph Hellwig
On Mon, Jun 03, 2019 at 08:47:57PM +0100, Jon Hunter wrote: > Since next-20190529 one of our tests for MMC has started failing, where > the symptom is that the data written to the MMC does not match the > source. Bisecting this is pointing to this commit. Unfortunately, I am > not able to cleanly