Re: [PATCH 08/10] iommu: Set default domain type at runtime

2019-08-14 Thread Lu Baolu
Hi, On 8/14/19 9:38 PM, Joerg Roedel wrote: From: Joerg Roedel Set the default domain-type at runtime, not at compile-time. This keeps default domain type setting in one place when we have to change it at runtime. Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 23 +++--

Re: [PATCH v6 5/8] iommu: Add bounce page APIs

2019-08-14 Thread Lu Baolu
Hi Joerg, On 8/14/19 4:38 PM, Joerg Roedel wrote: Hi Lu Baolu, On Tue, Jul 30, 2019 at 12:52:26PM +0800, Lu Baolu wrote: * iommu_bounce_map(dev, addr, paddr, size, dir, attrs) - Map a buffer start at DMA address @addr in bounce page manner. For buffer parts that doesn't cross a whole

Re: [PATCH] iommu/arm-smmu-v3: add nr_ats_masters to avoid unnecessary operations

2019-08-14 Thread Leizhen (ThunderTown)
On 2019/8/14 19:14, Will Deacon wrote: > Hi, > > I've been struggling with the memory ordering requirements here. More below. > > On Thu, Aug 01, 2019 at 08:20:40PM +0800, Zhen Lei wrote: >> When (smmu_domain->smmu->features & ARM_SMMU_FEAT_ATS) is true, even if a >> smmu domain does not conta

[PATCH v2 2/2] iommu/arm-smmu-v3: add nr_ats_masters for quickly check

2019-08-14 Thread Zhen Lei
When (smmu_domain->smmu->features & ARM_SMMU_FEAT_ATS) is true, even if a smmu domain does not contain any ats master, the operations of arm_smmu_atc_inv_to_cmd() and lock protection in arm_smmu_atc_inv_domain() are always executed. This will impact performance, especially in multi-core and stress

[PATCH v2 0/2] add nr_ats_masters for quickly check

2019-08-14 Thread Zhen Lei
v1 --> v2: 1. change the type of nr_ats_masters from atomic_t to int, and move its ind/dec operation from arm_smmu_enable_ats()/arm_smmu_disable_ats() to arm_smmu_attach_dev()/arm_smmu_detach_dev(), and protected by "spin_lock_irqsave(&smmu_domain->devices_lock, flags);" Zhen Lei (2): i

[PATCH v2 1/2] iommu/arm-smmu-v3: don't add a master into smmu_domain before it's ready

2019-08-14 Thread Zhen Lei
Once a master has been added into smmu_domain->devices, it may immediately be scaned in arm_smmu_unmap()-->arm_smmu_atc_inv_domain(). From a logical point of view, the master should be added into smmu_domain after it has been completely initialized. Signed-off-by: Zhen Lei --- drivers/iommu/arm-

Re: [PATCH 07/10] iommu: Print default domain type on boot

2019-08-14 Thread Lu Baolu
Hi, On 8/14/19 9:38 PM, Joerg Roedel wrote: From: Joerg Roedel Introduce a subsys_initcall for IOMMU code and use it to print the default domain type at boot. Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 30 +- 1 file changed, 29 insertions(+), 1 del

Re: [PATCH 06/10] iommu: Remember when default domain type was set on kernel command line

2019-08-14 Thread Lu Baolu
Hi, On 8/14/19 9:38 PM, Joerg Roedel wrote: From: Joerg Roedel Introduce an extensible concept to remember when certain configuration settings for the IOMMU code have been set on the kernel command line. This will be used later to prevent overwriting these settings with other defaults. Signe

Re: [PATCH 04/10] x86/dma: Get rid of iommu_pass_through

2019-08-14 Thread Lu Baolu
Hi, On 8/14/19 9:38 PM, Joerg Roedel wrote: From: Joerg Roedel This variable has no users anymore. Remove it and tell the IOMMU code via its new functions about requested DMA modes. Signed-off-by: Joerg Roedel This will also simplify the procedures in iommu_probe_device() on x86 platforms.

Re: [PATCH 03/10] iommu/vt-d: Request passthrough mode from IOMMU core

2019-08-14 Thread Lu Baolu
Hi Joerg, On 8/14/19 9:38 PM, Joerg Roedel wrote: From: Joerg Roedel Get rid of the iommu_pass_through variable and request passthrough mode via the new iommu core function. Signed-off-by: Joerg Roedel Looks good to me. Reviewed-by: Lu Baolu --- drivers/iommu/intel-iommu.c | 2 +- 1

Re: [PATCH v3 hmm 03/11] mm/mmu_notifiers: add a get/put scheme for the registration

2019-08-14 Thread Jason Gunthorpe
On Wed, Aug 14, 2019 at 02:20:31PM -0700, Ralph Campbell wrote: > > On 8/6/19 4:15 PM, Jason Gunthorpe wrote: > > From: Jason Gunthorpe > > > > Many places in the kernel have a flow where userspace will create some > > object and that object will need to connect to the subsystem's > > mmu_notifi

Re: [PATCH v3 hmm 00/11] Add mmu_notifier_get/put for managing mmu notifier registrations

2019-08-14 Thread Ralph Campbell
On 8/6/19 4:15 PM, Jason Gunthorpe wrote: From: Jason Gunthorpe This series introduces a new registration flow for mmu_notifiers based on the idea that the user would like to get a single refcounted piece of memory for a mm, keyed to its use. For instance many users of mmu_notifiers use an i

Re: [PATCH v3 hmm 11/11] mm/mmu_notifiers: remove unregister_no_release

2019-08-14 Thread Ralph Campbell
On 8/6/19 4:15 PM, Jason Gunthorpe wrote: From: Jason Gunthorpe mmu_notifier_unregister_no_release() and mmu_notifier_call_srcu() no longer have any users, they have all been converted to use mmu_notifier_put(). So delete this difficult to use interface. Signed-off-by: Jason Gunthorpe Re

Re: [PATCH v3 hmm 05/11] hmm: use mmu_notifier_get/put for 'struct hmm'

2019-08-14 Thread Ralph Campbell
On 8/6/19 4:15 PM, Jason Gunthorpe wrote: From: Jason Gunthorpe This is a significant simplification, it eliminates all the remaining 'hmm' stuff in mm_struct, eliminates krefing along the critical notifier paths, and takes away all the ugly locking and abuse of page_table_lock. mmu_notifier

Re: [PATCH v3 hmm 03/11] mm/mmu_notifiers: add a get/put scheme for the registration

2019-08-14 Thread Ralph Campbell
On 8/6/19 4:15 PM, Jason Gunthorpe wrote: From: Jason Gunthorpe Many places in the kernel have a flow where userspace will create some object and that object will need to connect to the subsystem's mmu_notifier subscription for the duration of its lifetime. In this case the subsystem is usua

Re: [PATCH v3 hmm 02/11] mm/mmu_notifiers: do not speculatively allocate a mmu_notifier_mm

2019-08-14 Thread Ralph Campbell
On 8/6/19 4:15 PM, Jason Gunthorpe wrote: From: Jason Gunthorpe A prior commit e0f3c3f78da2 ("mm/mmu_notifier: init notifier if necessary") made an attempt at doing this, but had to be reverted as calling the GFP_KERNEL allocator under the i_mmap_mutex causes deadlock, see commit 35cfa2b0b491

Re: [PATCH v3 hmm 01/11] mm/mmu_notifiers: hoist do_mmu_notifier_register down_write to the caller

2019-08-14 Thread Ralph Campbell
On 8/6/19 4:15 PM, Jason Gunthorpe wrote: From: Jason Gunthorpe This simplifies the code to not have so many one line functions and extra logic. __mmu_notifier_register() simply becomes the entry point to register the notifier, and the other one calls it under lock. Also add a lockdep_assert

Re: [PATCH v4 21/22] iommu/vt-d: Support flushing more translation cache types

2019-08-14 Thread Jacob Pan
On Thu, 18 Jul 2019 10:35:37 +0200 Auger Eric wrote: > Hi Jacob, > > On 6/9/19 3:44 PM, Jacob Pan wrote: > > When Shared Virtual Memory is exposed to a guest via vIOMMU, > > scalable IOTLB invalidation may be passed down from outside IOMMU > > subsystems. This patch adds invalidation functions t

Re: [GIT PULL] dma mapping fixes for 5.3-rc

2019-08-14 Thread pr-tracker-bot
The pull request you sent on Wed, 14 Aug 2019 16:12:17 +0200: > git://git.infradead.org/users/hch/dma-mapping.git tags/dma-mapping-5.3-4 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/e83b009c5c366b678c7986fa6c1d38fed06c954c Thank you! -- Deet-doot-dot, I am a bot.

Re: [git pull] IOMMU Fixes for Linux v5.3-rc4

2019-08-14 Thread pr-tracker-bot
The pull request you sent on Wed, 14 Aug 2019 16:09:09 +0200: > git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git > tags/iommu-fixes-v5.3-rc4 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/b5e33e44d994bb03c75f1901d47b1cf971f752a0 Thank you! -- Deet-doot-

Re: [PATCH 04/15] iommu/arm-smmu: Rework cb_base handling

2019-08-14 Thread Will Deacon
On Fri, Aug 09, 2019 at 06:07:41PM +0100, Robin Murphy wrote: > To keep register-access quirks manageable, we want to structure things > to avoid needing too many individual overrides. It seems fairly clean to > have a single interface which handles both global and context registers > in terms of t

[PATCH 13/13] iommu/io-pgtable: Pass struct iommu_iotlb_gather to ->tlb_add_page()

2019-08-14 Thread Will Deacon
With all the pieces in place, we can finally propagate the iommu_iotlb_gather structure from the call to unmap() down to the IOMMU drivers' implementation of ->tlb_add_page(). Currently everybody ignores it, but the machinery is now there to defer invalidation. Signed-off-by: Will Deacon --- dri

[PATCH 03/13] iommu/io-pgtable: Rename iommu_gather_ops to iommu_flush_ops

2019-08-14 Thread Will Deacon
In preparation for TLB flush gathering in the IOMMU API, rename the iommu_gather_ops structure in io-pgtable to iommu_flush_ops, which better describes its purpose and avoids the potential for confusion between different levels of the API. $ find linux/ -type f -name '*.[ch]' | xargs sed -i 's/gat

[PATCH 06/13] iommu: Pass struct iommu_iotlb_gather to ->unmap() and ->iotlb_sync()

2019-08-14 Thread Will Deacon
To allow IOMMU drivers to batch up TLB flushing operations and postpone them until ->iotlb_sync() is called, extend the prototypes for the ->unmap() and ->iotlb_sync() IOMMU ops callbacks to take a pointer to the current iommu_iotlb_gather structure. All affected IOMMU drivers are updated, but the

[PATCH 10/13] iommu/io-pgtable: Replace ->tlb_add_flush() with ->tlb_add_page()

2019-08-14 Thread Will Deacon
The ->tlb_add_flush() callback in the io-pgtable API now looks a bit silly: - It takes a size and a granule, which are always the same - It takes a 'bool leaf', which is always true - It only ever flushes a single page With that in mind, replace it with an optional ->tlb_add_page() callback

[PATCH 11/13] iommu/io-pgtable: Remove unused ->tlb_sync() callback

2019-08-14 Thread Will Deacon
The ->tlb_sync() callback is no longer used, so it can be removed. Signed-off-by: Will Deacon --- drivers/gpu/drm/panfrost/panfrost_mmu.c | 1 - drivers/iommu/arm-smmu-v3.c | 8 drivers/iommu/arm-smmu.c| 17 + drivers/iommu/io-pgtable-arm-v7

[PATCH 08/13] iommu/io-pgtable: Hook up ->tlb_flush_walk() and ->tlb_flush_leaf() in drivers

2019-08-14 Thread Will Deacon
Hook up ->tlb_flush_walk() and ->tlb_flush_leaf() in drivers using the io-pgtable API so that we can start making use of them in the page-table code. For now, they can just wrap the implementations of ->tlb_add_flush and ->tlb_sync pending future optimisation in each driver. Signed-off-by: Will De

[PATCH 05/13] iommu: Introduce iommu_iotlb_gather_add_page()

2019-08-14 Thread Will Deacon
Introduce a helper function for drivers to use when updating an iommu_iotlb_gather structure in response to an ->unmap() call, rather than having to open-code the logic in every page-table implementation. Signed-off-by: Will Deacon --- include/linux/iommu.h | 31 +++

[PATCH 02/13] iommu/io-pgtable-arm: Remove redundant call to io_pgtable_tlb_sync()

2019-08-14 Thread Will Deacon
Commit b6b65ca20bc9 ("iommu/io-pgtable-arm: Add support for non-strict mode") added an unconditional call to io_pgtable_tlb_sync() immediately after the case where we replace a block entry with a table entry during an unmap() call. This is redundant, since the IOMMU API will call iommu_tlb_sync() o

[PATCH 07/13] iommu/io-pgtable: Introduce tlb_flush_walk() and tlb_flush_leaf()

2019-08-14 Thread Will Deacon
In preparation for deferring TLB flushes to iommu_tlb_sync(), introduce two new synchronous invalidation helpers to the io-pgtable API, which allow the unmap() code to force invalidation in cases where it cannot be deferred (e.g. when replacing a table with a block or when TLBI_ON_MAP is set). Sig

[PATCH 12/13] iommu/io-pgtable: Pass struct iommu_iotlb_gather to ->unmap()

2019-08-14 Thread Will Deacon
Update the io-pgtable ->unmap() function to take an iommu_iotlb_gather pointer as an argument, and update the callers as appropriate. Signed-off-by: Will Deacon --- drivers/gpu/drm/panfrost/panfrost_mmu.c | 2 +- drivers/iommu/arm-smmu-v3.c | 2 +- drivers/iommu/arm-smmu.c

[PATCH 00/13] Rework IOMMU API to allow for batching of invalidation

2019-08-14 Thread Will Deacon
Hi everybody, These are the core IOMMU changes that I have posted previously as part of my ongoing effort to reduce the lock contention of the SMMUv3 command queue. I thought it would be better to split this out as a separate series, since I think it's ready to go and all the driver conversions me

[PATCH 04/13] iommu: Introduce struct iommu_iotlb_gather for batching TLB flushes

2019-08-14 Thread Will Deacon
To permit batching of TLB flushes across multiple calls to the IOMMU driver's ->unmap() implementation, introduce a new structure for tracking the address range to be flushed and the granularity at which the flushing is required. This is hooked into the IOMMU API and its caller are updated to make

[PATCH 01/13] iommu: Remove empty iommu_tlb_range_add() callback from iommu_ops

2019-08-14 Thread Will Deacon
Commit add02cfdc9bc ("iommu: Introduce Interface for IOMMU TLB Flushing") added three new TLB flushing operations to the IOMMU API so that the underlying driver operations can be batched when unmapping large regions of IO virtual address space. However, the ->iotlb_range_add() callback has not bee

[PATCH 09/13] iommu/io-pgtable-arm: Call ->tlb_flush_walk() and ->tlb_flush_leaf()

2019-08-14 Thread Will Deacon
Now that all IOMMU drivers using the io-pgtable API implement the ->tlb_flush_walk() and ->tlb_flush_leaf() callbacks, we can use them in the io-pgtable code instead of ->tlb_add_flush() immediately followed by ->tlb_sync(). Signed-off-by: Will Deacon --- drivers/iommu/io-pgtable-arm-v7s.c | 25

Re: DMA-API: cacheline tracking ENOMEM, dma-debug disabled due to nouveau ?

2019-08-14 Thread Daniel Vetter
On Wed, Aug 14, 2019 at 04:50:33PM +0200, Corentin Labbe wrote: > Hello > > Since lot of release (at least since 4.19), I hit the following error message: > DMA-API: cacheline tracking ENOMEM, dma-debug disabled > > After hitting that, I try to check who is creating so many DMA mapping and > see

Re: [PATCH v3 hmm 04/11] misc/sgi-gru: use mmu_notifier_get/put for struct gru_mm_struct

2019-08-14 Thread Dimitri Sivanich
On Wed, Aug 14, 2019 at 03:58:34PM +, Jason Gunthorpe wrote: > On Thu, Aug 08, 2019 at 12:25:56PM +0200, Christoph Hellwig wrote: > > Looks good, > > > > Reviewed-by: Christoph Hellwig > > Dimitri, are you OK with this patch? > I think this looks OK. Reviewed-by: Dimitri Sivanich

Re: [PATCH 01/15] iommu/arm-smmu: Convert GR0 registers to bitfields

2019-08-14 Thread Robin Murphy
On 14/08/2019 18:20, Will Deacon wrote: On Fri, Aug 09, 2019 at 06:07:38PM +0100, Robin Murphy wrote: FIELD_PREP remains a terrible name, but the overall simplification will make further work on this stuff that much more manageable. This also serves as an audit of the header, wherein we can impo

Re: [PATCH 01/15] iommu/arm-smmu: Convert GR0 registers to bitfields

2019-08-14 Thread Will Deacon
On Fri, Aug 09, 2019 at 06:07:38PM +0100, Robin Murphy wrote: > FIELD_PREP remains a terrible name, but the overall simplification will > make further work on this stuff that much more manageable. This also > serves as an audit of the header, wherein we can impose a consistent > grouping and orderi

Re: [PATCH v4 20/22] iommu/vt-d: Add bind guest PASID support

2019-08-14 Thread Jacob Pan
On Fri, 5 Jul 2019 10:21:27 +0800 Lu Baolu wrote: > Hi Jacob, > > On 6/28/19 4:22 AM, Jacob Pan wrote: > >>> + } > >>> + refcount_set(&svm->refs, 0); > >>> + ioasid_set_data(data->hpasid, svm); > >>> + INIT_LIST_HEAD_RCU(&svm->devs); > >>> + INIT_LIST_HEAD

[PATCH 5.2 085/144] iommu/vt-d: Check if domain->pgd was allocated

2019-08-14 Thread Greg Kroah-Hartman
[ Upstream commit 3ee9eca760e7d0b68c55813243de66bbb499dc3b ] There is a couple of places where on domain_init() failure domain_exit() is called. While currently domain_init() can fail only if alloc_pgtable_page() has failed. Make domain_exit() check if domain->pgd present, before calling domain_u

Re: [PATCH v3 hmm 08/11] drm/radeon: use mmu_notifier_get/put for struct radeon_mn

2019-08-14 Thread Jason Gunthorpe
On Tue, Aug 06, 2019 at 08:15:45PM -0300, Jason Gunthorpe wrote: > From: Jason Gunthorpe > > radeon is using a device global hash table to track what mmu_notifiers > have been registered on struct mm. This is better served with the new > get/put scheme instead. > > radeon has a bug where it was

Re: [PATCH v3 hmm 04/11] misc/sgi-gru: use mmu_notifier_get/put for struct gru_mm_struct

2019-08-14 Thread Jason Gunthorpe
On Thu, Aug 08, 2019 at 12:25:56PM +0200, Christoph Hellwig wrote: > Looks good, > > Reviewed-by: Christoph Hellwig Dimitri, are you OK with this patch? Thanks, Jason ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundatio

Re: [PATCH 6/6] driver core: initialize a default DMA mask for platform device

2019-08-14 Thread Robin Murphy
On 11/08/2019 09:05, Christoph Hellwig wrote: We still treat devices without a DMA mask as defaulting to 32-bits for both mask, but a few releases ago we've started warning about such cases, as they require special cases to work around this sloppyness. Add a dma_mask field to struct platform_obje

DMA-API: cacheline tracking ENOMEM, dma-debug disabled due to nouveau ?

2019-08-14 Thread Corentin Labbe
Hello Since lot of release (at least since 4.19), I hit the following error message: DMA-API: cacheline tracking ENOMEM, dma-debug disabled After hitting that, I try to check who is creating so many DMA mapping and see: cat /sys/kernel/debug/dma-api/dump | cut -d' ' -f2 | sort | uniq -c 6 a

Re: [PATCH v9 08/21] iommu/io-pgtable-arm-v7s: Extend MediaTek 4GB Mode

2019-08-14 Thread Will Deacon
Hi Yong Wu, Sorry, but I'm still deeply confused by this patch. On Sat, Aug 10, 2019 at 03:58:08PM +0800, Yong Wu wrote: > MediaTek extend the arm v7s descriptor to support the dram over 4GB. > > In the mt2712 and mt8173, it's called "4GB mode", the physical address > is from 0x4000_ to 0x1_

[GIT PULL] dma mapping fixes for 5.3-rc

2019-08-14 Thread Christoph Hellwig
The following changes since commit 451577f3e3a9bf1861218641dbbf98e214e77851: Merge tag 'kbuild-fixes-v5.3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild (2019-08-09 20:31:04 -0700) are available in the Git repository at: git://git.infradead.org/users/hch/dma-map

[git pull] IOMMU Fixes for Linux v5.3-rc4

2019-08-14 Thread Joerg Roedel
Hi Linus, The following changes since commit e21a712a9685488f5ce80495b37b9fdbe96c230d: Linux 5.3-rc3 (2019-08-04 18:40:12 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git tags/iommu-fixes-v5.3-rc4 for you to fetch changes up to 3a

[PATCH 2/2] microblaze: use the generic dma coherent remap allocator

2019-08-14 Thread Christoph Hellwig
This switches to using common code for the DMA allocations, including potential use of the CMA allocator if configured. Switching to the generic code enables DMA allocations from atomic context, which is required by the DMA API documentation, and also adds various other minor features drivers star

[PATCH 1/2] microblaze/nommu: use the generic uncached segment support

2019-08-14 Thread Christoph Hellwig
Stop providing our own arch alloc/free hooks for nommu platforms and just expose the segment offset and use the generic dma-direct allocator. Signed-off-by: Christoph Hellwig --- arch/microblaze/Kconfig | 2 + arch/microblaze/mm/consistent.c | 93 +++-- 2 fil

convert microblaze to the generic dma remap allocator

2019-08-14 Thread Christoph Hellwig
Hi Michal, can you take a look at this patch that moves microblaze over to the generic DMA remap allocator? I've been trying to slowly get all architectures over to the generic code, and microblaze is one that seems very straightfoward to convert. ___ i

[PATCH] sh: use the generic dma coherent remap allocator

2019-08-14 Thread Christoph Hellwig
This switches to using common code for the DMA allocations, including potential use of the CMA allocator if configured. Switching to the generic code enables DMA allocations from atomic context, which is required by the DMA API documentation, and also adds various other minor features drivers star

convert sh to the generic dma remap allocator

2019-08-14 Thread Christoph Hellwig
Hi Rich and Yoshinori, can you take a quick look at this patch that moves sh over to the generic DMA remap allocator? I've been trying to slowly get all architectures over to the generic code, and I'd like merge this one for 5.4 now that it has been posted a handful of times without any feedback.

[PATCH 05/10] ia64: Get rid of iommu_pass_through

2019-08-14 Thread Joerg Roedel
From: Joerg Roedel This variable has no users anymore so it can be removed. Signed-off-by: Joerg Roedel --- arch/ia64/include/asm/iommu.h | 2 -- arch/ia64/kernel/pci-dma.c| 2 -- 2 files changed, 4 deletions(-) diff --git a/arch/ia64/include/asm/iommu.h b/arch/ia64/include/asm/iommu.h in

[PATCH 09/10] iommu: Disable passthrough mode when SME is active

2019-08-14 Thread Joerg Roedel
From: Joerg Roedel Using Passthrough mode when SME is active causes certain devices to use the SWIOTLB bounce buffer. The bounce buffer code has an upper limit of 256kb for the size of DMA allocations, which is too small for certain devices and causes them to fail. With this patch we enable IOMM

[PATCH 04/10] x86/dma: Get rid of iommu_pass_through

2019-08-14 Thread Joerg Roedel
From: Joerg Roedel This variable has no users anymore. Remove it and tell the IOMMU code via its new functions about requested DMA modes. Signed-off-by: Joerg Roedel --- arch/x86/include/asm/iommu.h | 1 - arch/x86/kernel/pci-dma.c| 11 +++ 2 files changed, 3 insertions(+), 9 dele

[PATCH 02/10] iommu/amd: Request passthrough mode from IOMMU core

2019-08-14 Thread Joerg Roedel
From: Joerg Roedel Get rid of the iommu_pass_through variable and request passthrough mode via the new iommu core function. Signed-off-by: Joerg Roedel --- drivers/iommu/amd_iommu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/amd_iommu.c b/drivers/io

[PATCH 00/10 v2] Cleanup IOMMU passthrough setting (and disable IOMMU Passthrough when SME is active)

2019-08-14 Thread Joerg Roedel
Hi, This patch-set started out small to overwrite the default passthrough setting (through CONFIG_IOMMU_DEFAULT_PASSTHROUGH=y) when SME is active. But on the way to that Tom reminded me that the current ways to configure passthrough/no-passthrough modes for IOMMU on x86 is a mess. So I added a fe

[PATCH 03/10] iommu/vt-d: Request passthrough mode from IOMMU core

2019-08-14 Thread Joerg Roedel
From: Joerg Roedel Get rid of the iommu_pass_through variable and request passthrough mode via the new iommu core function. Signed-off-by: Joerg Roedel --- drivers/iommu/intel-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iomm

[PATCH 10/10] Documentation: Update Documentation for iommu.passthrough

2019-08-14 Thread Joerg Roedel
From: Joerg Roedel This kernel parameter now takes also effect on X86. Signed-off-by: Joerg Roedel --- Documentation/admin-guide/kernel-parameters.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guid

[PATCH 08/10] iommu: Set default domain type at runtime

2019-08-14 Thread Joerg Roedel
From: Joerg Roedel Set the default domain-type at runtime, not at compile-time. This keeps default domain type setting in one place when we have to change it at runtime. Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 23 +++ 1 file changed, 15 insertions(+), 8 dele

[PATCH 06/10] iommu: Remember when default domain type was set on kernel command line

2019-08-14 Thread Joerg Roedel
From: Joerg Roedel Introduce an extensible concept to remember when certain configuration settings for the IOMMU code have been set on the kernel command line. This will be used later to prevent overwriting these settings with other defaults. Signed-off-by: Joerg Roedel --- drivers/iommu/iomm

[PATCH 07/10] iommu: Print default domain type on boot

2019-08-14 Thread Joerg Roedel
From: Joerg Roedel Introduce a subsys_initcall for IOMMU code and use it to print the default domain type at boot. Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 30 +- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/iommu.c b/dr

[PATCH 01/10] iommu: Add helpers to set/get default domain type

2019-08-14 Thread Joerg Roedel
From: Joerg Roedel Add a couple of functions to allow changing the default domain type from architecture code and a function for iommu drivers to request whether the default domain is passthrough. Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 16 include/linux/iommu.

Re: [PATCH] iommu/arm-smmu-v3: add nr_ats_masters to avoid unnecessary operations

2019-08-14 Thread Will Deacon
Hi, I've been struggling with the memory ordering requirements here. More below. On Thu, Aug 01, 2019 at 08:20:40PM +0800, Zhen Lei wrote: > When (smmu_domain->smmu->features & ARM_SMMU_FEAT_ATS) is true, even if a > smmu domain does not contain any ats master, the operations of > arm_smmu_atc_in

Re: [PATCH] iommu/amd: Override wrong IVRS IOAPIC on Raven Ridge systems

2019-08-14 Thread Joerg Roedel
On Tue, Aug 13, 2019 at 11:58:48AM +0800, Kai-Heng Feng wrote: > at 23:39, Joerg Roedel wrote: > > > On Thu, Aug 08, 2019 at 06:17:07PM +0800, Kai-Heng Feng wrote: > > > Raven Ridge systems may have malfunction touchpad or hang at boot if > > > incorrect IVRS IOAPIC is provided by BIOS. > > > >

Re: [PATCH] iommu: exynos: Remove __init annotation from exynos_sysmmu_probe()

2019-08-14 Thread Joerg Roedel
On Mon, Aug 12, 2019 at 12:32:46PM +0200, Marek Szyprowski wrote: > Exynos SYSMMU driver supports deferred probe. It happens when clocks > needed for this driver are not yet available. Typically next calls to > driver ->probe() happen before init section is free, but this is not > really guaranteed

Re: [PATCH v6 5/8] iommu: Add bounce page APIs

2019-08-14 Thread Joerg Roedel
Hi Lu Baolu, On Tue, Jul 30, 2019 at 12:52:26PM +0800, Lu Baolu wrote: > * iommu_bounce_map(dev, addr, paddr, size, dir, attrs) > - Map a buffer start at DMA address @addr in bounce page > manner. For buffer parts that doesn't cross a whole > minimal IOMMU page, the bounce page policy is

Re: [PATCH v9 00/21] MT8183 IOMMU SUPPORT

2019-08-14 Thread Will Deacon
On Wed, Aug 14, 2019 at 10:18:25AM +0200, Joerg Roedel wrote: > On Sat, Aug 10, 2019 at 03:58:00PM +0800, Yong Wu wrote: > > Change notes: > > v9: > >1) rebase on v5.3-rc1. > >2) In v7s, Use oas to implement MTK 4GB mode. It nearly reconstruct the > > patch, so I don't keep the R-b. >

Re: [PATCH v9 00/21] MT8183 IOMMU SUPPORT

2019-08-14 Thread Joerg Roedel
On Sat, Aug 10, 2019 at 03:58:00PM +0800, Yong Wu wrote: > Change notes: > v9: >1) rebase on v5.3-rc1. >2) In v7s, Use oas to implement MTK 4GB mode. It nearly reconstruct the > patch, so I don't keep the R-b. Okay, this looks close to being ready, just the io-pgtable patches still n