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-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: [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
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: [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 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 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 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,

[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

[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 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 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 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 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

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 ___

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: [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 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] 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 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 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 0/6] Replace private domain with per-group default

2020-03-10 Thread Joerg Roedel
Hi Baolu, On Sat, Mar 07, 2020 at 02:20:08PM +0800, Lu Baolu wrote: > Lu Baolu (5): > iommu: Configure default domain with dev_def_domain_type > iommu/vt-d: Don't force 32bit devices to uses DMA domain > iommu/vt-d: Don't force PCI sub-hierarchy to use DMA domain > iommu/vt-d: Add dev_def_

Re: [PATCH 0/3] Request direct mapping for modem firmware subdevice

2020-03-10 Thread Joerg Roedel
On Mon, Mar 09, 2020 at 11:52:52PM +0530, Sibi Sankar wrote: > The Q6 modem sub-system has direct access to DDR through memnoc and > an indirect access routed through a SMMU which MSS CE (crypto engine > sub-component of MSS) uses during out of reset sequence. Request direct > mapping for the modem

Re: [PATCH 0/3] Request direct mapping for modem firmware subdevice

2020-03-10 Thread Joerg Roedel
On Tue, Mar 10, 2020 at 07:30:50PM +0530, Sibi Sankar wrote: > The accesses are initiated by the firmware > and they access modem reserved regions. > However as explained in ^^ any accesses > outside the region will result in a violation > and is controlled through XPUs (protection units). Okay, t

Re: [PATCH 0/6] Replace private domain with per-group default

2020-03-13 Thread Joerg Roedel
On Wed, Mar 11, 2020 at 02:50:39PM +0800, Lu Baolu wrote: > On 2020/3/10 19:15, Joerg Roedel wrote: > > Hi Baolu, > > > > On Sat, Mar 07, 2020 at 02:20:08PM +0800, Lu Baolu wrote: > > > Lu Baolu (5): > > >iommu: Configure default domain with dev_def

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

2020-03-13 Thread Joerg Roedel
On Thu, Mar 12, 2020 at 02:09:53PM +0800, Lu Baolu wrote: > Hi Joerg, > > There are another two small fixes queued in my tree. > > Can you please consider them for v5.6? > > Best regards, > -baolu > > Daniel Drake (1): > iommu/vt-d: Ignore devices with out-of-spec domain number > > Zhenzhong

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

2020-03-13 Thread Joerg Roedel
On Thu, Mar 12, 2020 at 02:09:53PM +0800, Lu Baolu wrote: > Daniel Drake (1): > iommu/vt-d: Ignore devices with out-of-spec domain number > > Zhenzhong Duan (1): > iommu/vt-d: Fix the wrong printing in RHSA parsing Btw, these two probably need fixes tags, can you provide them please?

Re: [PATCH v2 1/1] iommu/vt-d: Populate debugfs if IOMMUs are detected

2020-03-14 Thread Joerg Roedel
On Sat, Mar 14, 2020 at 11:39:59AM +0800, Lu Baolu wrote: > From: Megha Dey > > Currently, the intel iommu debugfs directory(/sys/kernel/debug/iommu/intel) > gets populated only when DMA remapping is enabled (dmar_disabled = 0) > irrespective of whether interrupt remapping is enabled or not. > >

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

2020-03-15 Thread Joerg Roedel
Hi Linus, The following changes since commit 98d54f81e36ba3bf92172791eba5ca5bd813989b: Linux 5.6-rc4 (2020-03-01 16:38:46 -0600) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git tags/iommu-fixes-v5.6-rc5 for you to fetch changes up to 1d

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

2020-03-19 Thread Joerg Roedel
Hi Jean-Philippe, On Mon, Mar 16, 2020 at 04:52:23PM +0100, Jean-Philippe Brucker wrote: > Should be: > > if (!dev_iommu_priv_set(dev)) Thanks a lot for your reviews! I made the changes to arm-smmu and the qcom driver you requested and will post a new version later today. Thanks,

Re: [PATCH v2 2/6] iommu: Configure default domain with def_domain_type

2020-03-19 Thread Joerg Roedel
Hi Baolu, On Sat, Mar 14, 2020 at 09:07:01AM +0800, Lu Baolu wrote: > +static int iommu_group_change_def_domain(struct iommu_group *group, int type) > +{ > + struct group_device *grp_dev, *temp; > + struct iommu_domain *new, *old; > + const struct iommu_ops *ops; > + int ret = 0; >

Re: [PATCH 1/1] iommu/vt-d: Fix page request descriptor size

2020-03-19 Thread Joerg Roedel
On Tue, Mar 17, 2020 at 09:10:18AM +0800, Lu Baolu wrote: > From: Jacob Pan > > Intel VT-d might support PRS (Page Reqest Support) when it's > running in the scalable mode. Each page request descriptor > occupies 32 bytes and is 32-bytes aligned. The page request > descriptor offset mask should b

Re: [PATCH] iommu/vt-d: silence a RCU-list debugging warning

2020-03-19 Thread Joerg Roedel
On Wed, Mar 18, 2020 at 01:27:53PM +0800, Lu Baolu wrote: > On 2020/3/17 23:03, Qian Cai wrote: > > dmar_find_atsr() calls list_for_each_entry_rcu() outside of an RCU read > > side critical section but with dmar_global_lock held. Silence this > > false positive. > > > > drivers/iommu/intel-iommu

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

2020-03-20 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 | 57 +--- 1 file changed, 30 insertions

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

2020-03-20 Thread Joerg Roedel
From: Joerg Roedel Use the accessor functions instead of directly dereferencing dev->iommu_fwspec. Reviewed-by: Jean-Philippe Brucker 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/

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

2020-03-20 Thread Joerg Roedel
From: Joerg Roedel Make use of dev_iommu_priv_set/get() functions. Reviewed-by: Jean-Philippe Brucker 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

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

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

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

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

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

2020-03-20 Thread Joerg Roedel
From: Joerg Roedel Make use of dev_iommu_priv_set/get() functions. Reviewed-by: Jean-Philippe Brucker 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

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

2020-03-20 Thread Joerg Roedel
From: Joerg Roedel Make use of dev_iommu_priv_set/get() functions. Reviewed-by: Jean-Philippe Brucker 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

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

2020-03-20 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 v3 05/15] iommu: Rename struct iommu_param to dev_iommu

2020-03-20 Thread Joerg Roedel
From: Joerg Roedel The term dev_iommu aligns better with other existing structures and their accessor functions. Cc: Greg Kroah-Hartman Tested-by: Will Deacon # arm-smmu Reviewed-by: Jean-Philippe Brucker Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 28

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

2020-03-20 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. Cc: Greg Kroah-Hartman Tested-by: Will Deacon # arm-smmu Reviewed-by: Jean-Philippe Brucker Signed-off-by: Joerg

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

2020-03-20 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 v3 04/15] iommu/tegra-gart: Remove direct access of dev->iommu_fwspec

2020-03-20 Thread Joerg Roedel
From: Joerg Roedel Use the accessor functions instead of directly dereferencing dev->iommu_fwspec. Reviewed-by: Jean-Philippe Brucker 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.

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

2020-03-20 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 Reviewed-by: Jean-Philippe Brucker Signed-off-by: Joerg Roedel --- include/linux/iommu.h | 4

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

2020-03-20 Thread Joerg Roedel
.15340-1-j...@8bytes.org/ Changes to v2: - Fix the issues found by Jean-Philippe - Fix a compile issue in the Mediatek driver Please review. Thanks, Joerg Joerg Roedel (15): iommu: Define dev_iommu_fwspec_get() for !CONFIG_IOMMU_API ACPI/IORT: Remove direct acc

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

2020-03-20 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 Reviewed-by: Jean-Philippe Brucker Signed-off-by: Joerg Roedel --- include/linux/iommu.h

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

2020-03-20 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 Reviewed-by: Jean-Philippe Brucker Signed-off-by: Joerg Roedel --- include/linux/iommu.h | 7 --- 1 file changed, 4 insertions(+), 3 deletions

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

2020-03-20 Thread Joerg Roedel
On Fri, Mar 20, 2020 at 03:35:20PM +, Will Deacon wrote: > Hi Joerg, > > Please pull these Arm SMMU updates for 5.7. The summary is in the tag (which > you may need to re-fetch if you've got my tree added as a remote). > > Cheers, > > Will > > --->8 > > The following changes since commit f

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

2020-03-24 Thread Joerg Roedel
Hey Robin, On Mon, Mar 23, 2020 at 04:02:33PM +, Robin Murphy wrote: > Yikes, this ends up pretty ugly, and I'd prefer not have this much > complexity hidden in macros that were intended just to be convenient > shorthand. Would you mind pulling in the patch below as a precursor? Sure thing, b

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

2020-03-26 Thread Joerg Roedel
.29830-1-j...@8bytes.org/ v1: https://lore.kernel.org/lkml/20200228150820.15340-1-j...@8bytes.org/ Changes to v2: - Addressed Robins review comments - Added Robins patch to optimize arm-smmu changes - Rebased to v5.6-rc7 Please review. Thanks, Joerg Jo

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

2020-03-26 Thread Joerg Roedel
Hi Robin, On Wed, Mar 25, 2020 at 12:31:46PM +, Robin Murphy wrote: > Oops, sorry - as you might imagine I'm not in my normal workflow :) No problem, nobody is right now :) > Let me rebase that onto something actually in your tree (rather than > whatever detached HEAD this is checked out out

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

2020-03-26 Thread Joerg Roedel
From: Joerg Roedel The term dev_iommu aligns better with other existing structures and their accessor functions. Cc: Greg Kroah-Hartman Tested-by: Will Deacon # arm-smmu Reviewed-by: Jean-Philippe Brucker Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 28

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

2020-03-26 Thread Joerg Roedel
From: Joerg Roedel Use the accessor functions instead of directly dereferencing dev->iommu_fwspec. Reviewed-by: Jean-Philippe Brucker 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/

[PATCH v4 11/16] iommu/arm-smmu: Use accessor functions for iommu private data

2020-03-26 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 | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff

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

2020-03-26 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 v4 14/16] iommu/qcom: Use accessor functions for iommu private data

2020-03-26 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 v4 15/16] iommu/virtio: Use accessor functions for iommu private data

2020-03-26 Thread Joerg Roedel
From: Joerg Roedel Make use of dev_iommu_priv_set/get() functions. Reviewed-by: Jean-Philippe Brucker 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

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

2020-03-26 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 Reviewed-by: Jean-Philippe Brucker Signed-off-by: Joerg Roedel --- include/linux/iommu.h | 4

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

2020-03-26 Thread Joerg Roedel
From: Joerg Roedel Use the accessor functions instead of directly dereferencing dev->iommu_fwspec. Reviewed-by: Jean-Philippe Brucker 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.

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

2020-03-26 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. Cc: Greg Kroah-Hartman Tested-by: Will Deacon # arm-smmu Reviewed-by: Jean-Philippe Brucker Signed-off-by: Joerg

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

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

[PATCH v4 12/16] iommu/renesas: Use accessor functions for iommu private data

2020-03-26 Thread Joerg Roedel
From: Joerg Roedel Make use of dev_iommu_priv_set/get() functions. Reviewed-by: Jean-Philippe Brucker 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

[PATCH v4 10/16] iommu/arm-smmu: Refactor master_cfg/fwspec usage

2020-03-26 Thread Joerg Roedel
From: Robin Murphy In preparation for restructuring iommu_fwspec, refactor the way we access the arm_smmu_master_cfg private data to be less dependent on the current layout. Signed-off-by: Robin Murphy Signed-off-by: Joerg Roedel --- drivers/iommu/arm-smmu.c | 42

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

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

[PATCH v4 13/16] iommu/mediatek: Use accessor functions for iommu private data

2020-03-26 Thread Joerg Roedel
From: Joerg Roedel Make use of dev_iommu_priv_set/get() functions. Reviewed-by: Jean-Philippe Brucker 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

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

2020-03-26 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 Reviewed-by: Jean-Philippe Brucker Signed-off-by: Joerg Roedel --- include/linux/iommu.h

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

2020-03-26 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 Reviewed-by: Jean-Philippe Brucker Signed-off-by: Joerg Roedel --- include/linux/iommu.h | 7 --- 1 file changed, 4 insertions(+), 3 deletions

Re: [PATCH] iommu: Lower severity of add/remove device messages

2020-03-27 Thread Joerg Roedel
On Mon, Mar 23, 2020 at 06:49:56PM -0300, Ezequiel Garcia wrote: > These user messages are not really informational, > but mostly of debug nature. Lower their severity. Like most other messages in the kernel log, that is not a reason to lower the severity. These messages are the first thing to loo

Re: [PATCH 0/3] Misc bug fixes for VT-d SVM

2020-03-27 Thread Joerg Roedel
On Thu, Mar 19, 2020 at 09:32:28PM -0700, Jacob Pan wrote: > iommu/vt-d: Fix mm reference leak > iommu/vt-d: Add build dependency on IOASID Applied these two, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundati

Re: [PATCH v2 0/3] iommu/virtio: Misc fixes

2020-03-27 Thread Joerg Roedel
On Thu, Mar 26, 2020 at 10:35:55AM +0100, Jean-Philippe Brucker wrote: > A collection of fixes for the virtio-iommu driver. It might be too late > for v5.6 since they need more review. Patch 2 is new, the others were > posted separately. > > Jean-Philippe Brucker (3): > iommu/virtio: Fix sparse

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

2020-03-27 Thread Joerg Roedel
On Thu, Mar 26, 2020 at 04:08:25PM +0100, Joerg Roedel wrote: > Joerg Roedel (15): > iommu: Define dev_iommu_fwspec_get() for !CONFIG_IOMMU_API > ACPI/IORT: Remove direct access of dev->iommu_fwspec > drm/msm/mdp5: Remove direct access of dev->iommu_fwspec > iommu/tegr

[git pull] IOMMU Updates for Linux v5.7

2020-04-07 Thread Joerg Roedel
/virtio: Fix freeing of incomplete domains iommu/virtio: Reject IOMMU page granule larger than PAGE_SIZE Joerg Roedel (17): Merge tag 'arm-smmu-updates' of git://git.kernel.org/.../will/linux into arm/smmu iommu: Define dev_iommu_fwspec_get() for !CONFIG_IOMMU_API ACPI/I

[RFC PATCH 02/34] iommu: Add def_domain_type() callback in iommu_ops

2020-04-07 Thread Joerg Roedel
it to allocate the default domain ] Co-developed-by: Joerg Roedel Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 20 +--- include/linux/iommu.h | 6 ++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c

[RFC PATCH 00/34] iommu: Move iommu_group setup to IOMMU core code

2020-04-07 Thread Joerg Roedel
, I will rebase them to v5.7-rc1 when it comes out. A branch with these patches applied can be found here: https://git.kernel.org/pub/scm/linux/kernel/git/joro/linux.git/log/?h=iommu-probe-device Please review and test these changes and let me know what breaks. Thanks, Joerg J

[RFC PATCH 09/34] iommu: Keep a list of allocated groups in __iommu_probe_device()

2020-04-07 Thread Joerg Roedel
From: Joerg Roedel This is needed to defer default_domain allocation for new IOMMU groups until all devices have been added to the group. Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/iommu.c b

[RFC PATCH 01/34] iommu: Move default domain allocation to separate function

2020-04-07 Thread Joerg Roedel
From: Joerg Roedel Move the code out of iommu_group_get_for_dev() into a separate function. Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 74 ++- 1 file changed, 45 insertions(+), 29 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers

[RFC PATCH 03/34] iommu/amd: Implement iommu_ops->def_domain_type call-back

2020-04-07 Thread Joerg Roedel
From: Joerg Roedel Implement the new def_domain_type call-back for the AMD IOMMU driver. Signed-off-by: Joerg Roedel --- drivers/iommu/amd_iommu.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 20cce366e951

[RFC PATCH 11/34] iommu: Split off default domain allocation from group assignment

2020-04-07 Thread Joerg Roedel
From: Joerg Roedel When a bus is initialized with iommu-ops, all devices on the bus are scanned and iommu-groups are allocated for them, and each groups will also get a default domain allocated. Until now this happened as soon as the group was created and the first device added to it. When

[RFC PATCH 12/34] iommu: Move iommu_group_create_direct_mappings() out of iommu_group_add_device()

2020-04-07 Thread Joerg Roedel
From: Joerg Roedel After the previous changes the iommu group may not have a default domain when iommu_group_add_device() is called. With no default domain iommu_group_create_direct_mappings() will do nothing and no direct mappings will be created. Rename iommu_group_create_direct_mappings() to

[RFC PATCH 04/34] iommu/vt-d: Wire up iommu_ops->def_domain_type

2020-04-07 Thread Joerg Roedel
From: Joerg Roedel The Intel VT-d driver already has a matching function to determine the default domain type for a device. Wire it up in intel_iommu_ops. Signed-off-by: Joerg Roedel --- drivers/iommu/intel-iommu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iommu/intel

[RFC PATCH 31/34] iommu/exynos: Create iommu_device in struct exynos_iommu_owner

2020-04-07 Thread Joerg Roedel
From: Joerg Roedel The 'struct exynos_iommu_owner' is an umbrella for multiple SYSMMU instances attached to one master. As such all these instances are handled the same, they are all configured with the same iommu_domain, for example. The IOMMU core code expects each device to hav

[RFC PATCH 27/34] iommu/tegra: Convert to probe/release_device() call-backs

2020-04-07 Thread Joerg Roedel
From: Joerg Roedel Convert the Tegra IOMMU drivers to use the probe_device() and release_device() call-backs of iommu_ops, so that the iommu core code does the group and sysfs setup. Signed-off-by: Joerg Roedel --- drivers/iommu/tegra-gart.c | 24 ++-- drivers/iommu/tegra

[RFC PATCH 25/34] iommu/qcom: Convert to probe/release_device() call-backs

2020-04-07 Thread Joerg Roedel
From: Joerg Roedel Convert the QCOM IOMMU driver to use the probe_device() and release_device() call-backs of iommu_ops, so that the iommu core code does the group and sysfs setup. Signed-off-by: Joerg Roedel --- drivers/iommu/qcom_iommu.c | 24 +++- 1 file changed, 7

[RFC PATCH 23/34] iommu/mediatek: Convert to probe/release_device() call-backs

2020-04-07 Thread Joerg Roedel
From: Joerg Roedel Convert the Mediatek IOMMU driver to use the probe_device() and release_device() call-backs of iommu_ops, so that the iommu core code does the group and sysfs setup. Signed-off-by: Joerg Roedel --- drivers/iommu/mtk_iommu.c | 24 ++-- 1 file changed, 6

[RFC PATCH 06/34] iommu/amd: Return -ENODEV in add_device when device is not handled by IOMMU

2020-04-07 Thread Joerg Roedel
From: Joerg Roedel When check_device() fails on the device, it is not handled by the IOMMU and amd_iommu_add_device() needs to return -ENODEV. Signed-off-by: Joerg Roedel --- drivers/iommu/amd_iommu.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/iommu

[RFC PATCH 20/34] iommu/s390: Convert to probe/release_device() call-backs

2020-04-07 Thread Joerg Roedel
From: Joerg Roedel Convert the S390 IOMMU driver to use the probe_device() and release_device() call-backs of iommu_ops, so that the iommu core code does the group and sysfs setup. Signed-off-by: Joerg Roedel --- drivers/iommu/s390-iommu.c | 22 ++ 1 file changed, 6

[RFC PATCH 24/34] iommu/mediatek-v1 Convert to probe/release_device() call-backs

2020-04-07 Thread Joerg Roedel
From: Joerg Roedel Convert the Mediatek-v1 IOMMU driver to use the probe_device() and release_device() call-backs of iommu_ops, so that the iommu core code does the group and sysfs setup. Signed-off-by: Joerg Roedel --- drivers/iommu/mtk_iommu_v1.c | 50 +++- 1

[RFC PATCH 07/34] iommu: Add probe_device() and remove_device() call-backs

2020-04-07 Thread Joerg Roedel
From: Joerg Roedel Add call-backs to 'struct iommu_ops' as an alternative to the add_device() and remove_device() call-backs, which will be removed when all drivers are converted. The new call-backs will not setupt IOMMU groups and domains anymore, so also add a probe_finalize() call-

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