[PATCH 3/3] dma-mapping: introduce DMA range map, supplanting dma_pfn_offset

2020-09-09 Thread Christoph Hellwig
From: Jim Quinlan The new field 'dma_range_map' in struct device is used to facilitate the use of single or multiple offsets between mapping regions of cpu addrs and dma addrs. It subsumes the role of "dev->dma_pfn_offset" which was only capable of holding a single uniform offset and had no

[PATCH 1/3] ARM/dma-mapping: move various helpers from dma-mapping.h to dma-direct.h

2020-09-09 Thread Christoph Hellwig
Move the helpers to translate to and from direct mapping DMA addresses to dma-direct.h. This not only is the most logical place, but the new placement also avoids dependency loops with pending commits. Signed-off-by: Christoph Hellwig --- arch/arm/common/dmabounce.c| 2 +-

support range based offsets in dma-direct

2020-09-09 Thread Christoph Hellwig
Hi all, this series adds range-based offsets to the dma-direct implementation. The guts of the change are a patch from Jim with some modifications from me, but to do it nicely we need to ARM patches to prepare for it as well. Diffstat: arch/arm/common/dmabounce.c|2

[PATCH 2/3] ARM/keystone: move the DMA offset handling under ifdef CONFIG_ARM_LPAE

2020-09-09 Thread Christoph Hellwig
The DMA offset notifier can only be used if PHYS_OFFSET is at least KEYSTONE_HIGH_PHYS_START, which can't be represented by a 32-bit phys_addr_t. Currently the code compiles fine despite that, a pending change to the DMA offset handling would create a compiler warning for this case. Add an ifdef

Re: [PATCH v2 7/9] iommu/vt-d: Listen to IOASID notifications

2020-09-09 Thread Jacob Pan
On Tue, 1 Sep 2020 19:03:23 +0200 Auger Eric wrote: > Hi Jacob, > > On 8/22/20 6:35 AM, Jacob Pan wrote: > > On Intel Scalable I/O Virtualization (SIOV) enabled platforms, IOMMU > > driver is one of the users of IOASIDs. In normal flow, callers will > > perform IOASID allocation, bind, unbind,

Re: [PATCH] intel-iommu: don't disable ATS for device without page aligned request

2020-09-09 Thread Jason Wang
- Original Message - > Hi Jason > > On Wed, Sep 09, 2020 at 04:34:32PM +0800, Jason Wang wrote: > > Commit 61363c1474b1 ("iommu/vt-d: Enable ATS only if the device uses > > page aligned address.") disables ATS for device that can do unaligned > > page request. > > Did you take a look

Re: [PATCH v2 6/9] iommu/ioasid: Introduce notification APIs

2020-09-09 Thread Jacob Pan
On Tue, 1 Sep 2020 18:49:38 +0200 Auger Eric wrote: > Hi Jacob, > > On 8/22/20 6:35 AM, Jacob Pan wrote: > > Relations among IOASID users largely follow a publisher-subscriber > > pattern. E.g. to support guest SVA on Intel Scalable I/O > > Virtualization (SIOV) enabled platforms, VFIO, IOMMU,

Re: [trivial PATCH] treewide: Convert switch/case fallthrough; to break;

2020-09-09 Thread Joe Perches
On Wed, 2020-09-09 at 19:36 -0300, Jason Gunthorpe wrote: > On Wed, Sep 09, 2020 at 01:06:39PM -0700, Joe Perches wrote: > > fallthrough to a separate case/default label break; isn't very readable. > > > > Convert pseudo-keyword fallthrough; statements to a simple break; when > > the next label

Re: [trivial PATCH] treewide: Convert switch/case fallthrough; to break;

2020-09-09 Thread Jason Gunthorpe
On Wed, Sep 09, 2020 at 01:06:39PM -0700, Joe Perches wrote: > fallthrough to a separate case/default label break; isn't very readable. > > Convert pseudo-keyword fallthrough; statements to a simple break; when > the next label is case or default and the only statement in the next > label block

[trivial PATCH] treewide: Convert switch/case fallthrough; to break;

2020-09-09 Thread Joe Perches
fallthrough to a separate case/default label break; isn't very readable. Convert pseudo-keyword fallthrough; statements to a simple break; when the next label is case or default and the only statement in the next label block is break; Found using: $ grep-2.5.4 -rP --include=*.[ch] -n

Re: [trivial PATCH] treewide: Convert switch/case fallthrough; to break;

2020-09-09 Thread Gustavo A. R. Silva
On 9/9/20 15:06, Joe Perches wrote: > fallthrough to a separate case/default label break; isn't very readable. > > Convert pseudo-keyword fallthrough; statements to a simple break; when > the next label is case or default and the only statement in the next > label block is break; > > Found

Re: [trivial PATCH] treewide: Convert switch/case fallthrough; to break;

2020-09-09 Thread Keith Busch
On Wed, Sep 09, 2020 at 01:06:39PM -0700, Joe Perches wrote: > diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c > index eea0f453cfb6..8aac5bc60f4c 100644 > --- a/crypto/tcrypt.c > +++ b/crypto/tcrypt.c > @@ -2464,7 +2464,7 @@ static int do_test(const char *alg, u32 type, u32 mask, > int m, u32

Re: [PATCH v2 6/9] iommu/ioasid: Introduce notification APIs

2020-09-09 Thread Jacob Pan
On Tue, 25 Aug 2020 12:26:17 +0200 Jean-Philippe Brucker wrote: > On Fri, Aug 21, 2020 at 09:35:15PM -0700, Jacob Pan wrote: > > Relations among IOASID users largely follow a publisher-subscriber > > pattern. E.g. to support guest SVA on Intel Scalable I/O > > Virtualization (SIOV) enabled

Re: [PATCH v2 1/3] swiotlb: Use %pa to print phys_addr_t variables

2020-09-09 Thread Konrad Rzeszutek Wilk
On Wed, Sep 09, 2020 at 06:59:13PM +0300, Andy Shevchenko wrote: > On Wed, Sep 02, 2020 at 11:02:46PM -0300, Fabio Estevam wrote: > > On Wed, Sep 2, 2020 at 2:31 PM Andy Shevchenko > > wrote: > > > > > > There is an extension to a %p to print phys_addr_t type of variables. > > > Use it here. > >

Re: [PATCH] intel-iommu: don't disable ATS for device without page aligned request

2020-09-09 Thread Raj, Ashok
Hi Jason On Wed, Sep 09, 2020 at 04:34:32PM +0800, Jason Wang wrote: > Commit 61363c1474b1 ("iommu/vt-d: Enable ATS only if the device uses > page aligned address.") disables ATS for device that can do unaligned > page request. Did you take a look at the PCI specification? Page Aligned Request

Re: [PATCH v3 0/8] iommu/arm-smmu: Support maintaining bootloader mappings

2020-09-09 Thread Laurentiu Tudor
Hi Bjorn, On 9/4/2020 6:55 PM, Bjorn Andersson wrote: > Based on previous attempts and discussions this is the latest attempt at > inheriting stream mappings set up by the bootloader, for e.g. boot splash or > efifb. > > Per Will's request this builds on the work by Jordan and Rob for the Adreno

Re: [PATCH v2 1/3] swiotlb: Use %pa to print phys_addr_t variables

2020-09-09 Thread Andy Shevchenko
On Wed, Sep 02, 2020 at 11:02:46PM -0300, Fabio Estevam wrote: > On Wed, Sep 2, 2020 at 2:31 PM Andy Shevchenko > wrote: > > > > There is an extension to a %p to print phys_addr_t type of variables. > > Use it here. > > > > Signed-off-by: Andy Shevchenko > > --- > > v2: dropped bytes replacement

Re: [Intel-gfx] [PATCH 0/8] Convert the intel iommu driver to the dma-iommu api

2020-09-09 Thread Tvrtko Ursulin
On 09/09/2020 10:16, Tvrtko Ursulin wrote: On 08/09/2020 23:43, Tom Murphy wrote: On Tue, 8 Sep 2020 at 16:56, Tvrtko Ursulin wrote: On 08/09/2020 16:44, Logan Gunthorpe wrote: On 2020-09-08 9:28 a.m., Tvrtko Ursulin wrote: diff --git a/drivers/gpu/drm/i915/i915_scatterlist.h

Re: [PATCH] iommu/dma: Fix IOVA reserve dma ranges

2020-09-09 Thread Robin Murphy
On 2020-09-09 06:32, Srinath Mannam wrote: Fix IOVA reserve failure for memory regions listed in dma-ranges in the following cases. - start address of memory region is 0x0. That's fair enough, and in fact generalises to the case of zero-sized gaps between regions, which is indeed an

[bug report] iommu/amd: Restore IRTE.RemapEn bit after programming IRTE

2020-09-09 Thread Dan Carpenter
Hello Suravee Suthikulpanit, This is a semi-automatic email about new static checker warnings. The patch 26e495f34107: "iommu/amd: Restore IRTE.RemapEn bit after programming IRTE" from Sep 3, 2020, leads to the following Smatch complaint: drivers/iommu/amd/iommu.c:3870

Re: [Intel-gfx] [PATCH 0/8] Convert the intel iommu driver to the dma-iommu api

2020-09-09 Thread Tvrtko Ursulin
On 08/09/2020 23:43, Tom Murphy wrote: On Tue, 8 Sep 2020 at 16:56, Tvrtko Ursulin wrote: On 08/09/2020 16:44, Logan Gunthorpe wrote: On 2020-09-08 9:28 a.m., Tvrtko Ursulin wrote: diff --git a/drivers/gpu/drm/i915/i915_scatterlist.h b/drivers/gpu/drm/i915/i915 index

[PATCH] intel-iommu: don't disable ATS for device without page aligned request

2020-09-09 Thread Jason Wang
Commit 61363c1474b1 ("iommu/vt-d: Enable ATS only if the device uses page aligned address.") disables ATS for device that can do unaligned page request. This looks wrong, since the commit log said it's because the page request descriptor doesn't support reporting unaligned request. A victim is

Re: [PATCH V2 5/5] DO NOT MERGE: iommu: disable list appending in dma-iommu

2020-09-09 Thread Christoph Hellwig
On Wed, Sep 09, 2020 at 09:43:09AM +0800, Lu Baolu wrote: > + /* > +* The Intel graphic device driver is used to assume that the > returned > +* sg list is not combound. This blocks the efforts of converting > the This adds pointless overly long lines. > +* Intel

Re: [PATCH V2 2/5] iommu: Add iommu_dma_free_cpu_cached_iovas function

2020-09-09 Thread Christoph Hellwig
> +static inline void iommu_dma_free_cpu_cached_iovas(unsigned int cpu, > + struct iommu_domain > *domain) This adds a crazy long line. Which is rather pointless as other bits of code in the patch use the more compact two tab indentations for the

Re: [PATCH v11 07/11] device-mapping: Introduce DMA range map, supplanting dma_pfn_offset

2020-09-09 Thread Nathan Chancellor
On Tue, Sep 08, 2020 at 11:43:45AM +0200, Christoph Hellwig wrote: > And because I like replying to myself so much, here is a link to the > version with the arm cleanup patch applied. Unlike the previous two > attempts this has at least survived very basic sanity testing: > >