[PATCH 13/30] iommu/amd: deprecate pci_get_bus_and_slot()

2017-11-21 Thread Sinan Kaya
pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as where a PCI device is present. This restricts the device drivers to be reused for other domain numbers. Use pci_get_domain_bus_and_slot() with a domain number of 0 where we can't extract the domain number. Other places, use the

Re: scsi fixes for non cache-coherent architectures (for 4.15 and stable)

2017-11-21 Thread Martin K. Petersen
Christoph, > this series fixes scsi and libsas operations on platforms with cache > incoherent dma operations. Patch 2 and 3 are originally from Huacai Chen, > but I've modified patch two so that it doesn't require his > dma_get_cache_alignment() rework, which I'd rather get into the next > merg

RE: No check of the size passed to unmap_single in swiotlb

2017-11-21 Thread Eric Yang
> -Original Message- > From: Konrad Rzeszutek Wilk [mailto:konrad.w...@oracle.com] > Sent: Tuesday, November 21, 2017 12:27 AM > To: Eric Yang ; iommu@lists.linux-foundation.org > Cc: linux-ker...@vger.kernel.org; Greg Kroah-Hartman > ; Andrew Morton ; > Andrey Ryabinin ; David Miller > ;

[PATCH] dma-debug: use virt_addr_valid() to check linear addresses

2017-11-21 Thread miles.chen
From: Miles Chen Coverity found that the commit 3aaabbf1c39e ("lib/dma-debug.c: fix incorrect pfn calculation") uses incorrect API to check if a given address is a linear address. The condition should be: (as discussed in Christoph's review) if (!is_vmalloc_addr(virt) && !virt_addr_valid(virt)) n

Re: [RFCv2 PATCH 01/36] iommu: Keep track of processes and PASIDs

2017-11-21 Thread Bob Liu
Hey Jean, On 2017/10/6 21:31, Jean-Philippe Brucker wrote: > IOMMU drivers need a way to bind Linux processes to devices. This is used > for Shared Virtual Memory (SVM), where devices support paging. In that > mode, DMA can directly target virtual addresses of a process. > > Introduce boilerplate

Re: [PATCH v2] iommu/ipmmu-vmsa: Do not replace bus IOMMU ops on driver init.

2017-11-21 Thread Liviu Dudau
On Tue, Nov 21, 2017 at 10:21:32AM -0700, Alex Williamson wrote: > On Tue, 21 Nov 2017 12:08:01 + > Liviu Dudau wrote: > > > On Mon, Nov 20, 2017 at 03:01:44PM -0700, Alex Williamson wrote: > > > On Mon, 20 Nov 2017 14:25:14 + > > > Liviu Dudau wrote: > > > > > > > On Fri, Oct 13, 201

Re: [PATCH v2] iommu/ipmmu-vmsa: Do not replace bus IOMMU ops on driver init.

2017-11-21 Thread Alex Williamson
On Tue, 21 Nov 2017 12:08:01 + Liviu Dudau wrote: > On Mon, Nov 20, 2017 at 03:01:44PM -0700, Alex Williamson wrote: > > On Mon, 20 Nov 2017 14:25:14 + > > Liviu Dudau wrote: > > > > > On Fri, Oct 13, 2017 at 04:48:45PM +0100, Robin Murphy wrote: > > > > Hi Joerg, > > > > > > H

[PATCH] iommu/ipmmu-vmsa: Simplify driver probing.

2017-11-21 Thread Liviu Dudau
The IPMMU driver still uses initcalls to do its initialisation, while other IOMMU drivers have moved to probe deferal mechanism. Update the IPMMU driver so that it can use modern driver probing which allows for it to be compiled together with other IOMMU drivers and not trying at boot time to repla

[PATCH 3/3] libsas: align sata_device's rps_resp on a cacheline

2017-11-21 Thread Christoph Hellwig
From: Huacai Chen The rps_resp buffer in ata_device is a DMA target, but it isn't explicitly cacheline aligned. Due to this, adjacent fields can be overwritten with stale data from memory on non-coherent architectures. As a result, the kernel is sometimes unable to communicate with an SATA device

scsi fixes for non cache-coherent architectures (for 4.15 and stable)

2017-11-21 Thread Christoph Hellwig
Hi Martin, this series fixes scsi and libsas operations on platforms with cache incoherent dma operations. Patch 2 and 3 are originally from Huacai Chen, but I've modified patch two so that it doesn't require his dma_get_cache_alignment() rework, which I'd rather get into the next merge window af

[PATCH 1/3] dma-mapping: always provide dma_get_cache_alignment

2017-11-21 Thread Christoph Hellwig
Provide the dummy version of dma_get_cache_alignment that always returns 1 even if CONFIG_HAS_DMA is not set, so that drivers and subsystems can use it without ifdefs. Cc: sta...@vger.kernel.org Signed-off-by: Christoph Hellwig --- include/linux/dma-mapping.h | 2 -- 1 file changed, 2 deletions(

[PATCH 2/3] scsi: use dma_get_cache_alignment() as minimum DMA alignment

2017-11-21 Thread Christoph Hellwig
From: Huacai Chen In non-coherent DMA mode, kernel uses cache flushing operations to maintain I/O coherency, so scsi's block queue should be aligned to the value returned by dma_get_cache_alignment(). Otherwise, If a DMA buffer and a kernel structure share a same cache line, and if the kernel st

Re: [PATCH v2] iommu/ipmmu-vmsa: Do not replace bus IOMMU ops on driver init.

2017-11-21 Thread Robin Murphy
Hi Alex, On 20/11/17 22:01, Alex Williamson wrote: On Mon, 20 Nov 2017 14:25:14 + Liviu Dudau wrote: On Fri, Oct 13, 2017 at 04:48:45PM +0100, Robin Murphy wrote: Hi Joerg, Hi, On 20/09/17 15:13, Liviu Dudau wrote: If the IPMMU driver is compiled in the kernel it will replace the p

Re: [PATCH v2] iommu/ipmmu-vmsa: Do not replace bus IOMMU ops on driver init.

2017-11-21 Thread Liviu Dudau
On Mon, Nov 20, 2017 at 03:01:44PM -0700, Alex Williamson wrote: > On Mon, 20 Nov 2017 14:25:14 + > Liviu Dudau wrote: > > > On Fri, Oct 13, 2017 at 04:48:45PM +0100, Robin Murphy wrote: > > > Hi Joerg, > > > > Hi, > > > > > > > > On 20/09/17 15:13, Liviu Dudau wrote: > > > > If the IP