Re: [PATCH 3/6] iommu/vt-d: Don't force 32bit devices to uses DMA domain

2020-03-10 Thread Joerg Roedel
On Sat, Mar 07, 2020 at 03:21:44PM +0100, Christoph Hellwig wrote: > Can we add a new AUTO domain which will allow using the identity > mapping when available? That somewhat matches the existing x86 > default, and also what powerpc does. I have a series to lift > that bypass mode into the core dm

Re: [Patch V1 0/2] iommu/vtd: Fixes to the IOMMU debugfs

2020-03-10 Thread Joerg Roedel
On Tue, Mar 10, 2020 at 08:50:47AM +0800, Lu Baolu wrote: > Thanks for the fixes. For two patches in this series: > > Acked-by: Lu Baolu > > Best regards, > baolu > > On 2020/3/10 4:09, Megha Dey wrote: > > This patchset aims to fix some of the existing issues in the iommu debugfs. > > > > The

Re: [PATCH] iommu/vt-d: quirk_ioat_snb_local_iommu: replace WARN_TAINT with pr_warn + add_taint

2020-03-10 Thread Joerg Roedel
On Mon, Mar 09, 2020 at 07:25:10PM +0100, Hans de Goede wrote: > Quoting from the comment describing the WARN functions in > include/asm-generic/bug.h: > > * WARN(), WARN_ON(), WARN_ON_ONCE, and so on can be used to report > * significant kernel issues that need prompt attention if they should e

Re: [PATCH 0/2] iommu/vt-d: replace WARN_TAINT with pr_warn + add_taint

2020-03-10 Thread Joerg Roedel
On Mon, Mar 09, 2020 at 03:01:36PM +0100, Hans de Goede wrote: > Can we please get these 2 patches queued up as fixes for 5.6-rc# ? Applied both for v5.6, thanks. > ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.or

Re: [PATCH -next] iommu/dmar: silence RCU-list debugging warnings

2020-03-10 Thread Joerg Roedel
On Thu, Mar 05, 2020 at 03:15:02PM -0500, Qian Cai wrote: > drivers/iommu/dmar.c | 3 ++- > include/linux/dmar.h | 6 -- > 2 files changed, 6 insertions(+), 3 deletions(-) Applied, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org http

Re: [PATCH] iommu/vt-d: fix RCU-list bugs in intel_iommu_init

2020-03-10 Thread Joerg Roedel
On Thu, Mar 05, 2020 at 03:00:46PM -0500, Qian Cai wrote: > drivers/iommu/intel-iommu.c | 5 - > 1 file changed, 4 insertions(+), 1 deletion(-) Applied, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.or

Re: [iommu:arm/omap 4/4] drivers/gpu/drm/rockchip/rockchip_drm_gem.c:134:20: error: implicit declaration of function 'vmap'; did you mean 'bmap'?

2020-03-10 Thread Joerg Roedel
On Thu, Mar 05, 2020 at 09:50:57AM +0100, Krzysztof Kozlowski wrote: > +Cc Heiko, > > This is already fixed in drm-misc here: > https://patchwork.freedesktop.org/patch/347106/ Is it possible to carry this fix in the IOMMU tree? Regards, Joerg ___

[PATCH 02/15] ACPI/IORT: Remove direct access of dev->iommu_fwspec

2020-03-10 Thread Joerg Roedel
From: Joerg Roedel Use the accessor functions instead of directly dereferencing dev->iommu_fwspec. Tested-by: Hanjun Guo Signed-off-by: Joerg Roedel --- drivers/acpi/arm64/iort.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/arm64/iort.c b/driv

[PATCH 01/15] iommu: Define dev_iommu_fwspec_get() for !CONFIG_IOMMU_API

2020-03-10 Thread Joerg Roedel
From: Joerg Roedel There are users outside of the IOMMU code that need to call that function. Define it for !CONFIG_IOMMU_API too so that compilation does not break. Reported-by: kbuild test robot Signed-off-by: Joerg Roedel --- include/linux/iommu.h | 4 1 file changed, 4 insertions

[PATCH 11/15] iommu/renesas: Use accessor functions for iommu private data

2020-03-10 Thread Joerg Roedel
From: Joerg Roedel Make use of dev_iommu_priv_set/get() functions. Signed-off-by: Joerg Roedel --- drivers/iommu/ipmmu-vmsa.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index ecb3f9464dd5..310cf09feea3

[PATCH 12/15] iommu/mediatek: Use accessor functions for iommu private data

2020-03-10 Thread Joerg Roedel
From: Joerg Roedel Make use of dev_iommu_priv_set/get() functions. Signed-off-by: Joerg Roedel --- drivers/iommu/mtk_iommu.c| 13 ++--- drivers/iommu/mtk_iommu_v1.c | 14 +++--- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b

[PATCH 03/15] drm/msm/mdp5: Remove direct access of dev->iommu_fwspec

2020-03-10 Thread Joerg Roedel
From: Joerg Roedel Use the accessor functions instead of directly dereferencing dev->iommu_fwspec. Signed-off-by: Joerg Roedel --- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c b/driv

[PATCH 10/15] iommu/arm-smmu: Use accessor functions for iommu private data

2020-03-10 Thread Joerg Roedel
From: Joerg Roedel Make use of dev_iommu_priv_set/get() functions and simplify the code where possible with this change. Tested-by: Will Deacon # arm-smmu Signed-off-by: Joerg Roedel --- drivers/iommu/arm-smmu.c | 56 +--- 1 file changed, 29 insertions

[PATCH 14/15] iommu/virtio: Use accessor functions for iommu private data

2020-03-10 Thread Joerg Roedel
From: Joerg Roedel Make use of dev_iommu_priv_set/get() functions. Signed-off-by: Joerg Roedel --- drivers/iommu/virtio-iommu.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c index cce329d71fba

[PATCH 09/15] iommu/arm-smmu-v3: Use accessor functions for iommu private data

2020-03-10 Thread Joerg Roedel
From: Joerg Roedel Make use of dev_iommu_priv_set/get() functions in the code. Tested-by: Hanjun Guo Signed-off-by: Joerg Roedel --- drivers/iommu/arm-smmu-v3.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu

[PATCH 05/15] iommu: Rename struct iommu_param to dev_iommu

2020-03-10 Thread Joerg Roedel
From: Joerg Roedel The term dev_iommu aligns better with other existing structures and their accessor functions. Tested-by: Will Deacon # arm-smmu Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 28 ++-- include/linux/device.h | 6 +++--- include/linux

[PATCH 15/15] iommu: Move fwspec->iommu_priv to struct dev_iommu

2020-03-10 Thread Joerg Roedel
From: Joerg Roedel Move the pointer for iommu private data from struct iommu_fwspec to struct dev_iommu. Tested-by: Will Deacon # arm-smmu Signed-off-by: Joerg Roedel --- include/linux/iommu.h | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/linux/iommu.h b

[PATCH 07/15] iommu/arm-smmu: Fix uninitilized variable warning

2020-03-10 Thread Joerg Roedel
From: Joerg Roedel Some unrelated changes in the iommu code caused a new warning to appear in the arm-smmu driver: CC drivers/iommu/arm-smmu.o drivers/iommu/arm-smmu.c: In function 'arm_smmu_add_device': drivers/iommu/arm-smmu.c:1441:2: warning: 'smmu' may be used un

[PATCH 06/15] iommu: Move iommu_fwspec to struct dev_iommu

2020-03-10 Thread Joerg Roedel
From: Joerg Roedel Move the iommu_fwspec pointer in struct device into struct dev_iommu. This is a step in the effort to reduce the iommu related pointers in struct device to one. Tested-by: Will Deacon # arm-smmu Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 3 +++ include/linux

[PATCH 00/15 v2] iommu: Move iommu_fwspec out of 'struct device'

2020-03-10 Thread Joerg Roedel
sting of these drivers is greatly appreciated. Please review. Regards, Joerg Changes to v1: - Rebased to v5.6-rc5 - Fixed compile error with CONFIG_IOMMU_API=n - Added Jean-Philippes fix to the ACPI/IORT patch Joerg Roedel (15): iommu: Define dev_iommu_fwspe

[PATCH 04/15] iommu/tegra-gart: Remove direct access of dev->iommu_fwspec

2020-03-10 Thread Joerg Roedel
From: Joerg Roedel Use the accessor functions instead of directly dereferencing dev->iommu_fwspec. Signed-off-by: Joerg Roedel --- drivers/iommu/tegra-gart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c in

[PATCH 13/15] iommu/qcom: Use accessor functions for iommu private data

2020-03-10 Thread Joerg Roedel
From: Joerg Roedel Make use of dev_iommu_priv_set/get() functions. Signed-off-by: Joerg Roedel --- drivers/iommu/qcom_iommu.c | 61 ++ 1 file changed, 36 insertions(+), 25 deletions(-) diff --git a/drivers/iommu/qcom_iommu.c b/drivers/iommu/qcom_iommu.c

[PATCH 08/15] iommu: Introduce accessors for iommu private data

2020-03-10 Thread Joerg Roedel
From: Joerg Roedel Add dev_iommu_priv_get/set() functions to access per-device iommu private data. This makes it easier to move the pointer to a different location. Tested-by: Will Deacon # arm-smmu Signed-off-by: Joerg Roedel --- include/linux/iommu.h | 10 ++ 1 file changed, 10

Re: [PATCH 00/14] iommu: Move iommu_fwspec out of 'struct device'

2020-03-09 Thread Joerg Roedel
Hi Jean-Philippe, On Fri, Mar 06, 2020 at 11:09:55AM +0100, Jean-Philippe Brucker wrote: > I think that's because patch 01/14 move the fwspec access too early. In > > err = pci_for_each_dma_alias(to_pci_dev(dev), > iort_pci_iommu_init,

Re: [PATCH v2 1/3] iommu/virtio: Add topology description to virtio-iommu config space

2020-03-04 Thread Joerg Roedel
On Wed, Mar 04, 2020 at 01:37:44PM -0800, Jacob Pan (Jun) wrote: > + Mike and Erik who work closely on UEFI and ACPICA. > > Copy paste Erik's initial response below on how to get a new table, > seems to confirm with the process you stated above. > > "Fairly easy. You reserve a 4-letter symbol by

Re: [PATCH v2 1/3] iommu/virtio: Add topology description to virtio-iommu config space

2020-03-04 Thread Joerg Roedel
On Wed, Mar 04, 2020 at 02:34:33PM -0500, Michael S. Tsirkin wrote: > All these extra levels of indirection is one of the reasons > hypervisors such as kata try to avoid ACPI. Platforms that don't use ACPI need another hardware detection mechanism, which can also be supported. But the first step h

Re: [PATCH v2 1/3] iommu/virtio: Add topology description to virtio-iommu config space

2020-03-04 Thread Joerg Roedel
On Wed, Mar 04, 2020 at 04:38:21PM +0100, Jean-Philippe Brucker wrote: > I agree with this. The problem is I don't know how to get a new ACPI table > or change an existing one. It needs to go through the UEFI forum in order > to be accepted, and I don't have any weight there. I've been trying to ge

Re: [PATCH v2 1/3] iommu/virtio: Add topology description to virtio-iommu config space

2020-03-04 Thread Joerg Roedel
On Wed, Mar 04, 2020 at 07:48:54AM -0800, Jacob Pan wrote: > For emulated VT-d IOMMU, GIOVA can also be build as first level page > tables then pass to the host IOMMU to bind. There is no need to shadow > in this case, pIOMMU will do nested translation and walk guest page > tables. Right, but that

Re: [RESEND PATCH 1/4] iommu/omap: Fix pointer cast -Wpointer-to-int-cast warnings on 64 bit

2020-03-04 Thread Joerg Roedel
On Tue, Mar 03, 2020 at 09:27:48PM +0100, Krzysztof Kozlowski wrote: > pointers should be casted to unsigned long to avoid > -Wpointer-to-int-cast warnings when compiling on 64-bit platform (e.g. > with COMPILE_TEST): > > drivers/iommu/omap-iommu.c: In function ‘omap2_iommu_enable’: > driv

Re: [PATCH v2 1/3] iommu/virtio: Add topology description to virtio-iommu config space

2020-03-04 Thread Joerg Roedel
Hi Michael, On Tue, Mar 03, 2020 at 11:09:41AM -0500, Michael S. Tsirkin wrote: > No. It's coded into the hardware. Which might even be practical > for bare-metal (e.g. on-board flash), but is very practical > when the device is part of a hypervisor. If its that way on PPC, than fine for them. Bu

Re: [PATCH 00/14] iommu: Move iommu_fwspec out of 'struct device'

2020-03-04 Thread Joerg Roedel
Hi Will, On Tue, Mar 03, 2020 at 07:16:25PM +, Will Deacon wrote: > I haven't had a chance to review this properly yet, but I did take it > for a spin on my Seattle board with MMU-400 (arm-smmu) and it seems to > work the same as before, so: > > Tested-by: Will Deacon # arm-smmu > > I'll tr

Re: [PATCH v2 1/3] iommu/virtio: Add topology description to virtio-iommu config space

2020-03-03 Thread Joerg Roedel
On Tue, Mar 03, 2020 at 09:00:05AM -0500, Michael S. Tsirkin wrote: > Not necessarily. E.g. some power systems have neither. > There are also systems looking to bypass ACPI e.g. for boot speed. If there is no firmware layer between the hardware and the OS the necessary information the OS needs to

Re: [PATCH V2 3/5] iommu: Add support to change default domain of an iommu_group

2020-03-03 Thread Joerg Roedel
Hi Baolu, On Tue, Mar 03, 2020 at 02:47:02PM +0800, Lu Baolu wrote: > Theoretically speaking, per-device default domain is impractical. PCI > aliased devices (PCI bridge and all devices beneath it, VMD devices and > various devices quirked with pci_add_dma_alias()) must use the same > domain. It's

Re: [PATCH v2 1/3] iommu/virtio: Add topology description to virtio-iommu config space

2020-03-03 Thread Joerg Roedel
Hi Eric, On Tue, Mar 03, 2020 at 11:19:20AM +0100, Auger Eric wrote: > Michael has pushed this solution (putting the "configuration in the PCI > config space"), I think for those main reasons: > - ACPI may not be supported on some archs/hyps But on those there is device-tree, right? > - the virt

Re: [PATCH v2 1/3] iommu/virtio: Add topology description to virtio-iommu config space

2020-03-02 Thread Joerg Roedel
On Fri, Feb 28, 2020 at 06:25:36PM +0100, Jean-Philippe Brucker wrote: > This solution isn't elegant nor foolproof, but is the best we can do at > the moment and works with existing virtio-iommu implementations. It also > enables an IOMMU for lightweight hypervisors that do not rely on > firmware m

Re: [PATCH] iommu/io-pgtable-arm: Fix IOVA validation for 32-bit

2020-03-02 Thread Joerg Roedel
On Mon, Mar 02, 2020 at 11:53:01AM +, Will Deacon wrote: > On Fri, Feb 28, 2020 at 02:18:55PM +, Robin Murphy wrote: > > Since we ony support the TTB1 quirk for AArch64 contexts, and > > consequently only for 64-bit builds, the sign-extension aspect of the > > "are all bits above IAS consis

Re: [PATCH v3] iommu/vt-d: Fix a bug in intel_iommu_iova_to_phys() for huge page

2020-03-02 Thread Joerg Roedel
On Wed, Feb 26, 2020 at 12:30:06PM -0800, Yonghyun Hwang wrote: > intel_iommu_iova_to_phys() has a bug when it translates an IOVA for a huge > page onto its corresponding physical address. This commit fixes the bug by > accomodating the level of page entry for the IOVA and adds IOVA's lower > addre

Re: [PATCH] iommu: silence iommu group prints

2020-03-02 Thread Joerg Roedel
On Thu, Feb 27, 2020 at 11:57:52AM +, Russell King wrote: > On the LX2160A, there are lots (about 160) of IOMMU messages produced > during boot; this is excessive. Reduce the severity of these messages > to debug level. No, these messages are a very useful tool when it comes to debugging IOMM

Re: [PATCH v2 2/4] iommu: Add Allwinner H6 IOMMU driver

2020-03-02 Thread Joerg Roedel
Hi Maxime, On Thu, Feb 20, 2020 at 07:15:14PM +0100, Maxime Ripard wrote: > +struct sun50i_iommu_domain { > + struct iommu_domain domain; > + > + /* Number of devices attached to the domain */ > + refcount_t refcnt; > + > + /* Lock to modify the Directory Table */ > + spinlock_

Re: [PATCH V2 3/5] iommu: Add support to change default domain of an iommu_group

2020-03-02 Thread Joerg Roedel
Hello Sai, Baolu, On Sun, Feb 16, 2020 at 01:57:26PM -0800, Sai Praneeth Prakhya wrote: > Hence it will be helpful if there is some way to change the default > domain of a B:D.F dynamically. Since, linux iommu subsystem prefers to > deal at iommu_group level instead of B:D.F level, it might be hel

[PATCH 05/14] iommu: Rename struct iommu_param to dev_iommu

2020-02-28 Thread Joerg Roedel
From: Joerg Roedel The term dev_iommu aligns better with other existing structures and their accessor functions. Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 28 ++-- include/linux/device.h | 6 +++--- include/linux/iommu.h | 4 ++-- 3 files changed, 19

[PATCH 14/14] iommu: Move fwspec->iommu_priv to struct dev_iommu

2020-02-28 Thread Joerg Roedel
From: Joerg Roedel Move the pointer for iommu private data from struct iommu_fwspec to struct dev_iommu. Signed-off-by: Joerg Roedel --- include/linux/iommu.h | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index

[PATCH 08/14] iommu/arm-smmu-v3: Use accessor functions for iommu private data

2020-02-28 Thread Joerg Roedel
From: Joerg Roedel Make use of dev_iommu_priv_set/get() functions in the code. Signed-off-by: Joerg Roedel --- drivers/iommu/arm-smmu-v3.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index

[PATCH 12/14] iommu/qcom: Use accessor functions for iommu private data

2020-02-28 Thread Joerg Roedel
From: Joerg Roedel Make use of dev_iommu_priv_set/get() functions. Signed-off-by: Joerg Roedel --- drivers/iommu/qcom_iommu.c | 61 ++ 1 file changed, 36 insertions(+), 25 deletions(-) diff --git a/drivers/iommu/qcom_iommu.c b/drivers/iommu/qcom_iommu.c

[PATCH 00/14] iommu: Move iommu_fwspec out of 'struct device'

2020-02-28 Thread Joerg Roedel
sting of these drivers is greatly appreciated. I boot-tested these changes on arm-smmu-v3 enabled KVM VM. Please review. Regards, Joerg Joerg Roedel (14): ACPI/IORT: Remove direct access of dev->iommu_fwspec drm/msm/mdp5: Remove direct access of dev->iommu_fwspec iommu

[PATCH 03/14] iommu/tegra-gart: Remove direct access of dev->iommu_fwspec

2020-02-28 Thread Joerg Roedel
From: Joerg Roedel Use the accessor functions instead of directly dereferencing dev->iommu_fwspec. Signed-off-by: Joerg Roedel --- drivers/iommu/tegra-gart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c in

[PATCH 02/14] drm/msm/mdp5: Remove direct access of dev->iommu_fwspec

2020-02-28 Thread Joerg Roedel
From: Joerg Roedel Use the accessor functions instead of directly dereferencing dev->iommu_fwspec. Signed-off-by: Joerg Roedel --- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c b/driv

[PATCH 11/14] iommu/mediatek: Use accessor functions for iommu private data

2020-02-28 Thread Joerg Roedel
From: Joerg Roedel Make use of dev_iommu_priv_set/get() functions. Signed-off-by: Joerg Roedel --- drivers/iommu/mtk_iommu.c| 13 ++--- drivers/iommu/mtk_iommu_v1.c | 14 +++--- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b

[PATCH 07/14] iommu: Introduce accessors for iommu private data

2020-02-28 Thread Joerg Roedel
From: Joerg Roedel Add dev_iommu_priv_get/set() functions to access per-device iommu private data. This makes it easier to move the pointer to a different location. Signed-off-by: Joerg Roedel --- include/linux/iommu.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/include

[PATCH 01/14] ACPI/IORT: Remove direct access of dev->iommu_fwspec

2020-02-28 Thread Joerg Roedel
From: Joerg Roedel Use the accessor functions instead of directly dereferencing dev->iommu_fwspec. Signed-off-by: Joerg Roedel --- drivers/acpi/arm64/iort.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c in

[PATCH 09/14] iommu/arm-smmu: Use accessor functions for iommu private data

2020-02-28 Thread Joerg Roedel
From: Joerg Roedel Make use of dev_iommu_priv_set/get() functions and simplify the code where possible with this change. Signed-off-by: Joerg Roedel --- drivers/iommu/arm-smmu.c | 56 +--- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a

[PATCH 04/14] iommu/arm-smmu: Fix uninitilized variable warning

2020-02-28 Thread Joerg Roedel
From: Joerg Roedel Some unrelated changes in the iommu code caused a new warning to appear in the arm-smmu driver: CC drivers/iommu/arm-smmu.o drivers/iommu/arm-smmu.c: In function 'arm_smmu_add_device': drivers/iommu/arm-smmu.c:1441:2: warning: 'smmu' may be used un

[PATCH 13/14] iommu/virtio: Use accessor functions for iommu private data

2020-02-28 Thread Joerg Roedel
From: Joerg Roedel Make use of dev_iommu_priv_set/get() functions. Signed-off-by: Joerg Roedel --- drivers/iommu/virtio-iommu.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c index cce329d71fba

[PATCH 10/14] iommu/renesas: Use accessor functions for iommu private data

2020-02-28 Thread Joerg Roedel
From: Joerg Roedel Make use of dev_iommu_priv_set/get() functions. Signed-off-by: Joerg Roedel --- drivers/iommu/ipmmu-vmsa.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index ecb3f9464dd5..310cf09feea3

[PATCH 06/14] iommu: Move iommu_fwspec to struct dev_iommu

2020-02-28 Thread Joerg Roedel
From: Joerg Roedel Move the iommu_fwspec pointer in struct device into struct dev_iommu. This is a step in the effort to reduce the iommu related pointers in struct device to one. Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 3 +++ include/linux/device.h | 1 - include/linux

[git pull] IOMMU Fixes for Linux v5.6-rc1

2020-02-19 Thread Joerg Roedel
in QCOM IOMMU driver robust and not leak memory/dereference NULL pointers - Fix ARM-SMMU module parameter prefix names Joerg Roedel (6): iommu/vt-d: Fix compile warning from intel-svm.h iommu/vt-d: Add

Re: [PATCH] iommu/virtio: Build virtio-iommu as module

2020-02-19 Thread Joerg Roedel
On Wed, Feb 19, 2020 at 12:41:33PM +0100, Jean-Philippe Brucker wrote: > No, I meant Will's changes in 5.6 to make the SMMU drivers modular. This > patch doesn't depend on the x86 enablement patch-set, but there is a small > conflict in Kconfig since they both modify it (locally I have this patch >

Re: [PATCH] iommu/virtio: Build virtio-iommu as module

2020-02-19 Thread Joerg Roedel
On Fri, Feb 14, 2020 at 05:38:27PM +0100, Jean-Philippe Brucker wrote: > From: Jean-Philippe Brucker > > Now that the infrastructure changes are in place, enable virtio-iommu to > be built as a module. Remove the redundant pci_request_acs() call, since > it's not exported but is already invoked d

Re: [PATCH] iommu/arm-smmu: Restore naming of driver parameter prefix

2020-02-19 Thread Joerg Roedel
On Wed, Feb 19, 2020 at 11:00:46AM +, Will Deacon wrote: > Joerg -- please can you pick this up as a fix for 5.6? I don't have any > other SMMU fixes queued, so it doesn't seem worth sending a pull request > to you just for this. Applied, thanks. ___

Re: [PATCH] iommu/qcom: Fix bogus detach logic

2020-02-19 Thread Joerg Roedel
On Tue, Feb 18, 2020 at 06:12:41PM +, Robin Murphy wrote: > Currently, the implementation of qcom_iommu_domain_free() is guaranteed > to do one of two things: WARN() and leak everything, or dereference NULL > and crash. That alone is terrible, but in fact the whole idea of trying > to track the

Re: [PATCH 1/1] iommu/amd: Fix the configuration of GCR3 table root pointer

2020-02-19 Thread Joerg Roedel
On Fri, Feb 14, 2020 at 06:44:51PM +0800, Adrian Huang wrote: > From: Adrian Huang > > The SPA of the GCR3 table root pointer[51:31] masks 20 bits. However, > this requires 21 bits (Please see the AMD IOMMU specification). > This leads to the potential failure when the bit 51 of SPA of > the GCR3

Re: [PATCH 00/10] PCI/ATS: Device-tree support and other improvements

2020-02-19 Thread Joerg Roedel
Hi Jean-Philippe, On Thu, Feb 13, 2020 at 05:50:38PM +0100, Jean-Philippe Brucker wrote: > Jean-Philippe Brucker (11): > dt-bindings: PCI: generic: Add ats-supported property > PCI: Add ats_supported host bridge flag > PCI: OF: Check whether the host bridge supports ATS > ACPI/IORT: Check

Re: [PATCH] iommu: Use C99 flexible array in fwspec

2020-02-19 Thread Joerg Roedel
On Thu, Feb 13, 2020 at 02:00:21PM +, Robin Murphy wrote: > Although the 1-element array was a typical pre-C99 way to implement > variable-length structures, and indeed is a fundamental construct in the > APIs of certain other popular platforms, there's no good reason for it > here (and in part

Re: [PATCH] iommu/qcom: Replace zero-length array with flexible-array member

2020-02-19 Thread Joerg Roedel
On Wed, Feb 12, 2020 at 06:14:01PM -0600, Gustavo A. R. Silva wrote: > drivers/iommu/qcom_iommu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfounda

Re: [PATCH v3] iommu/amd: Disable IOMMU on Stoney Ridge systems

2020-02-19 Thread Joerg Roedel
On Mon, Feb 10, 2020 at 03:51:15PM +0800, Kai-Heng Feng wrote: > Serious screen flickering when Stoney Ridge outputs to a 4K monitor. > > Use identity-mapping and PCI ATS doesn't help this issue. > > According to Alex Deucher, IOMMU isn't enabled on Windows, so let's do > the same here to avoid s

Re: [RFC PATCH] iommu/dma: Allow drivers to reserve an iova range

2020-02-19 Thread Joerg Roedel
On Fri, Feb 14, 2020 at 02:58:16PM -0800, Isaac J. Manjarres wrote: > From: Liam Mark > > Some devices have a memory map which contains gaps or holes. > In order for the device to have as much IOVA space as possible, > allow its driver to inform the DMA-IOMMU layer that it should > not allocate a

Re: [PATCH 1/5] iommu/vt-d: Add attach_deferred() helper

2020-02-19 Thread Joerg Roedel
On Tue, Feb 18, 2020 at 09:14:54AM -0800, Christoph Hellwig wrote: > > +static bool attach_deferred(struct device *dev) > > +{ > > + return dev->archdata.iommu == DEFER_DEVICE_DOMAIN_INFO; > > +} > > This is not a very useful helper. Depends on what one considers useful. I think such helpers ma

Re: [PATCH 3/5 v2] iommu/vt-d: Do deferred attachment in iommu_need_mapping()

2020-02-18 Thread Joerg Roedel
On Tue, Feb 18, 2020 at 07:54:52PM +0800, Lu Baolu wrote: > Looks good to me now. For all patches in this series, > > Acked-by: Lu Baolu Thanks, queued the fixes for v5.6. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfound

[PATCH 3/5 v2] iommu/vt-d: Do deferred attachment in iommu_need_mapping()

2020-02-18 Thread Joerg Roedel
ew. Updated patch below. >From 3a5b8a66d288d86ac1fd45092e7d96f842d0cccf Mon Sep 17 00:00:00 2001 From: Joerg Roedel Date: Mon, 17 Feb 2020 17:20:59 +0100 Subject: [PATCH 3/5] iommu/vt-d: Do deferred attachment in iommu_need_mapping() The attachment of deferred devices needs to happen befor

[PATCH 4/5] iommu/vt-d: Remove deferred_attach_domain()

2020-02-17 Thread Joerg Roedel
From: Joerg Roedel The function is now only a wrapper around find_domain(). Remove the function and call find_domain() directly at the call-sites. Signed-off-by: Joerg Roedel --- drivers/iommu/intel-iommu.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a

[PATCH 3/5] iommu/vt-d: Do deferred attachment in iommu_need_mapping()

2020-02-17 Thread Joerg Roedel
From: Joerg Roedel The attachment of deferred devices needs to happen before the check whether the device is identity mapped or not. Otherwise the check will return wrong results, cause warnings boot failures in kdump kernels, like WARNING: CPU: 0 PID: 318 at ../drivers/iommu/intel

[PATCH 2/5] iommu/vt-d: Move deferred device attachment into helper function

2020-02-17 Thread Joerg Roedel
From: Joerg Roedel Move the code that does the deferred device attachment into a separate helper function. Signed-off-by: Joerg Roedel --- drivers/iommu/intel-iommu.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b

[PATCH 0/5] iommu/vt-d: Fix kdump boot with VT-d enabled

2020-02-17 Thread Joerg Roedel
will add the tags before applying the patches. Please review. Thanks, Joerg Joerg Roedel (5): iommu/vt-d: Add attach_deferred() helper iommu/vt-d: Move deferred device attachment into helper function iommu/vt-d: Do deferred attachment in iommu_need_mapping() iommu/vt-d: Remove

[PATCH 5/5] iommu/vt-d: Simplify check in identity_mapping()

2020-02-17 Thread Joerg Roedel
From: Joerg Roedel The function only has one call-site and there it is never called with dummy or deferred devices. Simplify the check in the function to account for that. Signed-off-by: Joerg Roedel --- drivers/iommu/intel-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH 1/5] iommu/vt-d: Add attach_deferred() helper

2020-02-17 Thread Joerg Roedel
From: Joerg Roedel Implement a helper function to check whether a device's attach process is deferred. Signed-off-by: Joerg Roedel --- drivers/iommu/intel-iommu.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/

Re: AMD IOMMU stops RDMA NFS from working since kernel 5.5 (bisected)

2020-02-10 Thread Joerg Roedel
Adding Tom's new email address. Tom, can you have a look, please? https://bugzilla.kernel.org/show_bug.cgi?id=206461 seems to be a similar issue. On Tue, Feb 11, 2020 at 06:06:54AM +0100, Andre Tomt wrote: > Since upgrading my RDMA lab from kernel 5.4.x to 5.5.x, NFSv4 over RDMA > stopped workin

[PATCH] iommu/vt-d: Fix compile warning from intel-svm.h

2020-02-10 Thread Joerg Roedel
From: Joerg Roedel The intel_svm_is_pasid_valid() needs to be marked inline, otherwise it causes the compile warning below: CC [M] drivers/dma/idxd/cdev.o In file included from drivers/dma/idxd/cdev.c:9:0: ./include/linux/intel-svm.h:125:12: warning: ‘intel_svm_is_pasid_valid’ defined but

[git pull] IOMMU Updates for Linux v5.6

2020-02-05 Thread Joerg Roedel
are for handling arm_smmu_write_ctx_desc() failure iommu/arm-smmu-v3: Add second level of context descriptor table iommu/arm-smmu-v3: Improve add_device() error handling PCI/ATS: Add PASID stubs Jerry Snitselaar (1): iommu/vt-d: Call __dmar_remove_one_dev_info with valid pointer

Re: [PATCH v2] iommu/amd: Disable IOMMU on Stoney Ridge systems

2020-02-05 Thread Joerg Roedel
On Wed, Feb 05, 2020 at 06:10:11PM +0800, Kai-Heng Feng wrote: > Since using identity mapping with ATS doesn't help, > Is it possible to merge this patch as is? Can you please re-send the patch to me after 5.6-rc1 is out? Thanks, Joerg ___ iomm

[git pull] IOMMU Fixes for Linux v5.5-rc7

2020-01-24 Thread Joerg Roedel
Hi Linus, The following changes since commit def9d2780727cec3313ed3522d0123158d87224d: Linux 5.5-rc7 (2020-01-19 16:02:49 -0800) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git tags/iommu-fixes-v5.5-rc7 for you to fetch changes up to 8c

Re: [PATCH 1/1] iommu/amd: Remove the unnecessary assignment

2020-01-24 Thread Joerg Roedel
On Wed, Jan 22, 2020 at 10:36:29PM +0800, Adrian Huang wrote: > From: Adrian Huang > > The assignment of the global variable 'iommu_detected' has been > moved from amd_iommu_init_dma_ops() to amd_iommu_detect(), so > this patch removes the assignment in amd_iommu_init_dma_ops(). > > Signed-off-b

Re: [PATCH 1/1] iommu/vt-d: Remove unnecessary WARN_ON_ONCE()

2020-01-24 Thread Joerg Roedel
On Sat, Jan 18, 2020 at 10:14:11AM +0800, Lu Baolu wrote: > Hi Joerg, > > On 1/17/20 5:59 PM, Joerg Roedel wrote: > > On Thu, Jan 16, 2020 at 09:52:36AM +0800, Lu Baolu wrote: > > > Address field in device TLB invalidation descriptor is qualified > > > by the S fi

Re: [PATCH v2] iommu: amd: Fix IOMMU perf counter clobbering during init

2020-01-24 Thread Joerg Roedel
On Thu, Jan 23, 2020 at 03:32:14PM -0700, Shuah Khan wrote: > init_iommu_perf_ctr() clobbers the register when it checks write access > to IOMMU perf counters and fails to restore when they are writable. > > Add save and restore to fix it. > > Signed-off-by: Shuah Khan > --- > Changes since v1:

Re: [RFC PATCH 3/4] iommu: Preallocate iommu group when probing devices

2020-01-17 Thread Joerg Roedel
On Wed, Jan 01, 2020 at 01:26:47PM +0800, Lu Baolu wrote: > This splits iommu group allocation from adding devices. This makes > it possible to determine the default domain type for each group as > all devices belonging to the group have been determined. I think its better to keep group allocation

Re: [PATCH] iommu: amd: Fix IOMMU perf counter clobbering during init

2020-01-17 Thread Joerg Roedel
Adding Suravee, who wrote the IOMMU Perf Counter code. On Tue, Jan 14, 2020 at 08:12:20AM -0700, Shuah Khan wrote: > init_iommu_perf_ctr() clobbers the register when it checks write access > to IOMMU perf counters and fails to restore when they are writable. > > Add save and restore to fix it. >

Re: [PATCH 0/2] iommu/amd: Optimization and cleanup for unused variables

2020-01-17 Thread Joerg Roedel
On Thu, Jan 09, 2020 at 11:02:49AM +0800, Adrian Huang wrote: > This series optimizes the register reading by using readq instead of > readl and cleans up the unused variables. > > Adrian Huang (2): > iommu/amd: Replace two consecutive readl calls with one readq > iommu/amd: Remove unused stru

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

2020-01-17 Thread Joerg Roedel
On Thu, Jan 16, 2020 at 10:25:49AM +, Will Deacon wrote: > Hi Joerg, > > Please pull these Arm SMMU updates for 5.6. The branch is based on your > arm/smmu branch and includes a patch addressing the feedback from Greg > about setting the module 'owner' field in the 'iommu_ops'. > > I've used

Re: [PATCH 1/1] iommu/vt-d: Remove unnecessary WARN_ON_ONCE()

2020-01-17 Thread Joerg Roedel
On Thu, Jan 16, 2020 at 09:52:36AM +0800, Lu Baolu wrote: > Address field in device TLB invalidation descriptor is qualified > by the S field. If S field is zero, a single page at page address > specified by address [63:12] is requested to be invalidated. If S > field is set, the least significant

Re: [PULL REQUEST] iommu/vt-d: patches for v5.6 - 2nd wave

2020-01-17 Thread Joerg Roedel
On Wed, Jan 15, 2020 at 11:03:54AM +0800, Lu Baolu wrote: > Barret Rhoden (2): > iommu/vt-d: Mark firmware tainted if RMRR fails sanity check > iommu/vt-d: Add RMRR base and end addresses sanity check > > Lu Baolu (2): > iommu/vt-d: Allow devices with RMRRs to use identity domain > iommu/v

Re: [RFC 2/5] iommu/vt-d: Unlink device if failed to add to group

2020-01-13 Thread Joerg Roedel
On Sun, Jan 12, 2020 at 09:36:56AM +0800, Lu Baolu wrote: > On 1/1/20 4:24 AM, Jon Derrick wrote: > > If the device fails to be added to the group, make sure to unlink the > > reference before returning. > > > > Signed-off-by: Jon Derrick > > Queued for v5.6. No need to do so, I sent it upstream

[git pull] IOMMU Fixes for Linux v5.5-rc5

2020-01-12 Thread Joerg Roedel
Hi Linus, The following changes since commit c79f46a282390e0f5b306007bf7b11a46d529538: Linux 5.5-rc5 (2020-01-05 14:23:27 -0800) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git iommu-fixes-v5.5-rc5 for you to fetch changes up to 55817b3

Re: Regression iommu/vt-d bounce buffer

2020-01-10 Thread Joerg Roedel
Hi Baolu, any ideas here? On Mon, Jan 06, 2020 at 04:43:05PM +0100, Frederik Schwan wrote: > Hello people, > since the introduction of the bounce buffer, a regression with TB3 devices > has been introduced. > USB devices attached to TB3 refuse to work since. Removing the commits that > introduc

Re: [PATCH] iommu/dma: fix variable 'cookie' set but not used

2020-01-07 Thread Joerg Roedel
On Mon, Jan 06, 2020 at 10:27:27AM -0500, Qian Cai wrote: > The commit c18647900ec8 ("iommu/dma: Relax locking in > iommu_dma_prepare_msi()") introduced a compliation warning, > > drivers/iommu/dma-iommu.c: In function 'iommu_dma_prepare_msi': > drivers/iommu/dma-iommu.c:1206:27: warning: variable

Re: [PATCH] iommu/qcom: fix NULL pointer dereference during probe deferral

2020-01-07 Thread Joerg Roedel
On Tue, Jan 07, 2020 at 09:00:14AM -0500, Brian Masney wrote: > On Tue, Jan 07, 2020 at 02:25:30PM +0100, Joerg Roedel wrote: > > On Tue, Dec 31, 2019 at 10:39:49PM -0500, Brian Masney wrote: > > > drivers/iommu/qcom_iommu.c | 12 ++-- > > > 1 file changed, 10

Re: [RFC 0/5] Clean up VMD DMA Map Ops

2020-01-07 Thread Joerg Roedel
On Tue, Dec 31, 2019 at 01:24:18PM -0700, Jon Derrick wrote: > Jon Derrick (5): > iommu: Remove device link to group on failure > iommu/vt-d: Unlink device if failed to add to group Added 'Fixes:' tags to these two and applied them for v5.5, thanks.

Re: [PATCH] iommu/qcom: fix NULL pointer dereference during probe deferral

2020-01-07 Thread Joerg Roedel
On Tue, Dec 31, 2019 at 10:39:49PM -0500, Brian Masney wrote: > drivers/iommu/qcom_iommu.c | 12 ++-- > 1 file changed, 10 insertions(+), 2 deletions(-) Shortened commit-message a bit and applied for v5.5, thanks. ___ iommu mailing list iommu@l

Re: [PATCH 1/1] iommu/amd: Fix typos for PPR macros

2020-01-07 Thread Joerg Roedel
On Mon, Dec 30, 2019 at 01:56:54PM +0800, Adrian Huang wrote: > From: Adrian Huang > > The bit 13 and bit 14 of the IOMMU control register are > PPRLogEn and PPRIntEn. They are related to PPR (Peripheral Page > Request) instead of 'PPF'. Fix them accrodingly. > > Signed-off-by: Adrian Huang > -

Re: [PATCH 1/1] iommu/amd: Remove local variables

2020-01-07 Thread Joerg Roedel
On Tue, Dec 24, 2019 at 10:46:47PM +0800, Adrian Huang wrote: > From: Adrian Huang > > The usage of the local variables 'range' and 'misc' was removed > from commit 226e889b20a9 ("iommu/amd: Remove first/last_device handling") > and commit 23c742db2171 ("iommu/amd: Split out PCI related parts of

Re: [PULL REQUEST] iommu/vt-d: patches for v5.6

2020-01-07 Thread Joerg Roedel
On Thu, Jan 02, 2020 at 08:18:01AM +0800, Lu Baolu wrote: > Hi Joerg, > > Below patches have been piled up for v5.6. > > - Some preparation patches for VT-d nested mode support >- VT-d Native Shared virtual memory cleanup and fixes >- Use 1st-level for IOVA translation > > - VT-d debug

Re: [PATCH] iommu/vt-d fix adding non-PCI devices to Intel IOMMU

2020-01-07 Thread Joerg Roedel
On Fri, Dec 27, 2019 at 12:56:18AM +0100, Patrick Steinhardt wrote: > > I've recently spotted above warning in v5.5-rc3. The attached fix > is rather intended as a discussion starter -- it's quite likely > to be wrong as I ain't got much of a clue about the IOMMU > subsystem. > > drivers/iommu/i

<    5   6   7   8   9   10   11   12   13   14   >