[PATCH 5/7] iommu/amd: Add flush counters to struct dma_ops_domain

2017-06-07 Thread Joerg Roedel
From: Joerg Roedel The counters are increased every time the TLB for a given domain is flushed. We also store the current value of that counter into newly added entries of the flush-queue, so that we can tell wheter this entry is already flushed. Signed-off-by: Joerg Roedel --- drivers/iommu

Re: [PATCH v1 0/3] iommu/amd: AMD IOMMU performance updates 2017-06-05

2017-06-08 Thread Joerg Roedel
On Mon, Jun 05, 2017 at 02:52:03PM -0500, Tom Lendacky wrote: > This patch series addresses some performance issues in the AMD IOMMU > driver: > > - Reduce the amount of MMIO performed during command submission > - When the command queue is (near) full, only wait till there is enough > room for

[git pull] IOMMU Fixes for Linux v4.12-rc4

2017-06-09 Thread Joerg Roedel
Hi Linus, The following changes since commit 5ed02dbb497422bf225783f46e6eadd237d23d6b: Linux 4.12-rc3 (2017-05-28 17:20:53 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git tags/iommu-fixes-v4.12-rc4 for you to fetch changes up to

[PATCH 1/2] iommu/s390: Use iommu_group_get_for_dev() in s390_iommu_add_device()

2017-06-15 Thread Joerg Roedel
From: Joerg Roedel The iommu_group_get_for_dev() function also attaches the device to its group, so this code doesn't need to be in the iommu driver. Further by using this function the driver can make use of default domains in the future. Signed-off-by: Joerg Roedel --- drivers/iommu

[PATCH 0/2 v2] iommu/s390: Improve iommu-groups and add sysfs support

2017-06-15 Thread Joerg Roedel
, Joerg Joerg Roedel (2): iommu/s390: Use iommu_group_get_for_dev() in s390_iommu_add_device() iommu/s390: Add support for iommu_device handling arch/s390/include/asm/pci.h | 7 +++ arch/s390/pci/pci.c | 5 + drivers/iommu/s390-iommu.c | 50

[PATCH 2/2] iommu/s390: Add support for iommu_device handling

2017-06-15 Thread Joerg Roedel
From: Joerg Roedel Add support for the iommu_device_register interface to make the s390 hardware iommus visible to the iommu core and in sysfs. Signed-off-by: Joerg Roedel --- arch/s390/include/asm/pci.h | 7 +++ arch/s390/pci/pci.c | 5 + drivers/iommu/s390-iommu.c | 35

[PATCH] iommu/amd: Suppress IO_PAGE_FAULTs in kdump kernel

2017-06-16 Thread Joerg Roedel
From: Joerg Roedel When booting into a kdump kernel, suppress IO_PAGE_FAULTs by default for all devices. But allow the faults again when a domain is assigned to a device. Signed-off-by: Joerg Roedel --- drivers/iommu/amd_iommu.c | 3 ++- drivers/iommu/amd_iommu_init.c | 9

[PATCH 4/7] iommu/amd: Check for error states first in iommu_go_to_state()

2017-06-16 Thread Joerg Roedel
From: Joerg Roedel Check if we are in an error state already before calling into state_next(). Signed-off-by: Joerg Roedel --- drivers/iommu/amd_iommu_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c

[PATCH 0/7] iommu/amd: Disable previously enabled IOMMUs at boot

2017-06-16 Thread Joerg Roedel
x86/amd branch of the iommu-tree. Regards, Joerg Joerg Roedel (7): iommu/amd: Disable IOMMUs at boot if they are enabled iommu/amd: Rename free_on_init_error() iommu/amd: Add new init-state IOMMU_CMDLINE_DISABLED iommu/amd: Check for error states first in iommu_go_to_state

[PATCH 2/7] iommu/amd: Rename free_on_init_error()

2017-06-16 Thread Joerg Roedel
From: Joerg Roedel The function will also be used to free iommu resources when amd_iommu=off was specified on the kernel command line. So rename the function to reflect that. Signed-off-by: Joerg Roedel --- drivers/iommu/amd_iommu_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH 1/7] iommu/amd: Disable IOMMUs at boot if they are enabled

2017-06-16 Thread Joerg Roedel
From: Joerg Roedel When booting, make sure the IOMMUs are disabled. They could be previously enabled if we boot into a kexec or kdump kernel. So make sure they are off. Signed-off-by: Joerg Roedel --- drivers/iommu/amd_iommu_init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a

[PATCH 5/7] iommu/amd: Set global pointers to NULL after freeing them

2017-06-16 Thread Joerg Roedel
From: Joerg Roedel Avoid any tries to double-free these pointers. Signed-off-by: Joerg Roedel --- drivers/iommu/amd_iommu_init.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c index a31f375..d04898c 100644 --- a/drivers

[PATCH 3/7] iommu/amd: Add new init-state IOMMU_CMDLINE_DISABLED

2017-06-16 Thread Joerg Roedel
From: Joerg Roedel This will be used when during initialization we detect that the iommu should be disabled. Signed-off-by: Joerg Roedel --- drivers/iommu/amd_iommu_init.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu

[PATCH 6/7] iommu/amd: Free IOMMU resources when disabled on command line

2017-06-16 Thread Joerg Roedel
From: Joerg Roedel After we made sure that all IOMMUs have been disabled we need to make sure that all resources we allocated are released again. Signed-off-by: Joerg Roedel --- drivers/iommu/amd_iommu_init.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/iommu

[PATCH 7/7] iommu/amd: Remove amd_iommu_disabled check from amd_iommu_detect()

2017-06-16 Thread Joerg Roedel
From: Joerg Roedel This check needs to happens later now, when all previously enabled IOMMUs have been disabled. Signed-off-by: Joerg Roedel --- drivers/iommu/amd_iommu_init.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c

Re: [PATCH v6 26/34] iommu/amd: Allow the AMD IOMMU to work with memory encryption

2017-06-21 Thread Joerg Roedel
On Thu, Jun 15, 2017 at 11:41:12AM +0200, Borislav Petkov wrote: > On Wed, Jun 14, 2017 at 03:40:28PM -0500, Tom Lendacky wrote: > > > WARNING: Use of volatile is usually wrong: see > > > Documentation/process/volatile-considered-harmful.rst > > > #134: FILE: drivers/iommu/amd_iommu.c:866: > > > +

Re: [PATCH 0/8] io-pgtable lock removal

2017-06-21 Thread Joerg Roedel
On Wed, Jun 14, 2017 at 05:40:30PM -0700, Ray Jui wrote: > With the NVMf target test with 4 SSDs, fio based test, random read, 4k, > 8 jobs: > > Without IOMMU: > > IOPS = 1080K > > With IOMMU, but without your latest patch: > > IOPS = 520K > > With IOMMU and your latest patch: > > IOPS = 500K

Re: [patch 02/55] iommu/amd: Add name to irq chip

2017-06-21 Thread Joerg Roedel
On Tue, Jun 20, 2017 at 01:37:02AM +0200, Thomas Gleixner wrote: > Add the missing name, so debugging will work proper. > > Signed-off-by: Thomas Gleixner > Cc: Joerg Roedel > Cc: iommu@lists.linux-foundation.org Acked-by: Joerg Roedel __

Re: [patch 03/55] iommu/vt-d: Add name to irq chip

2017-06-21 Thread Joerg Roedel
On Tue, Jun 20, 2017 at 01:37:03AM +0200, Thomas Gleixner wrote: > Add the missing name, so debugging will work proper. > > Signed-off-by: Thomas Gleixner > Cc: Joerg Roedel > Cc: iommu@lists.linux-foundation.org Acked-by: Joerg Roedel __

Re: [patch 11/55] iommu/vt-d: Use named irq domain interface

2017-06-21 Thread Joerg Roedel
On Tue, Jun 20, 2017 at 01:37:11AM +0200, Thomas Gleixner wrote: > Signed-off-by: Thomas Gleixner > Cc: Joerg Roedel > Cc: iommu@lists.linux-foundation.org Acked-by: Joerg Roedel ___ iommu mailing list iommu@lists.linux-foundation.

Re: [patch 12/55] iommu/amd: Use named irq domain interface

2017-06-21 Thread Joerg Roedel
On Tue, Jun 20, 2017 at 01:37:12AM +0200, Thomas Gleixner wrote: > Signed-off-by: Thomas Gleixner > Cc: Joerg Roedel > Cc: iommu@lists.linux-foundation.org Acked-by: Joerg Roedel ___ iommu mailing list iommu@lists.linux-foundation.

Re: [PATCH v1 3/3] iommu/amd: Optimize the IOMMU queue flush

2017-06-22 Thread Joerg Roedel
On Wed, Jun 21, 2017 at 05:09:31PM -0400, Jan Vesely wrote: > On Wed, 2017-06-21 at 12:01 -0500, Tom Lendacky wrote: > > On 6/21/2017 11:20 AM, Jan Vesely wrote: > > > Hi Arindam, > > > > > > has this patch been replaced by Joerg's "[PATCH 0/7] iommu/amd: > > > Optimize iova queue flushing" series

[PATCH] iommu/amd: Free already flushed ring-buffer entries before full-check

2017-06-22 Thread Joerg Roedel
From: Joerg Roedel To benefit from IOTLB flushes on other CPUs we have to free the already flushed IOVAs from the ring-buffer before we do the queue_ring_full() check. Signed-off-by: Joerg Roedel --- drivers/iommu/amd_iommu.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions

Re: [PATCH v1 3/3] iommu/amd: Optimize the IOMMU queue flush

2017-06-22 Thread Joerg Roedel
On Thu, Jun 22, 2017 at 11:13:09AM -0400, Jan Vesely wrote: > It looks like I tested different patches. > linux-4.10.17 with both > "iommu/amd: Optimize iova queue flushing" This patch isn't in my tree and will not go upstream. > and > "iommu/amd: Disable previously enabled IOMMUs at boot" This

Re: [PATCH] iommu/amd: Suppress IO_PAGE_FAULTs in kdump kernel

2017-06-26 Thread Joerg Roedel
Hi Baoquan, On Fri, Jun 23, 2017 at 07:43:10PM +0800, Baoquan He wrote: > Do you think whether it's necessary to continue my kdump fix of amd iommu > patchset? Seems my last post was in Jan this year. I know you are very > busy on fixing bugs and reviewing tons of patches. Without your > guidance

Re: [PATCH v1 3/3] iommu/amd: Optimize the IOMMU queue flush

2017-06-26 Thread Joerg Roedel
On Fri, Jun 23, 2017 at 10:20:47AM -0400, Jan Vesely wrote: > I was able to trigger "Completion-Wait loop timed out" messages in the > following situation: > Hung OpenCL task running on dGPU. > dGPU goes to sleep. > sigterm to hung task. > it seems to recover OK after the dGPU is powered back on H

Re: [PATCH 1/2] iommu/s390: Use iommu_group_get_for_dev() in s390_iommu_add_device()

2017-06-27 Thread Joerg Roedel
Hi Gerald, sorry for the delay. Answers inline. On Fri, Jun 16, 2017 at 07:33:01PM +0200, Gerald Schaefer wrote: > Seems pretty straightforward, so > Reviewed-by: Gerald Schaefer Thanks, I add it to the patch. > With generic_device_group() returning NULL in case the allocation failed, > this p

Re: [PATCH 2/2] iommu/s390: Add support for iommu_device handling

2017-06-27 Thread Joerg Roedel
On Mon, Jun 19, 2017 at 05:02:19PM +0200, Gerald Schaefer wrote: > On Thu, 15 Jun 2017 15:11:52 +0200 > Joerg Roedel wrote: > > + rc = zpci_init_iommu(zdev); > > + if (rc) > > + goto out_free; > > + > > After this point, there are two opt

Re: [PATCH v1 3/3] iommu/amd: Optimize the IOMMU queue flush

2017-06-28 Thread Joerg Roedel
[Adding Alex Deucher] Hey Alex, On Tue, Jun 27, 2017 at 12:24:35PM -0400, Jan Vesely wrote: > On Mon, 2017-06-26 at 14:14 +0200, Joerg Roedel wrote: > > How does that 'dGPU goes to sleep' work? Do you put it to sleep manually > > via sysfs or something? Or is that some

Re: [GIT PULL] iommu/arm-smmu: Updates for 4.13

2017-06-28 Thread Joerg Roedel
On Mon, Jun 26, 2017 at 11:42:42AM +0100, Will Deacon wrote: > The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6: > > Linux 4.12-rc1 (2017-05-13 13:19:49 -0700) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/will/linux.

Re: [PATCH] iommu/vt-d: constify intel_dma_ops.

2017-06-28 Thread Joerg Roedel
On Tue, Jun 13, 2017 at 03:48:34PM +0530, Arvind Yadav wrote: > File size before: >text data bss dec hex filename > 32765 7581824 353478a13 drivers/iommu/intel-iommu.o > > File size After adding 'const': >text data bss dec hex

Re: [PATCH v2] iommu/amd: Fix interrupt remapping when disable guest_mode

2017-06-28 Thread Joerg Roedel
y: Suravee Suthikulpanit > Cc: Joerg Roedel Can you please provide a 'Fixes:' tag too? No need to resend the whole patch, just reply with the tag and I'll add it when applying this patch. Thanks, Joerg ___ iommu mai

Re: [PATCH 2/3] iommu/iova: don't disable preempt around this_cpu_ptr()

2017-06-28 Thread Joerg Roedel
On Tue, Jun 27, 2017 at 06:16:47PM +0200, Sebastian Andrzej Siewior wrote: > Commit 583248e6620a ("iommu/iova: Disable preemption around use of > this_cpu_ptr()") disables preemption while accessing a per-CPU variable. > This does keep lockdep quiet. However I don't see the point why it is > bad if

Re: [PATCH v8 RESEND 27/38] iommu/amd: Allow the AMD IOMMU to work with memory encryption

2017-06-28 Thread Joerg Roedel
name suggests that it checks whether the iommu hardware supports SME. How about renaming it to amd_iommu_sme_check()? With that change the patch is: Acked-by: Joerg Roedel ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH 1/9] iommu: Introduce bind_pasid_table API function

2017-06-28 Thread Joerg Roedel
On Tue, Jun 27, 2017 at 12:47:55PM -0700, Jacob Pan wrote: > +int iommu_bind_pasid_table(struct iommu_domain *domain, struct device *dev, > + struct pasid_table_info *pasidt_binfo) > +{ > + if (unlikely(!domain->ops->bind_pasid_table)) > + return -EINVAL; I thin

Re: [PATCH 2/9] iommu/vt-d: add bind_pasid_table function

2017-06-28 Thread Joerg Roedel
On Tue, Jun 27, 2017 at 12:47:56PM -0700, Jacob Pan wrote: > Add Intel VT-d ops to the generic iommu_bind_pasid_table API > functions. > > The primary use case is for direct assignment of SVM capable > device. Originated from emulated IOMMU in the guest, the request goes > through many layers (e.g

Re: [PATCH 3/9] iommu: Introduce iommu do invalidate API function

2017-06-28 Thread Joerg Roedel
On Tue, Jun 27, 2017 at 12:47:57PM -0700, Jacob Pan wrote: > From: "Liu, Yi L" > > When a SVM capable device is assigned to a guest, the first level page > tables are owned by the guest and the guest PASID table pointer is > linked to the device context entry of the physical IOMMU. > > Host IOMM

Re: [PATCH 5/9] iommu: Introduce fault notifier API

2017-06-28 Thread Joerg Roedel
On Tue, Jun 27, 2017 at 12:47:59PM -0700, Jacob Pan wrote: > diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c > index d973555..07cfd92 100644 > --- a/drivers/iommu/iommu.c > +++ b/drivers/iommu/iommu.c > @@ -48,6 +48,7 @@ struct iommu_group { > struct list_head devices; > stru

Re: [PATCH] iommu/vt-d: constify intel_dma_ops.

2017-06-28 Thread Joerg Roedel
On Wed, Jun 28, 2017 at 03:31:16PM +0530, Arvind Yadav wrote: > Most dma_map_ops structures are never modified. Constify these > structures such that these can be write-protected. This file size diff > will show the difference between data and text segment. I know what the diff shows, but it doesn

Re: [PATCH 2/3] iommu/iova: don't disable preempt around this_cpu_ptr()

2017-06-28 Thread Joerg Roedel
On Wed, Jun 28, 2017 at 11:31:55AM +0200, Sebastian Andrzej Siewior wrote: > It really does. The spin_lock() does disable preemption but this is not > the problem. The thing is that the preempt_disable() is superfluous and > it hurts Preempt-RT (and this is how I noticed it). Also the > get_cpu_ptr

[PATCH 1/3] iommu: Return ERR_PTR() values from device_group call-backs

2017-06-28 Thread Joerg Roedel
From: Joerg Roedel The generic device_group call-backs in iommu.c return NULL in case of error. Since they are getting ERR_PTR values from iommu_group_alloc(), just pass them up instead. Reported-by: Gerald Schaefer Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 14 ++ 1

[PATCH 3/3] iommu: Warn once when device_group callback returns NULL

2017-06-28 Thread Joerg Roedel
From: Joerg Roedel This callback should never return NULL. Print a warning if that happens so that we notice and can fix it. Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index de09e1e

[PATCH 2/3] iommu/omap: Return ERR_PTR in device_group call-back

2017-06-28 Thread Joerg Roedel
From: Joerg Roedel Make sure that the device_group callback returns an ERR_PTR instead of NULL. Signed-off-by: Joerg Roedel --- drivers/iommu/omap-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index 95dfca3

Re: [PATCH v2] iommu/vt-d: constify intel_dma_ops

2017-06-28 Thread Joerg Roedel
On Wed, Jun 28, 2017 at 04:39:32PM +0530, Arvind Yadav wrote: > Most dma_map_ops structures are never modified. Constify these > structures such that these can be write-protected. > > Signed-off-by: Arvind Yadav > --- > Changes in v2: > Added description. > > drivers/iommu/intel-i

Re: [PATCH v2] iommu/amd: Fix interrupt remapping when disable guest_mode

2017-06-28 Thread Joerg Roedel
pass-through device is setup to use vAPIC regardless of guest_mode. > This could cause invalid interrupt remapping. > > Also, the guest_mode bit should be set and cleared only when > SVM updates posted-interrupt interrupt remapping information. > > Signed-off-by: Suravee Sut

[git pull] IOMMU Fixes for Linux v4.12-rc7

2017-06-30 Thread Joerg Roedel
Hi Linus, The following changes since commit 32c1431eea4881a6b17bd7c639315010aeefa452: Linux 4.12-rc5 (2017-06-11 16:48:20 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git tags/iommu-fixes-v4.12-rc7 for you to fetch changes up to

[git pull] IOMMU Updates for Linux v4.13

2017-07-12 Thread Joerg Roedel
nction to query if a pasid has any active users Geetha Sowjanya (1): iommu/arm-smmu-v3: Add workaround for Cavium ThunderX2 erratum #126 Joerg Roedel (23): iommu/amd: Ratelimit io-page-faults per device iommu/amd: Rip out old queue flushing code iommu/amd: Add per-domain flush-

Re: [PATCH] iommu/amd: Suppress IO_PAGE_FAULTs in kdump kernel

2017-07-20 Thread Joerg Roedel
Hi Baoquan, On Thu, Jul 20, 2017 at 09:17:43PM +0800, Baoquan He wrote: > I have rebased the amd iommu fix patches of kdump kernel on the latest > upstream kernel, can I send them to you to have a look? Or just send to > iommu and lkml mailing list? Please send them to me and Cc iommu and lkml.

Re: [GIT PULL] iommu/arm-smmu: Fixes for 4.13

2017-07-25 Thread Joerg Roedel
On Mon, Jul 24, 2017 at 01:29:43PM +0100, Will Deacon wrote: > The following changes since commit 5771a8c08880cdca3bfb4a3fc6d309d6bba20877: > > Linux v4.13-rc1 (2017-07-15 15:22:10 -0700) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/will/linux

Re: [PATCH] iommu/amd: Enable ga_log_intr when enabling guest_mode

2017-07-25 Thread Joerg Roedel
On Wed, Jul 05, 2017 at 09:29:59PM -0500, Suravee Suthikulpanit wrote: > drivers/iommu/amd_iommu.c | 1 + > 1 file changed, 1 insertion(+) Applied to iommu/fixes, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfounda

Re: [PATCH v1 0/4] iommu/tegra: gart: Couple corrections

2017-07-25 Thread Joerg Roedel
On Wed, Jul 05, 2017 at 07:29:44PM +0300, Dmitry Osipenko wrote: > I've added an experimental support of the GART to the Tegra DRM driver > and it ended up with a very positive result. During the testing of the > GART driver I've noticed couple of its minor shortcomings, so here the > patches to re

Re: [PATCH 3/9] iommu: Introduce iommu do invalidate API function

2017-07-26 Thread Joerg Roedel
On Wed, Jul 05, 2017 at 07:57:57AM +, Tian, Kevin wrote: > > > struct tlb_invalidate_info > > > { > > > __u32 model; /* Vendor number */ I don't like to have a model-specifier here, as I don't think its needed. > > > __u8 granularity > > > #define DEVICE_SELECTVIE_INV(1

Re: [PATCH] iommu/of: Handle PCI aliases properly

2017-07-26 Thread Joerg Roedel
On Wed, May 31, 2017 at 06:52:29PM +0100, Robin Murphy wrote: > When a PCI device has DMA quirks, we need to ensure that an upstream > IOMMU knows about all possible aliases, since the presence of a DMA > quirk does not preclude the device still also emitting transactions > (e.g. MSIs) on its 'real

Re: [PATCH] iommu/vt-d: Don't free parent pagetable of the PTE we're adding

2017-07-26 Thread Joerg Roedel
On Wed, Jun 28, 2017 at 07:42:23PM -0700, David Dillow wrote: > When adding a large scatterlist entry that covers more than the L3 > superpage size (1GB) but has an alignment such that we must use L2 > superpages (2MB) , we give dma_pte_free_level() a range that causes it > to free the L3 pagetable

Re: [PATCH v2 1/2] iommu/dma: Respect __GFP_DMA and __GFP_DMA32 in incoming GFP flags

2017-07-26 Thread Joerg Roedel
On Tue, Jul 04, 2017 at 10:55:55PM +0900, Tomasz Figa wrote: > Current implementation of __iommu_dma_alloc_pages() keeps adding > __GFP_HIGHMEM to GFP flags regardless of whether other zone flags are > already included in the incoming flags. If __GFP_DMA or __GFP_DMA32 is > set at the same time as

Re: [PATCH v2 2/2] iommu/dma: Use __GFP_NOWARN only for high-order allocations

2017-07-26 Thread Joerg Roedel
On Tue, Jul 04, 2017 at 10:55:56PM +0900, Tomasz Figa wrote: > diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c > index bf23989b5158..6ed8c8f941d8 100644 > --- a/drivers/iommu/dma-iommu.c > +++ b/drivers/iommu/dma-iommu.c > @@ -433,6 +433,7 @@ static struct page **__iommu_dma_allo

Re: [PATCH] iommu: Correct iommu_map / iommu_unmap prototypes

2017-07-26 Thread Joerg Roedel
On Wed, Jul 05, 2017 at 08:27:53PM +0300, Dmitry Osipenko wrote: > Commit 7d3002cc8c16 ("iommu/core: split mapping to page sizes as supported > by the hardware") replaced 'int gfp_order' with a 'size_t size' of > iommu_map / iommu_unmap function arguments, but missed the function > prototypes for t

Re: [PATCH kernel v4 4/6] iommu: Set PCI_BUS_FLAGS_MSI_REMAP on iommu driver initialization

2017-07-26 Thread Joerg Roedel
On Wed, Jul 19, 2017 at 08:02:04PM +1000, Alexey Kardashevskiy wrote: > On 11/07/17 05:23, Bjorn Helgaas wrote: > >> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c > >> index cf7ca7e70777..0b5881ddca09 100644 > >> --- a/drivers/iommu/iommu.c > >> +++ b/drivers/iommu/iommu.c > >> @@ -106

Re: [PATCH] iommu/exynos: Replace non-existing big-endian Kconfig option

2017-07-26 Thread Joerg Roedel
On Mon, Jul 17, 2017 at 07:47:02AM +0200, Krzysztof Kozlowski wrote: > Wrong Kconfig option was used when adding warning for untested > big-endian capabilities. There is no CONFIG_BIG_ENDIAN option. > > Signed-off-by: Krzysztof Kozlowski > --- > drivers/iommu/exynos-iommu.c | 2 +- > 1 file chan

Re: [PATCH v2 01/05] iommu/ipmmu-vmsa: Use iommu_device_register()/unregister()

2017-07-26 Thread Joerg Roedel
On Mon, Jul 17, 2017 at 10:05:10PM +0900, Magnus Damm wrote: > --- 0001/drivers/iommu/ipmmu-vmsa.c > +++ work/drivers/iommu/ipmmu-vmsa.c 2017-07-17 21:01:47.140607110 +0900 > @@ -35,6 +35,7 @@ > struct ipmmu_vmsa_device { > struct device *dev; > void __iomem *base; > + struct iom

Re: [PATCH 1/4] ARM64: dts: rockchip: rk3328 add iommu nodes

2017-07-26 Thread Joerg Roedel
On Tue, Jul 18, 2017 at 06:02:02PM +0800, Simon Xue wrote: > From: Simon > > Add H265e/VEPU/VPU/VDEC/VOP iommu nodes > > Signed-off-by: Simon > --- > arch/arm64/boot/dts/rockchip/rk3328.dtsi | 45 > > 1 file changed, 45 insertions(+) Applied all, thanks.

Re: [PATCH V3 1/3] Docs: dt: rockchip: add rockchip,disable-mmu-reset property

2017-07-26 Thread Joerg Roedel
On Mon, Jul 24, 2017 at 10:37:13AM +0800, Simon Xue wrote: > Add rockchip,disable-mmu-reset property to disable some mmu > reset operation > > Signed-off-by: Simon Xue > --- > changes since V2: > use rockchip,disable-mmu-reset instead of rk-iommu,disable-reset-quirk Applied all, thanks. ___

Re: [PATCH V3 1/4] ARM64: dts: rockchip: rk3328 add iommu nodes

2017-07-26 Thread Joerg Roedel
On Mon, Jul 24, 2017 at 10:32:07AM +0800, Simon Xue wrote: > Add H265e/VEPU/VPU/VDEC/VOP iommu nodes > > Signed-off-by: Simon Xue > --- > changes since V2: > - none > > arch/arm64/boot/dts/rockchip/rk3328.dtsi | 45 > > 1 file changed, 45 insertions(+) Applie

Re: [PATCH] iommu: Convert to using %pOF instead of full_name

2017-07-26 Thread Joerg Roedel
On Tue, Jul 18, 2017 at 04:43:09PM -0500, Rob Herring wrote: > Now that we have a custom printf format specifier, convert users of > full_name to use %pOF instead. This is preparation to remove storing > of the full path string for each node. > > Signed-off-by: Rob Herring >

Re: [PATCH v2 0/4] Optimise 64-bit IOVA allocations

2017-07-26 Thread Joerg Roedel
Hi Robin. On Fri, Jul 21, 2017 at 12:41:57PM +0100, Robin Murphy wrote: > Hi all, > > In the wake of the ARM SMMU optimisation efforts, it seems that certain > workloads (e.g. storage I/O with large scatterlists) probably remain quite > heavily influenced by IOVA allocation performance. Separatel

Re: [PATCH 0/4] IOMMU group cleanup

2017-07-26 Thread Joerg Roedel
Hi Robin, On Fri, Jul 21, 2017 at 01:12:34PM +0100, Robin Murphy wrote: > Robin Murphy (4): > iommu/msm: Add iommu_group support > iommu/tegra-smmu: Add iommu_group support > iommu/tegra-gart: Add iommu_group support > iommu: Finish making iommu_group support mandatory > > drivers/iommu/

[PATCH] iommu/amd: Fix schedule-while-atomic BUG in initialization code

2017-07-26 Thread Joerg Roedel
t; + } else { > + register_syscore_ops(&amd_iommu_syscore_ops); > } > > return ret; Yes, that should fix it, but I think its better to just move the register_syscore_ops() call to a later initialization step, like in the patch below. I tested it an will qu

Re: [PATCH V3 1/4] ARM64: dts: rockchip: rk3328 add iommu nodes

2017-07-26 Thread Joerg Roedel
Hey Heiko, On Wed, Jul 26, 2017 at 01:44:02PM +0200, Heiko Stübner wrote: > I really would prefer iommu dt-nodes going through my tree :-) > > Especially as parts of these conflict with already pending patches for > graphics support and with the iommu nodes sitting in your tree these > would need

Re: [PATCH] iommu/amd: Fix schedule-while-atomic BUG in initialization code

2017-07-26 Thread Joerg Roedel
On Wed, Jul 26, 2017 at 03:25:05PM +0200, Artem Savkov wrote: > On Wed, Jul 26, 2017 at 02:26:14PM +0200, Joerg Roedel wrote: > > Yes, that should fix it, but I think its better to just move the > > register_syscore_ops() call to a later initialization step, like in the > >

Re: [PATCH V3 1/4] ARM64: dts: rockchip: rk3328 add iommu nodes

2017-07-27 Thread Joerg Roedel
Hey Heiko, On Wed, Jul 26, 2017 at 03:53:06PM +0200, Heiko Stübner wrote: > Having code and dts changes go through different trees is no problem, as they > don't have a compile-time dependencies on each other and come together nicely > in linux-next again. Okay, I removed ARM64: dts: rockchip:

Re: [PATCH V3 1/4] ARM64: dts: rockchip: rk3328 add iommu nodes

2017-07-27 Thread Joerg Roedel
On Thu, Jul 27, 2017 at 02:26:26PM +0200, Heiko Stübner wrote: > Am Donnerstag, 27. Juli 2017, 14:15:18 CEST schrieb Joerg Roedel: > > ARM64: dts: rockchip: rk3328 add iommu nodes > > ARM: dts: rockchip: rk322x add iommu nodes > > ARM64: dts: rockchip: rk3368 add iommu

Re: [PATCH 0/3] Add larbid init routine for mediatek's gen1 smi larb driver

2017-07-27 Thread Joerg Roedel
On Thu, Jul 27, 2017 at 10:01:09AM +0800, honghui.zh...@mediatek.com wrote: > From: Honghui Zhang > > Mediatek's gen1 smi need the hardware larbid to identify the offset for > the register which controls whether enable iommu for this larb. > In the commit 3c8f4ad85c4b ("memory/mediatek: add suppo

Re: [PATCH v8 01/13] iommu/amd: Detect pre enabled translation

2017-07-27 Thread Joerg Roedel
On Fri, Jul 21, 2017 at 04:58:59PM +0800, Baoquan He wrote: > diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h > index 294a409e283b..d15966b62b33 100644 > --- a/drivers/iommu/amd_iommu_types.h > +++ b/drivers/iommu/amd_iommu_types.h > @@ -417,6 +417,7 @@ extern struct

Re: [PATCH v8 02/13] iommu/amd: add several helper functions

2017-07-27 Thread Joerg Roedel
On Fri, Jul 21, 2017 at 04:59:00PM +0800, Baoquan He wrote: > Move single iommu enabling codes into a wrapper function early_enable_iommu(). > This can make later kdump change easier. > > And also add iommu_disable_command_buffer and iommu_disable_event_buffer > for later usage. > > Signed-off-by

Re: [PATCH v8 05/13] iommu/amd: Add function copy_dev_tables()

2017-07-27 Thread Joerg Roedel
On Fri, Jul 21, 2017 at 04:59:03PM +0800, Baoquan He wrote: > Add function copy_dev_tables to copy the old DEV table entries of the panicked Since there is only one (for now), you can name the function in singular: copy_dev_table() or copy_device_table(). > kernel to the new allocated DEV table.

Re: [PATCH] iommu: moving initialization earlier

2013-01-10 Thread Joerg Roedel
On Mon, Jan 07, 2013 at 06:51:52PM +1100, Alexey Kardashevskiy wrote: > The iommu_init() initializes IOMMU internal structures and data > required for the IOMMU API as iommu_group_alloc(). > It is registered as a subsys_initcall now. > > One of the IOMMU users is going to be a PCI subsystem on POW

Re: [PATCH v6 00/12] iommu/exynos: Fixes and Enhancements of System MMU driver with DT

2013-01-10 Thread 'Joerg Roedel'
On Mon, Dec 31, 2012 at 10:18:46AM -0800, Kukjin Kim wrote: > Cho KyongHo wrote: > > Diffstats: > > arch/arm/boot/dts/exynos5250-smdk5250.dts |2 +- > > arch/arm/boot/dts/exynos5250.dtsi | 27 +- > > arch/arm/mach-exynos/Kconfig |5 - > > arch/arm/mach-exynos/Mak

Re: [PATCH v5 1/4] iommu/shmobile: Add iommu driver for Renesas IPMMU modules

2013-01-10 Thread Joerg Roedel
Hi, On Mon, Jan 07, 2013 at 07:11:58PM +0100, Laurent Pinchart wrote: > > + l2index = (iova >> 12) & 0xff; > > + spin_lock(&sh_domain->map_lock); > > + ret = l2alloc(sh_domain, l1index); > > l2alloc calls dma_pool_alloc(GFP_KERNEL), that not safe in a non-sleepable

Re: [PATCH v6 00/12] iommu/exynos: Fixes and Enhancements of System MMU driver with DT

2013-01-10 Thread 'Joerg Roedel'
On Thu, Jan 10, 2013 at 10:06:24AM -0800, Kukjin Kim wrote: > You know, we have several options to avoid it. When you take this series in > your tree, you can provide topic branch for me. Or this series should be > separated for arch/arm/ and drivers/ for both trees, then only drivers/iommu > chang

Re: [PATCH v6 00/12] iommu/exynos: Fixes and Enhancements of System MMU driver with DT

2013-01-10 Thread 'Joerg Roedel'
On Thu, Jan 10, 2013 at 10:34:48AM -0800, Kukjin Kim wrote: > Hmm, I think, just one [7/12] patch does matter so if you could create topic > branch and apply [7/12] patch firstly before other drivers/ changes would be > better to me. It's OK on both trees if I just _merge_ the first [7/12] > commit

Re: [PATCH] iommu: moving initialization earlier

2013-01-11 Thread Joerg Roedel
On Thu, Jan 10, 2013 at 01:40:17PM -0700, Shuah Khan wrote: > I am currently debugging IO_PAGE_FAULTS on 3.6.11 (happens on all > pre-3.7 releases). I root-caused the reason 3.7 works is because in > 3.7 amd iommu driver moving up the early iommu initialization from > irq_remap_ops with the irq rem

Re: [PATCH v6 00/12] iommu/exynos: Fixes and Enhancements of System MMU driver with DT

2013-01-11 Thread 'Joerg Roedel'
Hi Kukjin, On Thu, Jan 10, 2013 at 11:33:41AM -0800, Kukjin Kim wrote: > Sure, keep going on with > > Acked-by: Kukjin Kim Done that. Applied the patch, some manual work was necessary as the patch didn't apply cleanly to v3.8-rc3. Please double-check if the result is correct. > OK, good. Let m

Re: [PATCH 1/1] AMD Family15h Model10-1Fh erratum 746 Workaround

2013-01-22 Thread Joerg Roedel
On Tue, Jan 22, 2013 at 05:19:10PM -0600, Suthikulpanit, Suravee wrote: > From: Suravee Suthikulpanit > @@ -1171,6 +1195,8 @@ static int iommu_init_pci(struct amd_iommu *iommu) > for (i = 0; i < 0x83; i++) > iommu->stored_l2[i] = iommu_read_l2(iommu, i); >

[git pull] ioapic-cleanups-for-v3.9

2013-01-25 Thread Joerg Roedel
interrupt remapping). The systems were tested with IOMMU enabled and with IOMMU disabled. No issues were found. Joerg Roedel (19): x86, apic: Move irq_remapping_enabled checks into IRQ-remapping code x86, apic: Mask IO-APIC and

Re: [git pull] ioapic-cleanups-for-v3.9

2013-01-25 Thread Joerg Roedel
On Fri, Jan 25, 2013 at 11:49:15AM +0100, Ingo Molnar wrote: > Hm, there are some not so trivial looking conflicts in > io_apic.c, due to the MSI patches I applied yesterday: > > 5ca72c4f7c41 AHCI: Support multiple MSIs > 08261d87f7d1 PCI/MSI: Enable multiple MSIs with pci_enable_msi_block_auto

Re: [PATCH V4] IOMMU, AMD Family15h Model10-1Fh erratum 746 Workaround

2013-01-28 Thread Joerg Roedel
On Thu, Jan 24, 2013 at 01:17:53PM -0600, Suthikulpanit, Suravee wrote: > From: Suravee Suthikulpanit > Signed-off-by: Suravee Suthikulpanit > --- > Changelog: > v4: > * Fix style and spacing > > v3: > * Add proper commit message > * Change logic to avoid unnecessary indentaio

Re: [PATCH 1/3] AMD x86 quirks: Quirk for enabling IOMMUv2 PC feature

2013-01-28 Thread Joerg Roedel
On Mon, Jan 21, 2013 at 02:20:56PM -0600, Steven L. Kinney wrote: > From: "Steven L. Kinney" > > Original code base by Andreas Herrmann at AMD with minor changes. Why is it safe to enable this feature when it was disabled by BIOS? Was it disabled for no reason? Joerg _

Re: [PATCH 1/3] AMD x86 quirks: Quirk for enabling IOMMUv2 PC feature

2013-01-28 Thread Joerg Roedel
On Mon, Jan 28, 2013 at 02:59:25PM +, Kinney, Steven wrote: > Testing with perf shows expected results. Can you give me an impression on how the results look like when perf is used? Since the hardware is widely available yet I can't try this myself. Joerg __

Re: [git pull] ioapic-cleanups-for-v3.9

2013-01-28 Thread Joerg Roedel
with IOMMU disabled. No issues were found. -------- Joerg Roedel (19): x86, apic: Move irq_remapping_enabled checks into IRQ-remapping code x86, apic: Mask IO-APIC and PIC unconditionally on LAPIC resume

[git pull] IOMMU Fixes for v3.8-rc5

2013-01-28 Thread Joerg Roedel
Hi Linus, The following changes since commit 949db153b6466c6f7cad5a427ecea94985927311: Linux 3.8-rc5 (2013-01-25 11:57:28 -0800) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git tags/iommu-fixes-v3.8-rc5 for you to fetch changes up to 31

[PATCH 1/4] iommu: Make sure DOMAIN_ATTR_MAX is really the maximum

2013-01-30 Thread Joerg Roedel
Move it to the end of the list. Signed-off-by: Joerg Roedel --- include/linux/iommu.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index f3b99e1..7e6ce72 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h

[PATCH 2/4] iommu: Check for valid pgsize_bitmap in iommu_map/unmap

2013-01-30 Thread Joerg Roedel
In case the page-size bitmap is zero the code path in iommu_map and iommu_unmap is undefined. Make it defined and return -ENODEV in this case. Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/iommu.c

[PATCH 0/4] iommu: Support non-paging IOMMUs

2013-01-30 Thread Joerg Roedel
Hi Varun, here is a patch-set that implements (what I think are) the necessary IOMMU-API extensions to support the PAMU. Please have a look at it and tell me if it fits your needs. Regards, Joerg ___ iommu mailing list iommu@lists.linux-foun

[PATCH 4/4] iommu: Add domain window handling functions

2013-01-30 Thread Joerg Roedel
Add the iommu_domain_wnd_enable() and iommu_domain_wnd_disable() functions to the IOMMU-API. These functions will be used to setup domains that are based on subwindows and not on paging. Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 20 include/linux/iommu.h

[PATCH 3/4] iommu: Implement DOMAIN_ATTR_PAGING attribute

2013-01-30 Thread Joerg Roedel
This attribute of a domain can be queried to find out if the domain supports setting up page-tables using the iommu_map() and iommu_unmap() functions. Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c |5 + include/linux/iommu.h |1 + 2 files changed, 6 insertions(+) diff --git

Re: IO_PAGE_FAULTs on unity mapped regions during amd_iommu_init() in Linux 3.4

2013-02-01 Thread Joerg Roedel
Hi Shuah, On Thu, Jan 31, 2013 at 11:33:30AM -0700, Shuah Khan wrote: > Access to these ranges continues to work with no errors until AMD IOMMU > driver disables and re-enables IOMMU in enable_iommus(). These faults > don't persist and appear between the enable_iommus() call and before > amd_iommu

Re: [PATCH v6 05/12] iommu/exynos: support for device tree

2013-02-01 Thread Joerg Roedel
Cho, On Wed, Jan 02, 2013 at 02:53:49PM +0900, KyongHo Cho wrote: > On Tuesday, January 1, 2013, Sylwester Nawrocki > > Cc: devicetree-disc...@lists.ozlabs.org Since patch 7 of this set is already merged, do you mind to re-post the rest of this patch-set with the latest comments addressed? I ca

Re: [PATCH v6 1/4] iommu/shmobile: Add iommu driver for Renesas IPMMU modules

2013-02-01 Thread Joerg Roedel
On Mon, Jan 21, 2013 at 07:54:26PM +0900, Hideki EIRAKU wrote: > This is the Renesas IPMMU driver and IOMMU API implementation. > > The IPMMU module supports the MMU function and the PMB function. The > MMU function provides address translation by pagetable compatible with > ARMv6. The PMB funct

Re: [PATCH v6 0/4] Renesas IPMMU driver for sh7372, sh73a0 and r8a7740

2013-02-01 Thread Joerg Roedel
On Mon, Jan 21, 2013 at 07:54:25PM +0900, Hideki EIRAKU wrote: > Hideki EIRAKU (4): > iommu/shmobile: Add iommu driver for Renesas IPMMU modules > ARM: mach-shmobile: sh7372: Add IPMMU device > ARM: mach-shmobile: sh73a0: Add IPMMU device > ARM: mach-shmobile: r8a7740: Add IPMMU device Pau

Re: [PATCH 4/4] iommu: Add domain window handling functions

2013-02-04 Thread Joerg Roedel
On Thu, Jan 31, 2013 at 09:32:26AM +, Sethi Varun-B16395 wrote: > We need a mechanism to determine the maximum number of subwindows supported > by PAMU. How about representing it in the iommu_domain structure: > struct iommu_domain { > struct iommu_ops *ops; > void *priv; >

<    1   2   3   4   5   6   7   8   9   10   >