Re: [PATCH 00/12] [PULL REQUEST] Intel IOMMU updates for Linux v5.18

2022-03-04 Thread Joerg Roedel
On Fri, Mar 04, 2022 at 06:37:01PM +0800, Lu Baolu wrote: > It's based on this series: > > https://lore.kernel.org/linux-iommu/yhy%2fawftokqll...@8bytes.org/ > > which contains some cleanup in vt-d driver as well. > > If I re-base the series onto the vt-d branch, there will also be > conflicts w

[git pull] IOMMU Fixes for Linux v5.17-rc6

2022-03-04 Thread Joerg Roedel
Hi Linus, The following changes since commit 754e0b0e35608ed5206d6a67a791563c631cec07: Linux 5.17-rc4 (2022-02-13 12:13:30 -0800) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git tags/iommu-fixes-v5.17-rc6 for you to fetch changes up to

Re: [PATCH v5 00/34] MT8195 IOMMU SUPPORT

2022-03-04 Thread Joerg Roedel
On Fri, Mar 04, 2022 at 05:57:19PM +0800, Yong Wu wrote: > Thanks for this info. I will re-send this patchset after the next -rc1. > > Could you help apply Dafna's patchset at this time? This patchset > depends on it and it won't conflict with the others. Alright, picked up Dafna's patch-set. Re

Re: [PATCH v2 0/5] iommu/mediatek: Fix tlb flush logic

2022-03-04 Thread Joerg Roedel
On Wed, Dec 08, 2021 at 02:07:39PM +0200, Dafna Hirschfeld wrote: > Sebastian Reichel (1): > iommu/mediatek: Always check runtime PM status in tlb flush range > callback > > Yong Wu (4): > iommu/mediatek: Remove for_each_m4u in tlb_sync_all > iommu/mediatek: Remove the power status check

Re: [PATCH] iommu/iova: Improve 32-bit free space estimate

2022-03-04 Thread Joerg Roedel
On Fri, Mar 04, 2022 at 07:36:46AM +0800, Miles Chen wrote: > Hi Robin, > > > For various reasons based on the allocator behaviour and typical > > use-cases at the time, when the max32_alloc_size optimisation was > > introduced it seemed reasonable to couple the reset of the tracked > > size to th

Re: [PATCH v2 0/5] iommu/amd: Cleanup and fixes

2022-03-04 Thread Joerg Roedel
On Tue, Mar 01, 2022 at 02:26:21PM +0530, Vasant Hegde wrote: > This series contains various cleanup and trivial fixes. > > Changes in v2: > - Fixed error log message in patch 1 as suggested by Joerg. > > > Suravee Suthikulpanit (2): > iommu/amd: Improve error handling for amd_iommu_init_pci

Re: [PATCH 00/12] [PULL REQUEST] Intel IOMMU updates for Linux v5.18

2022-03-04 Thread Joerg Roedel
Hi Baolu, On Tue, Mar 01, 2022 at 10:01:47AM +0800, Lu Baolu wrote: > This includes patches queued for v5.18. It includes: > > - [PATCH 1 ~ 11] Various cleanups, no intentional functional changes. > - [PATCH 12] Enable ATS in SoC-integrated devices listed in ACPI/SATC > table. >

Re: [PATCH v5 00/34] MT8195 IOMMU SUPPORT

2022-03-04 Thread Joerg Roedel
On Tue, Mar 01, 2022 at 03:49:18PM +0800, Yong Wu wrote: > https://patchwork.kernel.org/project/linux-mediatek/list/?series=592275 Okay, thanks for the clarification. So I can't include linux-next in my tree, so I think the best option is to wait until v5.18-rc1 (or rather -rc3, which is where I s

Re: [PATCH 1/1] iommu/vt-d: Fix double list_add when enabling VMD in scalable mode

2022-02-28 Thread Joerg Roedel
On Mon, Feb 21, 2022 at 01:33:48PM +0800, Lu Baolu wrote: > Fixes: 474dd1c65064 ("iommu/vt-d: Fix clearing real DMA device's > scalable-mode context entries") > Cc: sta...@vger.kernel.org # v5.14+ > Signed-off-by: Adrian Huang > Link: https://lore.kernel.org/r/20220216091307.703-1-adrianhuang0...

Re: [PATCH 0/5] iommu/amd: Cleanup and fixes

2022-02-28 Thread Joerg Roedel
On Mon, Feb 21, 2022 at 10:29:11AM +0530, Vasant Hegde wrote: > This series contains various cleanup and trivial fixes. > > Suravee Suthikulpanit (2): > iommu/amd: Improve error handling for amd_iommu_init_pci > iommu/amd: Improve amd_iommu_v2_exit() > > Vasant Hegde (3): > iommu/amd: Call

Re: [PATCH 1/5] iommu/amd: Improve error handling for amd_iommu_init_pci

2022-02-28 Thread Joerg Roedel
On Mon, Feb 21, 2022 at 10:29:12AM +0530, Vasant Hegde wrote: > From: Suravee Suthikulpanit > > Add error messages to prevent silent failure. > > Signed-off-by: Suravee Suthikulpanit > Signed-off-by: Vasant Hegde > --- > drivers/iommu/amd/init.c | 12 +--- > 1 file changed, 9 insertio

Re: [PATCH v5 00/34] MT8195 IOMMU SUPPORT

2022-02-28 Thread Joerg Roedel
Hi Yong Wu, On Thu, Feb 17, 2022 at 07:34:19PM +0800, Yong Wu wrote: > Yong Wu (34): > dt-bindings: mediatek: mt8195: Add binding for MM IOMMU > dt-bindings: mediatek: mt8195: Add binding for infra IOMMU > iommu/mediatek: Fix 2 HW sharing pgtable issue > iommu/mediatek: Add list_del in mtk

Re: [PATCH v4 0/9] iommu cleanup and refactoring

2022-02-28 Thread Joerg Roedel
On Wed, Feb 16, 2022 at 10:52:40AM +0800, Lu Baolu wrote: > Lu Baolu (9): > iommu/vt-d: Remove guest pasid related callbacks > iommu: Remove guest pasid related interfaces and definitions > iommu/vt-d: Remove aux-domain related callbacks > iommu: Remove aux-domain related interfaces and iom

Re: [PATCH] iommu/tegra-smmu: Fix missing put_device() call in tegra_smmu_find

2022-02-28 Thread Joerg Roedel
On Fri, Jan 07, 2022 at 08:09:11AM +, Miaoqian Lin wrote: > The reference taken by 'of_find_device_by_node()' must be released when > not needed anymore. > Add the corresponding 'put_device()' in the error handling path. > > Fixes: 765a9d1d02b2 ("iommu/tegra-smmu: Fix mc errors on tegra124-nya

Re: [PATCH v4 05/11] iommu/sva: Assign a PASID to mm on PASID allocation and free it on mm exit

2022-02-15 Thread Joerg Roedel
ted PASID lifetime bound to the life time of the process. > > Get rid of the refcounting mechanisms and replace/rename the interfaces > to reflect this new approach. > > Suggested-by: Dave Hansen > Signed-off-by: Fenghua Yu >

Re: [PATCH v3 00/10] iommu cleanup and refactoring

2022-02-15 Thread Joerg Roedel
Hi Baolu, On Tue, Feb 15, 2022 at 10:05:42AM +0800, Lu Baolu wrote: > Do you want me to send a new version with below changes: > > - Remove WARN_ON() in dev_iommu_ops(); > - Merge above two patches. > > Or, you can change above yourself? Please make the changes and send a new version. I will ap

Re: [PATCH v1 5/8] iommu/amd: Use iommu_attach/detach_device()

2022-02-15 Thread Joerg Roedel
On Mon, Feb 14, 2022 at 11:00:59AM -0400, Jason Gunthorpe wrote: > On Mon, Feb 14, 2022 at 03:23:07PM +0100, Joerg Roedel wrote: > > > Device drivers calling into iommu_attach_device() is seldom a good > > idea. In this case the sound device has some generic hardware > &

Re: [PATCH v1 3/8] iommu: Extend iommu_at[de]tach_device() for multi-device groups

2022-02-15 Thread Joerg Roedel
On Mon, Feb 14, 2022 at 11:46:26AM -0400, Jason Gunthorpe wrote: > On Mon, Feb 14, 2022 at 03:18:31PM +, Robin Murphy wrote: > > > Arguably, iommu_attach_device() could be renamed something like > > iommu_attach_group_for_dev(), since that's effectively the semantic that all > > the existing A

Re: [PATCH v2] iommu/iova: Separate out rcache init

2022-02-14 Thread Joerg Roedel
On Thu, Feb 03, 2022 at 05:59:20PM +0800, John Garry wrote: > Currently the rcache structures are allocated for all IOVA domains, even if > they do not use "fast" alloc+free interface. This is wasteful of memory. > > In addition, fails in init_iova_rcaches() are not handled safely, which is > less

Re: [PATCH v1 3/8] iommu: Extend iommu_at[de]tach_device() for multi-device groups

2022-02-14 Thread Joerg Roedel
On Mon, Feb 14, 2022 at 09:03:13AM -0400, Jason Gunthorpe wrote: > Groups should disappear into an internal implementation detail, not be > so prominent in the API. Not going to happen, IOMMU groups are ABI and todays device assignment code, including user-space, relies on them. Groups implement

Re: [PATCH v1 5/8] iommu/amd: Use iommu_attach/detach_device()

2022-02-14 Thread Joerg Roedel
On Mon, Feb 14, 2022 at 10:02:36AM -0400, Jason Gunthorpe wrote: > That works for VFIO, but it doesn't work for other in-kernel > drivers.. Is there something ensuring the group is only the GPU and > sound device? Is the GPU never an addin card? GPUs supporting this functionality are always iGPUs,

Re: [PATCH v3 00/10] iommu cleanup and refactoring

2022-02-14 Thread Joerg Roedel
On Mon, Feb 14, 2022 at 09:55:28AM +0800, Lu Baolu wrote: > v3: > - Remove ops check when dev_iommu_ops() is used. > - This version of series is available on github: >https://github.com/LuBaolu/intel-iommu/commits/iommu-domain-ops-v3 > > Lu Baolu (10): > iommu/vt-d: Remove guest pasid rela

Re: [PATCH v1 5/8] iommu/amd: Use iommu_attach/detach_device()

2022-02-14 Thread Joerg Roedel
On Mon, Feb 14, 2022 at 09:15:44AM -0400, Jason Gunthorpe wrote: > But how does the sound device know that this has been done to it? > > eg how do we know the sound device hasn't been bound to VFIO or > something at this point? The iommu_attach_group() call will fail when the group (which include

Re: [PATCH v2 1/1] iommu/vt-d: Move intel_iommu_ops to header file

2022-02-14 Thread Joerg Roedel
On Mon, Feb 07, 2022 at 04:12:40PM +0200, Andy Shevchenko wrote: > diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h > index 69230fd695ea..1036c1900b5c 100644 > --- a/include/linux/intel-iommu.h > +++ b/include/linux/intel-iommu.h > @@ -813,6 +813,8 @@ bool context_present(stru

Re: [PATCH] iommu/msm: simplify with dev_err_probe()

2022-02-14 Thread Joerg Roedel
On Sun, Feb 06, 2022 at 09:29:45PM +0100, David Heidelberg wrote: > Use the dev_err_probe() helper to simplify error handling during probe. > This also handle scenario, when EDEFER is returned and useless error is > printed. > > Fixes warnings as: > msm_iommu 750.iommu: could not get smmu_pclk

Re: [PATCH] iommu/rockchip: : Use standard driver registration

2022-02-14 Thread Joerg Roedel
On Fri, Feb 04, 2022 at 10:34:05PM +0100, Heiko Stuebner wrote: > Am Freitag, 4. Februar 2022, 21:16:41 CET schrieb Robin Murphy: > > It's been a long time since there was any reason to register IOMMU > > drivers early. Convert to the standard platform driver helper. > > > > CC: Heiko Stuebner >

Re: [PATCH] iommu: Remove trivial ops->capable implementations

2022-02-14 Thread Joerg Roedel
On Thu, Feb 10, 2022 at 12:29:05PM +, Robin Murphy wrote: > Implementing ops->capable to always return false is pointless since it's > the default behaviour anyway. Clean up the unnecessary implementations. > > Signed-off-by: Robin Murphy > --- > > Spinning this out of my bus ops stuff (curr

Re: [PATCH v3 0/2] iommu/ipmmu-vmsa: Add support for R-Car Gen4

2022-02-14 Thread Joerg Roedel
On Tue, Feb 08, 2022 at 09:20:28AM +0900, Yoshihiro Shimoda wrote: > This patch series is based on renesas-drivers-2022-01-11-v5.16 [1]. > Note that we have to prepare the following registers' setting > in a bootloader (U-Boot) because the registers are protected. > Otherwise, data mismatch happene

Re: [PATCH v3 06/10] drm/nouveau/device: Get right pgsize_bitmap of iommu_domain

2022-02-14 Thread Joerg Roedel
s://lore.kernel.org/r/20211218074546.1772553-1-baolu...@linux.intel.com > Reviewed-by: Christoph Hellwig > Reviewed-by: Jason Gunthorpe Acked-by: Joerg Roedel I guess this is picked up by the DRM maintainers? ___ iommu mailing list iommu@lists

Re: [PATCH v3 07/10] iommu: Use right way to retrieve iommu_ops

2022-02-14 Thread Joerg Roedel
On Mon, Feb 14, 2022 at 09:55:35AM +0800, Lu Baolu wrote: > +static inline const struct iommu_ops *dev_iommu_ops(struct device *dev) > +{ > + /* > + * Assume that valid ops must be installed if iommu_probe_device() > + * has succeeded. The device ops are essentially for internal use >

Re: [PATCH] iommu/ipmmu-vmsa: Check for error num after setting mask

2022-02-14 Thread Joerg Roedel
On Mon, Feb 14, 2022 at 12:32:21PM +, Robin Murphy wrote: > In this particular case it cannot fail on any system the driver actually > runs on - it's a platform device so the dma_mask pointer is always > initialised, then dma_direct_supported() on arm64 will always return true > for any mask wi

Re: [PATCH] IOMMU: Intel: DMAR: Replace acpi_bus_get_device()

2022-02-14 Thread Joerg Roedel
On Tue, Feb 01, 2022 at 07:11:40PM +0100, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > Replace acpi_bus_get_device() that is going to be dropped with > acpi_fetch_acpi_dev(). > > No intentional functional impact. > > Signed-off-by: Rafael J. Wysocki > --- > drivers/iommu/intel/dmar.

Re: [PATCH] iommu/amd: Fix I/O page table memory leak

2022-02-14 Thread Joerg Roedel
unching VM w/ pass-through devices. > > Fix by freeing the memory used for page table before updating the mode. > > Cc: Joerg Roedel > Reported-by: Daniel Jordan > Tested-by: Daniel Jordan > Signed-off-by: Suravee Suthikulpanit > Fixes: e42ba0633064 ("iommu/amd

Re: [PATCH] iommu/ipmmu-vmsa: Check for error num after setting mask

2022-02-14 Thread Joerg Roedel
Adding more potential reviewers. On Thu, Jan 06, 2022 at 10:43:02AM +0800, Jiasheng Jiang wrote: > Because of the possible failure of the dma_supported(), the > dma_set_mask_and_coherent() may return error num. > Therefore, it should be better to check it and return the error if > fails. > > Fixe

Re: [PATCH v1 3/8] iommu: Extend iommu_at[de]tach_device() for multi-device groups

2022-02-14 Thread Joerg Roedel
On Thu, Jan 06, 2022 at 10:20:48AM +0800, Lu Baolu wrote: > int iommu_attach_device(struct iommu_domain *domain, struct device *dev) > { > struct iommu_group *group; > - int ret; > + int ret = 0; > + > + if (domain->type != IOMMU_DOMAIN_UNMANAGED) > + return -EINVAL;

Re: [PATCH v1 5/8] iommu/amd: Use iommu_attach/detach_device()

2022-02-14 Thread Joerg Roedel
On Thu, Jan 06, 2022 at 10:33:45AM -0400, Jason Gunthorpe wrote: > But I'm not sure how this can work with multi-device groups - this > seems to assigns a domain setup for direct map, so perhaps this only > works if all devices are setup for direct map? Right, at boot all devices in this group are

Re: [PATCH 1/2] iommu/vt-d: Fix PCI bus rescan device hot add

2022-02-14 Thread Joerg Roedel
Hi Jacob, On Wed, Feb 09, 2022 at 01:52:49PM -0800, Jacob Pan wrote: > Another option Ashok and I discussed is that we can make DMAR cache persist > (which should be for explicitly listed devices in each DRHD) across PCI > remove-rescan cycle, then we don't need the DMAR PCI bus notifier at all. >

[git pull] IOMMU Fixes for Linux v5.17-rc2

2022-02-04 Thread Joerg Roedel
: Fix potential memory leak in intel_setup_irq_remapping() Joerg Roedel (1): iommu/amd: Fix loop timeout issue in iommu_ga_log_enable() John Garry (1): iommu: Fix some W=1 warnings Vijayanand Jitta (1): iommu: Fix potential use-after-free during probe drivers/iommu/amd/init.c

[PATCH v2] iommu/amd: Fix loop timeout issue in iommu_ga_log_enable()

2022-02-04 Thread Joerg Roedel
From: Joerg Roedel The polling loop for the register change in iommu_ga_log_enable() needs to have a udelay() in it. Otherwise the CPU might be faster than the IOMMU hardware and wrongly trigger the WARN_ON() further down the code stream. Use a 10us for udelay(), has there is some hardware

Re: [PATCH] iommu/amd: Fix loop timeout issue in iommu_ga_log_enable()

2022-02-04 Thread Joerg Roedel
On Mon, Jan 31, 2022 at 05:06:03PM +, John Garry wrote: > > diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c > > index dc338acf3338..d2e09d53851f 100644 > > --- a/drivers/iommu/amd/init.c > > +++ b/drivers/iommu/amd/init.c > > @@ -834,6 +834,7 @@ static int iommu_ga_log_enable(s

Re: [PATCH 1/2] iommu/vt-d: Fix PCI bus rescan device hot add

2022-02-03 Thread Joerg Roedel
On Tue, Feb 01, 2022 at 11:19:18AM -0800, Jacob Pan wrote: > Do you mean having an IRQ remapping notifier regardless IOMMU-API is > enabled, right? > It make sense, I will give it a try. Yeah, that would be best. I really don't like to use two notifiers just to work around ordering issues. Regard

[PATCH] iommu/amd: Fix loop timeout issue in iommu_ga_log_enable()

2022-01-31 Thread Joerg Roedel
From: Joerg Roedel The polling loop for the register change in iommu_ga_log_enable() needs to have a udelay() in it. Otherwise the CPU might be faster than the IOMMU hardware and wrongly trigger the WARN_ON() further down the code stream. Fixes: 8bda0cfbdc1a ("iommu/amd: Detect and initi

Re: [PATCH 2/2] iommu/vt-d: Fix potential memory leak in intel_setup_irq_remapping()

2022-01-31 Thread Joerg Roedel
On Fri, Jan 28, 2022 at 11:10:02AM +0800, Lu Baolu wrote: > From: Guoqing Jiang > > After commit e3beca48a45b ("irqdomain/treewide: Keep firmware node > unconditionally allocated"). For tear down scenario, fn is only freed > after fail to allocate ir_domain, though it also should be freed in case

Re: [PATCH 1/2] iommu/vt-d: Fix PCI bus rescan device hot add

2022-01-31 Thread Joerg Roedel
On Mon, Jan 31, 2022 at 01:53:06PM +, Robin Murphy wrote: > Indeed I very nearly asked whether we couldn't just call these from > intel_iommu_{probe,release}_device() directly, but it looks like they also > interact with the interrupt remapping stuff which can be built independently > of the IO

Re: [PATCH] iommu: Fix some W=1 warnings

2022-01-31 Thread Joerg Roedel
On Fri, Jan 28, 2022 at 06:44:33PM +0800, John Garry wrote: > The code is mostly free of W=1 warning, so fix the following: > > drivers/iommu/iommu.c:996: warning: expecting prototype for > iommu_group_for_each_dev(). Prototype was for __iommu_group_for_each_dev() > instead > drivers/iommu/iommu

Re: [REPOST PATCH v4] iommu: Fix potential use-after-free during probe

2022-01-31 Thread Joerg Roedel
On Mon, Jan 31, 2022 at 12:42:35PM +0530, Vijayanand Jitta wrote: > drivers/iommu/iommu.c | 9 +++-- > 1 file changed, 7 insertions(+), 2 deletions(-) Applied, thanks Vijayanand. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.

Re: [PATCH] iommu/tegra-smmu: Fix missing put_device() call in tegra_smmu_find

2022-01-31 Thread Joerg Roedel
Thierry, does this look correct to you? Thanks, Joerg On Fri, Jan 07, 2022 at 08:09:11AM +, Miaoqian Lin wrote: > The reference taken by 'of_find_device_by_node()' must be released when > not needed anymore. > Add the corresponding 'put_device()' in the error handling path. > > Fix

Re: [PATCH 1/2] iommu/vt-d: Fix PCI bus rescan device hot add

2022-01-29 Thread Joerg Roedel
Hi Jacob, Baolu, On Fri, Jan 28, 2022 at 11:10:01AM +0800, Lu Baolu wrote: > During PCI bus rescan, adding new devices involve two notifiers. > 1. dmar_pci_bus_notifier() > 2. iommu_bus_notifier() > The current code sets #1 as low priority (INT_MIN) which resulted in #2 > being invoked first. The

[git pull] IOMMU Updates for Linux v5.17

2022-01-12 Thread Joerg Roedel
s iommu/virtio: Pass end address to viommu_add_mapping() iommu/virtio: Support identity-mapped domains Joerg Roedel (3): Merge tag 'arm-smmu-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux into arm/smmu iommu/iova: Temporarily include dma-map

[PATCH] iommu/iova: Temporarily include dma-mapping.h from iova.h

2021-12-20 Thread Joerg Roedel
From: Joerg Roedel Some users of iova.h still expect that dma-mapping.h is also included. Re-add the include until these users are updated to fix compile failures in the iommu tree. Signed-off-by: Joerg Roedel --- include/linux/iova.h | 1 + 1 file changed, 1 insertion(+) diff --git a

Re: [PATCH v3 0/9] iommu: refactor flush queues into iommu-dma

2021-12-20 Thread Joerg Roedel
On Fri, Dec 17, 2021 at 03:30:54PM +, Robin Murphy wrote: > Matthew Wilcox (Oracle) (2): > iommu/amd: Use put_pages_list > iommu/vt-d: Use put_pages_list > > Robin Murphy (6): > iommu/iova: Squash entry_dtor abstraction > iommu/iova: Squash flush_cb abstraction > iommu/amd: Simplify

Re: [PATCH] iommu/amd: Fix typo in *glues … together* in comment

2021-12-20 Thread Joerg Roedel
On Fri, Dec 17, 2021 at 02:49:16PM +0100, Paul Menzel wrote: > Signed-off-by: Paul Menzel > --- > drivers/iommu/amd/init.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org

Re: [PATCH 0/4] [PULL REQUEST] Intel IOMMU Updates for Linux v5.17

2021-12-17 Thread Joerg Roedel
On Fri, Dec 17, 2021 at 04:38:13PM +0800, Lu Baolu wrote: > Hi Joerg, > > The patches queued in this series are for v5.17. It includes: > > - Various cleanups, no functional changes. > > Please pull. Applied, thanks Baolu. ___ iommu mailing list iom

Re: [PATCH 0/5] iommu/amd: fixes for suspend/resume

2021-12-17 Thread Joerg Roedel
On Tue, Nov 23, 2021 at 06:10:33PM +0200, Maxim Levitsky wrote: > Maxim Levitsky (5): > iommu/amd: restore GA log/tail pointer on host resume > iommu/amd: x2apic mode: re-enable after resume > iommu/amd: x2apic mode: setup the INTX registers on mask/unmask > iommu/amd: x2apic mode: mask/unm

Re: [PATCH v2] iova: Move fast alloc size roundup into alloc_iova_fast()

2021-12-17 Thread Joerg Roedel
On Tue, Dec 07, 2021 at 07:17:26PM +0800, John Garry wrote: > It really is a property of the IOVA rcache code that we need to alloc a > power-of-2 size, so relocate the functionality to resize into > alloc_iova_fast(), rather than the callsites. > > Signed-off-by: John Garry > Acked-by: Will Deac

Re: [PATCH] iommu/virtio: Fix typo in a comment

2021-12-17 Thread Joerg Roedel
On Thu, Dec 16, 2021 at 04:33:02PM +0800, Xiang wangx wrote: > The double `as' in a comment is repeated, thus it should be removed. > > Signed-off-by: Xiang wangx > --- > drivers/iommu/virtio-iommu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied, thanks. __

Re: [PATCH 1/1] iommu/vt-d: Remove unused macros

2021-12-17 Thread Joerg Roedel
On Thu, Dec 16, 2021 at 09:17:03AM +0800, Lu Baolu wrote: > These macros has no reference in the tree anymore. Cleanup them. > > Signed-off-by: Lu Baolu > --- > include/linux/intel-svm.h | 6 -- > 1 file changed, 6 deletions(-) Applied, thanks. __

Re: [PATCH] iommu: Use correctly sized arguments for bit field

2021-12-17 Thread Joerg Roedel
On Wed, Dec 15, 2021 at 03:24:32PM -0800, Kees Cook wrote: > The find.h APIs are designed to be used only on unsigned long arguments. > This can technically result in a over-read, but it is harmless in this > case. Regardless, fix it to avoid the warning seen under -Warray-bounds, > which we'd like

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

2021-12-17 Thread Joerg Roedel
On Wed, Dec 15, 2021 at 11:21:24AM +, Will Deacon wrote: > git://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git > tags/arm-smmu-updates Pulled, thanks Will. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundat

Re: [PATCH v3 0/5] iommu/virtio: Add identity domains

2021-12-06 Thread Joerg Roedel
On Wed, Dec 01, 2021 at 05:33:20PM +, Jean-Philippe Brucker wrote: > Jean-Philippe Brucker (5): > iommu/virtio: Add definitions for VIRTIO_IOMMU_F_BYPASS_CONFIG > iommu/virtio: Support bypass domains > iommu/virtio: Sort reserved regions > iommu/virtio: Pass end address to viommu_add_ma

Re: [PATCH 0/5] iommu/amd: fixes for suspend/resume

2021-12-06 Thread Joerg Roedel
On Tue, Nov 23, 2021 at 06:10:33PM +0200, Maxim Levitsky wrote: > Best regards, >Maxim Levitsky > > Maxim Levitsky (5): > iommu/amd: restore GA log/tail pointer on host resume > iommu/amd: x2apic mode: re-enable after resume > iommu/amd: x2apic mode: setup the INTX registers on mask/unma

Re: [PATCH v9 00/15] Clean up "mediatek,larb"

2021-12-06 Thread Joerg Roedel
l > conversion series first, though. This time with the linux-media mailinglist > included :-) > > I would need your Ack for the iommu patches as well, of course. Okay, makes sense. IOMMU parts are Acked-by: Joerg Roedel ___ iommu mail

Re: [PATCH v3 01/18] iommu: Add device dma ownership set/release interfaces

2021-12-06 Thread Joerg Roedel
On Mon, Dec 06, 2021 at 09:58:46AM +0800, Lu Baolu wrote: > >From the perspective of who is initiating the device to do DMA, device > DMA could be divided into the following types: > > DMA_OWNER_DMA_API: Device DMAs are initiated by a kernel driver > through the kerne

Re: [PATCH 4/9] iommu/amd: Simplify pagetable freeing

2021-12-06 Thread Joerg Roedel
On Tue, Nov 23, 2021 at 02:10:39PM +, Robin Murphy wrote: > For reasons unclear, pagetable freeing is an effectively recursive > method implemented via an elaborate system of templated functions that > turns out to account for 25% of the object file size. Implementing it > using regular straigh

Re: [PATCH 1/9] gpu: host1x: Add missing DMA API include

2021-12-06 Thread Joerg Roedel
Hi Robin, On Wed, Nov 24, 2021 at 02:05:15PM +, Robin Murphy wrote: > Bah, seems like tegra-vic needs the same treatment too, but wasn't in my > local config. Should I squash that into a respin of this patch on the > grounds of being vaguely related, or would you prefer it separate? In case t

Re: [PATCH 0/4] iommu: M1 Pro/Max DART support

2021-12-06 Thread Joerg Roedel
Hi Sven, On Wed, Nov 17, 2021 at 10:15:05PM +0100, Sven Peter wrote: > Sven Peter (4): > dt-bindings: iommu: dart: add t6000 compatible > iommu/io-pgtable: Add DART subpage protection support > iommu/io-pgtable: Add DART PTE support for t6000 > iommu: dart: Support t6000 variant Looks goo

Re: [PATCH v2] iommu/io-pgtable-arm: Fix table descriptor paddr formatting

2021-12-06 Thread Joerg Roedel
On Sat, Nov 20, 2021 at 12:13:43PM +0900, Hector Martin wrote: > drivers/iommu/io-pgtable-arm.c | 9 + > 1 file changed, 5 insertions(+), 4 deletions(-) Applied, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linux

Re: [PATCH v2 1/6] iommu: Export iommu_{get,put}_resv_regions()

2021-12-06 Thread Joerg Roedel
On Tue, Nov 16, 2021 at 05:06:20PM +0800, Yicong Yang wrote: > Export iommu_{get,put}_resv_regions() to the modules so that the driver > can retrieve and use the reserved regions of the device. Why should any driver bother? These functions are only used by the iommu core to call into iommu drivers

Re: [PATCH v9 00/15] Clean up "mediatek,larb"

2021-12-06 Thread Joerg Roedel
On Fri, Nov 12, 2021 at 06:54:54PM +0800, Yong Wu wrote: > Yong Wu (14): > dt-binding: mediatek: Get rid of mediatek, larb for multimedia HW > iommu/mediatek-v1: Free the existed fwspec if the master dev already > has > iommu/mediatek: Return ENODEV if the device is NULL > iommu/mediate

Re: [PATCH 1/1] iommu: Extend mutex lock scope in iommu_probe_device()

2021-12-06 Thread Joerg Roedel
On Mon, Nov 08, 2021 at 02:13:49PM +0800, Lu Baolu wrote: > Extend the scope of holding group->mutex so that it can cover the default > domain check/attachment and direct mappings of reserved regions. > > Cc: Ashish Mhetre > Fixes: 211ff31b3d33b ("iommu: Fix race condition during default domain

Re: [PATCH] iommu: log iova range in map/unmap trace events

2021-12-06 Thread Joerg Roedel
On Thu, Nov 04, 2021 at 09:16:20AM +0200, Dafna Hirschfeld wrote: > In case of an iommu page fault, the faulting iova is logged in > trace_io_page_fault. It is therefore convenient to log the > iova range in mapping/unmapping trace events so that it is > easier to see if the faulting iova was recen

Re: [RFC v16 1/9] iommu: Introduce attach/detach_pasid_table API

2021-12-06 Thread Joerg Roedel
On Wed, Oct 27, 2021 at 12:44:20PM +0200, Eric Auger wrote: > Signed-off-by: Jean-Philippe Brucker > Signed-off-by: Liu, Yi L > Signed-off-by: Ashok Raj > Signed-off-by: Jacob Pan > Signed-off-by: Eric Auger This Signed-of-by chain looks dubious, you are the author but the last one in the cha

[git pull] IOMMU Fixes for Linux v5.16-rc2

2021-11-28 Thread Joerg Roedel
: Fix unmap_pages support Christophe JAILLET (1): iommu/vt-d: Fix an unbalanced rcu_read_lock/rcu_read_unlock() Joerg Roedel (2): iommu/vt-d: Remove unused PASID_DISABLED iommu/amd: Clarify AMD IOMMUv2 initialization messages arch/x86/include/asm/fpu/api.h | 6 -- drivers

Re: [PATCH v2 0/2] iommu/vt-d: Fixes for v5.16-rc3

2021-11-26 Thread Joerg Roedel
On Fri, Nov 26, 2021 at 09:55:54PM +0800, Lu Baolu wrote: > Update this series with a fix for an issue reported by Intel 0-day > robot. Sorry for the inconvenience. Replaced those with the previous fixes, thanks. Please just send a fix on-top next time. This was already in the published fixes bran

Re: [PATCH] iommu/rockchip: Fix PAGE_DESC_HI_MASKs for RK3568

2021-11-24 Thread Joerg Roedel
On Wed, Nov 24, 2021 at 03:13:25AM +0100, Alex Bee wrote: > With the submission of iommu driver for RK3568 a subtle bug was > introduced: PAGE_DESC_HI_MASK1 and PAGE_DESC_HI_MASK2 have to be > the other way arround - that leads to random errors, especially when > addresses beyond 32 bit are used. >

Re: [PATCH 0/2] iommu/vt-d: Fixes for v5.16-rc3

2021-11-23 Thread Joerg Roedel
On Mon, Nov 22, 2021 at 11:24:56AM +0800, Lu Baolu wrote: > Alex Williamson (1): > iommu/vt-d: Fix unmap_pages support > > Christophe JAILLET (1): > iommu/vt-d: Fix an unbalanced rcu_read_lock/rcu_read_unlock() Queued for v5.16, thanks. ___ iommu ma

[PATCH 0/2] iommu: Two minor cleanups for v5.16

2021-11-23 Thread Joerg Roedel
From: Joerg Roedel Hi, here are two minor cleanups in the IOMMU code for v5.16. If there are no objections I will sent them upstream this week. Regards, Joerg Joerg Roedel (2): iommu/vt-d: Remove unused PASID_DISABLED iommu/amd: Clarify AMD IOMMUv2 initialization messages arch

[PATCH 2/2] iommu/amd: Clarify AMD IOMMUv2 initialization messages

2021-11-23 Thread Joerg Roedel
From: Joerg Roedel The messages printed on the initialization of the AMD IOMMUv2 driver have caused some confusion in the past. Clarify the messages to lower the confusion in the future. Cc: sta...@vger.kernel.org Signed-off-by: Joerg Roedel --- drivers/iommu/amd/iommu_v2.c | 6 +++--- 1 file

[PATCH 1/2] iommu/vt-d: Remove unused PASID_DISABLED

2021-11-23 Thread Joerg Roedel
From: Joerg Roedel The macro is unused after commit 00ecd5401349a so it can be removed. Reported-by: Linus Torvalds Fixes: 00ecd5401349a ("iommu/vt-d: Clean up unused PASID updating functions") Signed-off-by: Joerg Roedel --- arch/x86/include/asm/fpu/api.h | 6 -- 1 file

Re: [git pull] IOMMU Updates for Linux v5.16

2021-11-05 Thread Joerg Roedel
On Thu, Nov 04, 2021 at 11:10:53AM -0700, Linus Torvalds wrote: > That too seems to be stale and unused since commit 9bfecd058339 > ("x86/cpufeatures: Force disable X86_FEATURE_ENQCMD and remove > update_pasid()") > > I left it alone because I didn't want to do any extra development in > the merge

[git pull] IOMMU Updates for Linux v5.16

2021-11-04 Thread Joerg Roedel
ers iommu/dma: Check CONFIG_SWIOTLB more broadly swiotlb: Support aligned swiotlb buffers iommu/dma: Account for min_align_mask w/swiotlb Fenghua Yu (1): iommu/vt-d: Clean up unused PASID updating functions Gustavo A. R. Silva (1): iommu/dma: Use kvcalloc() instead of

Re: [PATCH] iommu/dart: Initialize DART_STREAMS_ENABLE

2021-10-27 Thread Joerg Roedel
On Tue, Oct 19, 2021 at 06:22:53PM +0200, Sven Peter wrote: > DART has an additional global register to control which streams are > isolated. This register is a bit redundant since DART_TCR can already > be used to control isolation and is usually initialized to DART_STREAM_ALL > by the time we get

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

2021-10-27 Thread Joerg Roedel
On Tue, Oct 19, 2021 at 01:54:34PM +0100, Will Deacon wrote: > git://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git > tags/arm-smmu-updates Pulled, thanks Will. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundat

Re: [PATCH][next] iommu/dma: Use kvcalloc() instead of kvzalloc()

2021-10-27 Thread Joerg Roedel
On Tue, Sep 28, 2021 at 05:22:29PM -0500, Gustavo A. R. Silva wrote: > Use 2-factor argument form kvcalloc() instead of kvzalloc(). > > Link: https://github.com/KSPP/linux/issues/162 > Signed-off-by: Gustavo A. R. Silva > --- > drivers/iommu/dma-iommu.c | 2 +- > 1 file changed, 1 insertion(+),

Re: [PATCH 0/9] [PULL REQUEST] Intel IOMMU Updates for Linux v5.16

2021-10-18 Thread Joerg Roedel
On Thu, Oct 14, 2021 at 01:38:30PM +0800, Lu Baolu wrote: > Fenghua Yu (1): > iommu/vt-d: Clean up unused PASID updating functions > > Kyung Min Park (1): > iommu/vt-d: Dump DMAR translation structure when DMA fault occurs > > Longpeng(Mike) (2): > iommu/vt-d: Convert the return type of fir

Re: [PATCH] iommu/tegra-smmu: Use devm_bitmap_zalloc when applicable

2021-10-18 Thread Joerg Roedel
On Sun, Sep 26, 2021 at 03:07:18PM +0200, Christophe JAILLET wrote: > 'smmu->asids' is a bitmap. So use 'devm_kzalloc()' to simplify code, > improve the semantic of the code and avoid some open-coded arithmetic in > allocator arguments. > > Signed-off-by: Christophe JAILLET > --- > drivers/iommu

Re: [PATCH] iommu/dart: use kmemdup instead of kzalloc and memcpy

2021-10-18 Thread Joerg Roedel
On Wed, Oct 13, 2021 at 02:34:41AM -0400, Wan Jiabing wrote: > Fix following coccicheck warning: > drivers/iommu/apple-dart.c:704:20-27: WARNING opportunity for kmemdup > > Signed-off-by: Wan Jiabing > --- > drivers/iommu/apple-dart.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) Ap

Re: [PATCH v2 1/5] [RFC]iommu: Add a IOMMU_DEVONLY protection flag

2021-10-18 Thread Joerg Roedel
On Fri, Oct 01, 2021 at 04:34:23PM +0200, Boris Brezillon wrote: > +/* > + * Mapping is only accessed by the device behind the iommu. That means other > + * devices or CPUs are not expected to access this physical memory region, > + * and the MMU driver can safely restrict the shareability domain t

[git pull] IOMMU Fixes for Linux v5.15-rc3

2021-10-01 Thread Joerg Roedel
Hi Linus, The following changes since commit 5816b3e6577eaa676ceb00a848f0fd65fe2adc29: Linux 5.15-rc3 (2021-09-26 14:08:19 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git tags/iommu-fixes-v5.15-rc3 for you to fetch changes up to

Re: [PATCH] iommu/mediatek: fix out-of-range warning with clang

2021-09-28 Thread Joerg Roedel
On Mon, Sep 27, 2021 at 02:18:44PM +0200, Arnd Bergmann wrote: > drivers/iommu/mtk_iommu.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) Applied, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation

Re: [PATCH v4] iommu/amd: Use report_iommu_fault()

2021-09-28 Thread Joerg Roedel
On Sat, Sep 25, 2021 at 05:18:02PM +0300, Lennert Buytenhek wrote: > +#define IS_IOMMU_MEM_TRANSACTION(flags) \ > + (((flags) & EVENT_FLAG_I) == 0) > + > +#define IS_WRITE_REQUEST(flags) \ > + ((flags) & EVENT_FLAG_RW) > + > static void amd_iommu_report_pa

Re: [PATCH] iommu/dart: Clear sid2group entry when a group is freed

2021-09-28 Thread Joerg Roedel
On Fri, Sep 24, 2021 at 03:45:02PM +0200, Sven Peter wrote: > drivers/iommu/apple-dart.c | 38 +++--- > 1 file changed, 35 insertions(+), 3 deletions(-) Applied for v5.15, thanks. ___ iommu mailing list iommu@lists.linux-

Re: [PATCH] iommu/ipmmu-vmsa: Hook up r8a77980 DT matching code

2021-09-28 Thread Joerg Roedel
On Thu, Sep 23, 2021 at 10:11:16PM +0300, Nikita Yushchenko wrote: > drivers/iommu/ipmmu-vmsa.c | 3 +++ > 1 file changed, 3 insertions(+) Applied, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman

Re: [PATCH 0/1] iommu/vt-d: A fix for v5.15-rc3

2021-09-28 Thread Joerg Roedel
On Wed, Sep 22, 2021 at 01:47:25PM +0800, Lu Baolu wrote: > Bjorn Helgaas (1): > iommu/vt-d: Drop "0x" prefix from PCI bus & device addresses Applied, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mai

Re: [PATCH] iommu/dart: Remove iommu_flush_ops

2021-09-28 Thread Joerg Roedel
On Tue, Sep 21, 2021 at 05:39:34PM +0200, Sven Peter wrote: > Fixes: 46d1fb072e76b161 ("iommu/dart: Add DART iommu driver") > Reported-by: Marc Zyngier > Signed-off-by: Sven Peter > --- > drivers/iommu/apple-dart.c | 18 -- > 1 file changed, 18 deletions(-) Applied for v5.15,

Re: [PATCH] iommu/dma: Tidy up Kconfig selects

2021-09-28 Thread Joerg Roedel
On Mon, Sep 13, 2021 at 01:41:19PM +0100, Robin Murphy wrote: > Now that the dust has settled on converting all the x86 drivers to > iommu-dma, we can punt the Kconfig selection to arch code where it > was always intended to be. Can we select IOMMU_DMA under IOMMU_SUPPORT instead? The only drivers

Re: [PATCH 0/2] iommu: DMA domain epilogue

2021-09-28 Thread Joerg Roedel
Hi Robin, On Mon, Sep 13, 2021 at 01:40:04PM +0100, Robin Murphy wrote: > Robin Murphy (2): > iommu/dart: Clean up IOVA cookie crumbs > iommu/dma: Unexport IOVA cookie management Thanks, all applied now. ___ iommu mailing list iommu@lists.linux-foun

Re: [PATCH v2 0/2] iommu/ipmmu-vmsa: Add support for r8a779a0

2021-09-28 Thread Joerg Roedel
On Tue, Sep 07, 2021 at 05:30:18PM +0900, Yoshihiro Shimoda wrote: > Yoshihiro Shimoda (2): > dt-bindings: iommu: renesas,ipmmu-vmsa: add r8a779a0 support > iommu/ipmmu-vmsa: Add support for r8a779a0 Applied, thanks, ___ iommu mailing list iommu@list

Re: [PATCH v7 0/7] Fixes for dma-iommu swiotlb bounce buffers

2021-09-28 Thread Joerg Roedel
On Mon, Aug 30, 2021 at 01:59:18PM +0900, David Stevens wrote: > David Stevens (7): > dma-iommu: fix sync_sg with swiotlb > dma-iommu: fix arch_sync_dma for map > dma-iommu: skip extra sync during unmap w/swiotlb > dma-iommu: fold _swiotlb helpers into callers > dma-iommu: Check CONFIG_SW

Re: [PATCH,RFC] iommu/amd: Recover from event log overflow

2021-09-28 Thread Joerg Roedel
Hi Lennert, On Sat, Aug 21, 2021 at 06:22:10PM +0300, Lennert Buytenhek wrote: > +/* > + * This function restarts event logging in case the IOMMU experienced > + * an event log buffer overflow. > + */ > +void amd_iommu_restart_event_logging(struct amd_iommu *iommu) > +{ > + iommu_feature_disab

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