Re: [PATCH v7 10/24] drm/rockchip: dw_hdmi: Add support for hclk

2022-02-25 Thread Robin Murphy
On 2022-02-25 11:10, Dmitry Osipenko wrote: 25.02.2022 13:49, Sascha Hauer пишет: On Fri, Feb 25, 2022 at 01:26:14PM +0300, Dmitry Osipenko wrote: 25.02.2022 10:51, Sascha Hauer пишет: The rk3568 HDMI has an additional clock that needs to be enabled for the HDMI controller to work. The purpose

Re: [PATCH v6 01/11] iommu: Add dma ownership management interfaces

2022-02-24 Thread Robin Murphy
On 2022-02-24 05:29, Lu Baolu wrote: On 2/24/22 1:16 PM, Lu Baolu wrote: Hi Robin and Jason, On 2/24/22 2:02 AM, Jason Gunthorpe wrote: On Wed, Feb 23, 2022 at 06:00:06PM +, Robin Murphy wrote: ...and equivalently just set owner_cnt directly to 0 here. I don't see a realistic use

Re: [PATCH v6 01/11] iommu: Add dma ownership management interfaces

2022-02-23 Thread Robin Murphy
On 2022-02-23 18:02, Jason Gunthorpe via iommu wrote: On Wed, Feb 23, 2022 at 06:00:06PM +, Robin Murphy wrote: ...and equivalently just set owner_cnt directly to 0 here. I don't see a realistic use-case for any driver to claim the same group more than once, and allowing it in the API

Re: [PATCH v6 01/11] iommu: Add dma ownership management interfaces

2022-02-23 Thread Robin Murphy
On 2022-02-18 00:55, Lu Baolu wrote: [...] +/** + * iommu_group_claim_dma_owner() - Set DMA ownership of a group + * @group: The group. + * @owner: Caller specified pointer. Used for exclusive ownership. + * + * This is to support backward compatibility for vfio which manages + * the dma ownershi

Re: [PATCH v6 02/11] driver core: Add dma_cleanup callback in bus_type

2022-02-23 Thread Robin Murphy
Gunthorpe wrote: On Wed, Feb 23, 2022 at 01:04:00PM +, Robin Murphy wrote: 1 - tmp->driver is non-NULL because tmp is already bound. 1.a - If tmp->driver->driver_managed_dma == 0, the group must currently be DMA-API-owned as a whole. Regardless of what driver dev has unbound

Re: [PATCH v6 02/11] driver core: Add dma_cleanup callback in bus_type

2022-02-23 Thread Robin Murphy
On 2022-02-23 05:01, Lu Baolu wrote: On 2/23/22 7:53 AM, Jason Gunthorpe wrote: To spell it out, the scheme I'm proposing looks like this: Well, I already got this, it is what is in driver_or_DMA_API_token() that matters I think you are suggesting to do something like:     if (!READ_ONCE(dev-

Re: [PATCH v3 2/9] gpu: host1x: Add context bus

2022-02-22 Thread Robin Murphy
On 2022-02-22 16:21, Christoph Hellwig wrote: On Fri, Feb 18, 2022 at 01:39:45PM +0200, Mikko Perttunen wrote: The context bus is a "dummy" bus that contains struct devices that correspond to IOMMU contexts assigned through Host1x to processes. Even when host1x itself is built as a module, the

Re: [PATCH v3 2/9] gpu: host1x: Add context bus

2022-02-22 Thread Robin Murphy
On 2022-02-22 16:21, Christoph Hellwig wrote: On Fri, Feb 18, 2022 at 01:39:45PM +0200, Mikko Perttunen wrote: The context bus is a "dummy" bus that contains struct devices that correspond to IOMMU contexts assigned through Host1x to processes. Even when host1x itself is built as a module, the

Re: [PATCH v6 02/11] driver core: Add dma_cleanup callback in bus_type

2022-02-22 Thread Robin Murphy
On 2022-02-22 15:16, Jason Gunthorpe wrote: On Tue, Feb 22, 2022 at 10:58:37AM +, Robin Murphy wrote: On 2022-02-21 23:48, Jason Gunthorpe wrote: On Mon, Feb 21, 2022 at 08:43:33PM +, Robin Murphy wrote: On 2022-02-19 07:32, Christoph Hellwig wrote: So we are back to the callback

Re: [PATCH v6 02/11] driver core: Add dma_cleanup callback in bus_type

2022-02-22 Thread Robin Murphy
On 2022-02-21 23:48, Jason Gunthorpe wrote: On Mon, Feb 21, 2022 at 08:43:33PM +, Robin Murphy wrote: On 2022-02-19 07:32, Christoph Hellwig wrote: So we are back to the callback madness instead of the nice and simple flag? Sigh. TBH, I *think* this part could be a fair bit simpler. It

Re: [PATCH v6 02/11] driver core: Add dma_cleanup callback in bus_type

2022-02-21 Thread Robin Murphy
On 2022-02-19 07:32, Christoph Hellwig wrote: So we are back to the callback madness instead of the nice and simple flag? Sigh. TBH, I *think* this part could be a fair bit simpler. It looks like this whole callback mess is effectively just to decrement group->owner_cnt, but since we should

Re: [PATCH v3 8/9] drm/tegra: vic: Implement get_streamid_offset

2022-02-21 Thread Robin Murphy
On 2022-02-18 11:39, Mikko Perttunen via iommu wrote: Implement the get_streamid_offset required for supporting context isolation. Since old firmware cannot support context isolation without hacks that we don't want to implement, check the firmware binary to see if context isolation should be ena

Re: [PATCH v3 8/9] drm/tegra: vic: Implement get_streamid_offset

2022-02-21 Thread Robin Murphy
On 2022-02-18 11:39, Mikko Perttunen via iommu wrote: Implement the get_streamid_offset required for supporting context isolation. Since old firmware cannot support context isolation without hacks that we don't want to implement, check the firmware binary to see if context isolation should be ena

Re: [PATCH v3 1/9] dt-bindings: host1x: Add memory-contexts property

2022-02-21 Thread Robin Murphy
On 2022-02-21 15:28, Mikko Perttunen wrote: On 2/21/22 17:23, Robin Murphy wrote: On 2022-02-18 11:39, Mikko Perttunen via iommu wrote: Add schema information for the memory-contexts property used to specify context stream IDs. This uses the standard iommu-map property inside a child node

Re: [PATCH v3 1/9] dt-bindings: host1x: Add memory-contexts property

2022-02-21 Thread Robin Murphy
On 2022-02-21 15:28, Mikko Perttunen wrote: On 2/21/22 17:23, Robin Murphy wrote: On 2022-02-18 11:39, Mikko Perttunen via iommu wrote: Add schema information for the memory-contexts property used to specify context stream IDs. This uses the standard iommu-map property inside a child node

Re: [PATCH v3 1/9] dt-bindings: host1x: Add memory-contexts property

2022-02-21 Thread Robin Murphy
On 2022-02-18 11:39, Mikko Perttunen via iommu wrote: Add schema information for the memory-contexts property used to specify context stream IDs. This uses the standard iommu-map property inside a child node. Couldn't you simply make "iommu-map" an allowed property on the host1x node itself? F

Re: [PATCH v3 1/9] dt-bindings: host1x: Add memory-contexts property

2022-02-21 Thread Robin Murphy
On 2022-02-18 11:39, Mikko Perttunen via iommu wrote: Add schema information for the memory-contexts property used to specify context stream IDs. This uses the standard iommu-map property inside a child node. Couldn't you simply make "iommu-map" an allowed property on the host1x node itself? F

Re: [PATCH] dma-contiguous: Prioritize restricted DMA pool over shared DMA pool

2022-02-16 Thread Robin Murphy
On 2022-02-16 17:37, Florian Fainelli wrote: On 2/16/22 3:13 AM, Robin Murphy wrote: On 2022-02-15 22:43, Florian Fainelli wrote: Some platforms might define the same memory region to be suitable for used by a kernel supporting CONFIG_DMA_RESTRICTED_POOL while maintaining compatibility with

Re: [PATCH] dma-contiguous: Prioritize restricted DMA pool over shared DMA pool

2022-02-16 Thread Robin Murphy
On 2022-02-15 22:43, Florian Fainelli wrote: Some platforms might define the same memory region to be suitable for used by a kernel supporting CONFIG_DMA_RESTRICTED_POOL while maintaining compatibility with older kernels that do not support that. This is achieved by declaring the node this way;

Re: [PATCH v3 8/8] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-02-15 Thread Robin Murphy
On 2022-02-15 13:42, Will Deacon wrote: On Tue, Feb 15, 2022 at 01:30:26PM +, Robin Murphy wrote: On 2022-02-15 13:00, Will Deacon wrote: On Mon, Feb 14, 2022 at 08:55:20PM +0800, Yicong Yang wrote: On 2022/1/24 21:11, Yicong Yang wrote: The DMA of HiSilicon PTT device can only work with

Re: [PATCH v3 8/8] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-02-15 Thread Robin Murphy
On 2022-02-15 13:00, Will Deacon wrote: On Mon, Feb 14, 2022 at 08:55:20PM +0800, Yicong Yang wrote: On 2022/1/24 21:11, Yicong Yang wrote: The DMA of HiSilicon PTT device can only work with identical mapping. So add a quirk for the device to force the domain passthrough. Signed-off-by: Yicong

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

2022-02-15 Thread Robin Murphy
On 2022-02-15 09:11, Joerg Roedel wrote: 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 hardw

Re: [PATCH 1/9] dt-bindings: Add arm,mali-valhall compatible

2022-02-15 Thread Robin Murphy
On 2022-02-11 20:27, alyssa.rosenzw...@collabora.com wrote: From: Alyssa Rosenzweig From the kernel's perspective, pre-CSF Valhall is more or less compatible with Bifrost, although they differ to userspace. Add a compatible for Valhall to the existing Bifrost bindings documentation. Signed-of

Re: [PATCH] drm/panfrost: Dynamically allocate pm_domains

2022-02-15 Thread Robin Murphy
On 2022-02-14 20:31, Alyssa Rosenzweig wrote: MT8192 requires 5 power domains. Rather than bump MAX_PM_DOMAINS and waste memory on every supported Panfrost chip, instead dynamically allocate pm_domain_devs and pm_domain_links. This adds some flexibility; it seems inevitable a new MediaTek device

Re: [PATCH 08/14] arm64: simplify access_ok()

2022-02-14 Thread Robin Murphy
aring at the 7-instruction sequence that Mark and I had come up with and certain that it could be shortened still. Kinda sad to see it go, but at the same time, glad that it can. Acked-by: Robin Murphy On a defconfig build, this saves over 28KB of .text. Not to mention saving those "WT

Re: [PATCH 08/14] arm64: simplify access_ok()

2022-02-14 Thread Robin Murphy
aring at the 7-instruction sequence that Mark and I had come up with and certain that it could be shortened still. Kinda sad to see it go, but at the same time, glad that it can. Acked-by: Robin Murphy On a defconfig build, this saves over 28KB of .text. Not to mention saving those "WT

Re: [PATCH v1 1/8] iommu: Add iommu_group_replace_domain()

2022-02-14 Thread Robin Murphy
On 2022-02-14 14:56, Jason Gunthorpe via iommu wrote: On Mon, Feb 14, 2022 at 02:10:19PM +, Robin Murphy wrote: On 2022-02-14 12:45, Jason Gunthorpe wrote: On Mon, Feb 14, 2022 at 12:09:36PM +, Robin Murphy wrote: On 2022-01-06 02:20, Lu Baolu wrote: Expose an interface to replace

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

2022-02-14 Thread Robin Murphy
On 2022-02-14 14:39, Joerg Roedel wrote: 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-

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

2022-02-14 Thread Robin Murphy
Make "fast" users call a separate rcache init explicitly, which includes error checking. Reviewed-by: Robin Murphy Signed-off-by: John Garry --- Differences to v1: - Drop stubs for iova_domain_init_rcaches() and iova_domain_free_rcaches() - Use put_iova_domain() in vdpa code diff --git

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

2022-02-14 Thread Robin Murphy
Make "fast" users call a separate rcache init explicitly, which includes error checking. Reviewed-by: Robin Murphy Signed-off-by: John Garry --- Differences to v1: - Drop stubs for iova_domain_init_rcaches() and iova_domain_free_rcaches() - Use put_iova_domain() in vdpa code diff --git

Re: [PATCH v1 1/8] iommu: Add iommu_group_replace_domain()

2022-02-14 Thread Robin Murphy
On 2022-02-14 12:45, Jason Gunthorpe wrote: On Mon, Feb 14, 2022 at 12:09:36PM +, Robin Murphy wrote: On 2022-01-06 02:20, Lu Baolu wrote: Expose an interface to replace the domain of an iommu group for frameworks like vfio which claims the ownership of the whole iommu group. But if the

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

2022-02-14 Thread Robin Murphy
On 2022-02-14 11:43, Joerg Roedel wrote: 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

Re: [PATCH v1 1/8] iommu: Add iommu_group_replace_domain()

2022-02-14 Thread Robin Murphy
On 2022-01-06 02:20, Lu Baolu wrote: Expose an interface to replace the domain of an iommu group for frameworks like vfio which claims the ownership of the whole iommu group. But if the underlying point is the new expectation that iommu_{attach,detach}_device() operate on the device's whole gr

Re: Error when running fio against nvme-of rdma target (mlx5 driver)

2022-02-11 Thread Robin Murphy
On 2022-02-10 23:58, Martin Oliveira wrote: On 2/9/22 1:41 AM, Chaitanya Kulkarni wrote: On 2/8/22 6:50 PM, Martin Oliveira wrote: Hello, We have been hitting an error when running IO over our nvme-of setup, using the mlx5 driver and we are wondering if anyone has seen anything similar/has an

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

2022-02-10 Thread Robin Murphy
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 (currently 30 patches and counting...) since it would be better off a

Re: [PATCH] iommu: explicitly check for NULL in iommu_dma_get_resv_regions()

2022-02-10 Thread Robin Murphy
On 2022-02-09 14:09, Aleksandr Fedorov wrote: iommu_dma_get_resv_regions() assumes that iommu_fwspec field for corresponding device is set which is not always true. Since iommu_dma_get_resv_regions() seems to be a future-proof generic API that can be used by any iommu driver, add an explicit che

Re: [PATCH v2 08/10] iommu: Remove unused argument in is_attach_deferred

2022-02-09 Thread Robin Murphy
On 2022-02-08 01:25, Lu Baolu wrote: The is_attach_deferred iommu_ops callback is a device op. The domain argument is unnecessary and never used. Remove it to make code clean. Suggested-by: Robin Murphy Signed-off-by: Lu Baolu --- include/linux/iommu.h | 2 +- drivers/iommu/amd

Re: Error when running fio against nvme-of rdma target (mlx5 driver)

2022-02-09 Thread Robin Murphy
On 2022-02-09 02:50, Martin Oliveira wrote: Hello, We have been hitting an error when running IO over our nvme-of setup, using the mlx5 driver and we are wondering if anyone has seen anything similar/has any suggestions. Both initiator and target are AMD EPYC 7502 machines connected over RDMA

Re: [PATCH 1/2] iommu/arm-smmu: Use platform_irq_count() to get the interrupt count

2022-02-08 Thread Robin Murphy
On 2022-02-08 15:19, Will Deacon wrote: On Thu, Dec 23, 2021 at 02:14:35PM +, Robin Murphy wrote: On 2021-12-23 13:00, Lad Prabhakar wrote: platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using

Re: [PATCH v2 1/1] iommu/dma: Use DMA ops setter instead of direct assignment

2022-02-07 Thread Robin Murphy
On 2022-02-07 14:13, Andy Shevchenko wrote: Use DMA ops setter instead of direct assignment. Even we know that this module doesn't perform access to the dma_ops member of struct device, it's better to use setter to avoid potential problems in the future. What potential problems are you imaginin

Re: [PATCH 2/2] iommu/arm-smmu-v3: Simplify memory allocation

2022-02-07 Thread Robin Murphy
On 2022-02-05 17:11, Christophe JAILLET wrote: Use devm_bitmap_zalloc() instead of hand writing it. Heh, that reminds me that I have more or less the same patch sat locally somewhere, except IIRC I took it further and removed the unhelpful error message and pruned the local variables as well

Re: [PATCH 1/2] iommu/arm-smmu-v3: Avoid open coded arithmetic in memory allocation

2022-02-07 Thread Robin Murphy
: Christophe JAILLET --- This is NOT compile tested. I don't have the needed cross compiling tools. FYI, https://cdn.kernel.org/pub/tools/crosstool/ Either way, the patch looks reasonable, thanks! Acked-by: Robin Murphy --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 4 ++-- 1

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

2022-02-04 Thread 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 Signed-off-by: Robin Murphy --- drivers/iommu/rockchip-iommu.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/dr

[PATCH] iommu/msm: Use standard driver registration

2022-02-04 Thread 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: Andy Gross CC: Bjorn Andersson Signed-off-by: Robin Murphy --- drivers/iommu/msm_iommu.c | 14 +- 1 file changed, 1 insertion(+), 13 dele

Re: iommu non-strict mode for arm64

2022-02-04 Thread Robin Murphy
On 2022-02-04 05:46, Josh Poimboeuf wrote: Hi all, We've gotten significant slowdowns on arm64 with 4k pages compared to 64k. The slowdowns can be alleviated by setting iommu.strict=0 or iommu.passthrough=1. Is there a reason x86 defaults to lazy iommu, while arm64 does not? Are there securit

Re: [PATCH v10 2/6] dt-bindings: gpio: logicvc: Add a compatible with major version only

2022-02-02 Thread Robin Murphy
On 2022-01-30 00:46, Linus Walleij wrote: On Thu, Jan 20, 2022 at 4:00 PM Paul Kocialkowski wrote: There are lots of different versions of the logicvc block and it makes little sense to list them all in compatibles since all versions with the same major are found to be register-compatible. T

Re: [PATCH 0/2] x86/hyperv/Swiotlb: Add swiotlb_alloc_from_low_pages switch

2022-02-02 Thread Robin Murphy
On 2022-02-02 08:12, Christoph Hellwig wrote: I think this interface is a little too hacky. In the end all the non-trusted hypervisor schemes (including the per-device swiotlb one) can allocate the memory from everywhere and want for force use of swiotlb. I think we need some kind of proper int

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

2022-01-31 Thread Robin Murphy
On 2022-01-30 07:43, Joerg Roedel wrote: 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 result

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

2022-01-28 Thread Robin Murphy
On 2022-01-28 11:32, John Garry wrote: On 26/01/2022 17:00, Robin Murphy wrote: As above, I vote for just forward-declaring the free routine in iova.c and keeping it entirely private. BTW, speaking of forward declarations, it's possible to remove all the forward declarations in iova.

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

2022-01-28 Thread Robin Murphy
On 2022-01-28 11:32, John Garry wrote: On 26/01/2022 17:00, Robin Murphy wrote: As above, I vote for just forward-declaring the free routine in iova.c and keeping it entirely private. BTW, speaking of forward declarations, it's possible to remove all the forward declarations in iova.

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

2022-01-28 Thread Robin Murphy
mmu_suspend_prepare(). Prototype was for omap_iommu_prepare() instead Certainly no harm in keeping the documentation up to date! Reviewed-by: Robin Murphy Signed-off-by: John Garry diff --git a/drivers/iommu/ioasid.c b/drivers/iommu/ioasid.c index 50ee27bbd04e..06fee7416816 100644 --- a/drivers/iom

Re: [RFC PATCH] component: Add common helpers for compare/release functions

2022-01-28 Thread Robin Murphy
On 2022-01-28 08:11, Yong Wu wrote: [...] diff --git a/include/linux/component.h b/include/linux/component.h index 16de18f473d7..5a7468ea827c 100644 --- a/include/linux/component.h +++ b/include/linux/component.h @@ -2,6 +2,8 @@ #ifndef COMPONENT_H #define COMPONENT_H +#include +#include

Re: [RFC PATCH] component: Add common helpers for compare/release functions

2022-01-28 Thread Robin Murphy
On 2022-01-28 08:11, Yong Wu wrote: [...] diff --git a/include/linux/component.h b/include/linux/component.h index 16de18f473d7..5a7468ea827c 100644 --- a/include/linux/component.h +++ b/include/linux/component.h @@ -2,6 +2,8 @@ #ifndef COMPONENT_H #define COMPONENT_H +#include +#include

Re: [PATCH 21/27] arm64: dts: rockchip: rk356x: Add HDMI nodes

2022-01-26 Thread Robin Murphy
On 2022-01-26 18:44, Peter Geis wrote: On Wed, Jan 26, 2022 at 12:56 PM Robin Murphy wrote: On 2022-01-26 16:04, Peter Geis wrote: On Wed, Jan 26, 2022 at 9:58 AM Sascha Hauer wrote: Add support for the HDMI port found on RK3568. Signed-off-by: Sascha Hauer --- arch/arm64/boot/dts

Re: [PATCH 21/27] arm64: dts: rockchip: rk356x: Add HDMI nodes

2022-01-26 Thread Robin Murphy
On 2022-01-26 16:04, Peter Geis wrote: On Wed, Jan 26, 2022 at 9:58 AM Sascha Hauer wrote: Add support for the HDMI port found on RK3568. Signed-off-by: Sascha Hauer --- arch/arm64/boot/dts/rockchip/rk356x.dtsi | 37 +++- 1 file changed, 36 insertions(+), 1 deletion(-)

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

2022-01-26 Thread Robin Murphy
On 2022-01-26 13:55, 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 than ideal. Make "fast" use

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

2022-01-26 Thread Robin Murphy
On 2022-01-26 13:55, 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 than ideal. Make "fast" use

Re: [PATCH v3 1/2] dt-bindings: arm: xen: document Xen iommu device

2022-01-26 Thread Robin Murphy
On 2022-01-26 15:09, Sergiy Kibrik wrote: Hi Robin, This could break Linux guests, since depending on the deferred probe timeout setting it could lead to drivers never probing because the "IOMMU" never becomes available. I've noticed no deferred probe timeouts when booting with this patch.

Re: [PATCH 0/7] iommu cleanup and refactoring

2022-01-26 Thread Robin Murphy
On 2022-01-26 13:27, Jason Gunthorpe via iommu wrote: On Wed, Jan 26, 2022 at 09:51:36AM +0800, Lu Baolu wrote: they are fundamentally different things in their own right, and the ideal API should give us the orthogonality to also bind a device to an SVA domain without PASID (e.g. for KVM stage

Re: [RFC][DISCUSSION] dma-mapping: allocating noncoherent buffer without mapping

2022-01-26 Thread Robin Murphy
On 2022-01-26 11:54, Hyeonggon Yoo wrote: Last month we discussed drivers that uses kmalloc(GFP_DMA) for noncoherent mapping should be converted to use DMA API [1]. Simple grep with GFP_DMA shows that many of drivers are mistakenly using GFP_DMA flag. So our purpose was to make DMA API choose ri

[Test002] test-X2-RJPM

2022-01-26 Thread Robin Murphy
Test email 2 [PES Logo] Robin Murphy Press & Communications Officer Mobile: +32 491 86 97 48 robin.mur...@pes.eu<mailto:robin.mur...@pes.eu> Party of European Socialists 10-12 Rue Guimard B-1040 Brussels Belgium www.pes.eu<http://www.pes.eu/> twitter.com/pes_pse<https://

[Test001] test-X2-RJPM

2022-01-26 Thread Robin Murphy
Test email 2 [PES Logo] Robin Murphy Press & Communications Officer Mobile: +32 491 86 97 48 robin.mur...@pes.eu<mailto:robin.mur...@pes.eu> Party of European Socialists 10-12 Rue Guimard B-1040 Brussels Belgium www.pes.eu<http://www.pes.eu/> twitter.com/pes_pse<https://

[Test001] test001-RJPM

2022-01-26 Thread Robin Murphy
Test email [PES Logo] Robin Murphy Press & Communications Officer Mobile: +32 491 86 97 48 robin.mur...@pes.eu<mailto:robin.mur...@pes.eu> Party of European Socialists 10-12 Rue Guimard B-1040 Brussels Belgium www.pes.eu<http://www.pes.eu/> twitter.com/pes_pse<https://

Re: [PATCH] [RFC] fbcon: Add option to enable legacy hardware acceleration

2022-01-25 Thread Robin Murphy
On 2022-01-25 19:12, Helge Deller wrote: Add a config option CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION to enable bitblt and fillrect hardware acceleration in the framebuffer console. If disabled, such acceleration will not be used, even if it is supported by the graphics hardware driver. If

Re: [PATCH v7 0/9] ACPI/IORT: Support for IORT RMR node

2022-01-25 Thread Robin Murphy
On 2022-01-25 13:00, Shameerali Kolothum Thodi wrote: Hi Robin/Lorenzo, -Original Message- From: iommu [mailto:iommu-boun...@lists.linux-foundation.org] On Behalf Of Shameer Kolothum Sent: 05 August 2021 09:07 To: linux-arm-ker...@lists.infradead.org; linux-a...@vger.kernel.org; iommu@l

Re: [PATCH 0/7] iommu cleanup and refactoring

2022-01-25 Thread Robin Murphy
On 2022-01-24 17:44, Jason Gunthorpe wrote: On Mon, Jan 24, 2022 at 09:46:26AM +, Tian, Kevin wrote: From: Lu Baolu Sent: Monday, January 24, 2022 3:11 PM Hi, The guest pasid and aux-domain related code are dead code in current iommu subtree. As we have reached a consensus that all these

Re: [PATCH 7/7] iommu: Add iommu_domain::domain_ops

2022-01-25 Thread Robin Murphy
On 2022-01-25 06:27, Lu Baolu wrote: On 1/25/22 8:57 AM, Robin Murphy wrote: On 2022-01-24 07:11, Lu Baolu wrote: Add a domain specific callback set, domain_ops, for vendor iommu driver to provide domain specific operations. Move domain-specific callbacks from iommu_ops to the domain_ops and

Re: [PATCH 7/7] iommu: Add iommu_domain::domain_ops

2022-01-24 Thread Robin Murphy
On 2022-01-24 07:11, Lu Baolu wrote: Add a domain specific callback set, domain_ops, for vendor iommu driver to provide domain specific operations. Move domain-specific callbacks from iommu_ops to the domain_ops and hook them when a domain is allocated. I think it would make a lot of sense for

Re: [PATCH 6/7] iommu: Use right way to retrieve iommu_ops

2022-01-24 Thread Robin Murphy
On 2022-01-24 07:11, Lu Baolu wrote: The common iommu_ops is hooked to both device and domain. When a helper has both device and domain pointer, the way to get the iommu_ops looks messy in iommu core. This sorts out the way to get iommu_ops. The device related helpers go through device pointer, w

[PATCH 3/3] swiotlb: Simplify array allocation

2022-01-24 Thread Robin Murphy
Prefer kcalloc() to kzalloc(array_size()) for allocating an array. Signed-off-by: Robin Murphy --- kernel/dma/swiotlb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index f56d6504903c..44c49c3616fe 100644 --- a/kernel/dma

[PATCH 1/3] swiotlb: Simplify debugfs setup

2022-01-24 Thread Robin Murphy
io_tlb_default_mem now makes debugfs_dir redundant. Signed-off-by: Robin Murphy --- kernel/dma/swiotlb.c | 40 ++-- 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index f1e7ea160b43..bdce89e053bd 100644

[PATCH 2/3] swiotlb: Tidy up includes

2022-01-24 Thread Robin Murphy
larly, linux/io.h subsumes asm/io.h; and by now it's a mystery why asm/dma.h was ever here at all. Signed-off-by: Robin Murphy --- kernel/dma/swiotlb.c | 31 +-- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiot

[PATCH 0/3] Some minor SWIOTLB cleanups

2022-01-24 Thread Robin Murphy
Hi all, Here's a little collection of cleanup patches for some annoyances that have built up while looking at SWIOTLB code recently. Cheers, Robin. Robin Murphy (3): swiotlb: Simplify debugfs setup swiotlb: Tidy up includes swiotlb: Simplify array allocation kernel/dma/swiotlb.c

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

2022-01-21 Thread Robin Murphy
On 2022-01-21 07:16, Vijayanand Jitta wrote: On 1/18/2022 9:27 PM, Vijayanand Jitta wrote: On 1/18/2022 7:19 PM, Robin Murphy wrote: On 2022-01-12 13:13, Vijayanand Jitta wrote: Kasan has reported the following use after free on dev->iommu. when a device probe fails and it is in proc

Re: Phyr Starter

2022-01-20 Thread Robin Murphy
On 2022-01-20 15:27, Keith Busch wrote: On Thu, Jan 20, 2022 at 02:56:02PM +0100, Christoph Hellwig wrote: - on the input side to dma mapping the bio_vecs (or phyrs) are chained as bios or whatever the containing structure is. These already exist and have infrastructure at least in th

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

2022-01-18 Thread Robin Murphy
On 2022-01-12 13:13, Vijayanand Jitta wrote: Kasan has reported the following use after free on dev->iommu. when a device probe fails and it is in process of freeing dev->iommu in dev_iommu_free function, a deferred_probe_work_func runs in parallel and tries to access dev->iommu->fwspec in of_iom

Re: [PATCH v3 1/2] dt-bindings: arm: xen: document Xen iommu device

2022-01-17 Thread Robin Murphy
On 2022-01-17 12:32, Sergiy Kibrik wrote: In IOMMU-capable system hypervisor usually takes over IOMMU control. Generally guest domains don't need to care about IOMMU management and take any extra actions. Yet in some cases a knowledge about which device is protected may be useful for privileged d

Re: [PATCH 1/2] drm/panfrost: mmu: improved memory attributes

2021-12-24 Thread Robin Murphy
On 2021-12-23 11:06, asheplya...@basealt.ru wrote: From: Alexey Sheplyakov T62x/T60x GPUs are known to not work with panfrost as of now. One of the reasons is wrong/incomplete memory attributes which the panfrost driver sets in the page tables: - MEMATTR_IMP_DEF should be 0x48ULL, not 0x88ULL.

Re: [PATCH v3 5/5] iommu/nvidia-grace-cmdqv: Limit CMDs for guest owned VINTF

2021-12-24 Thread Robin Murphy
On 2021-12-24 08:02, Nicolin Chen wrote: On Thu, Dec 23, 2021 at 11:14:17AM +, Robin Murphy wrote: External email: Use caution opening links or attachments On 2021-12-22 22:52, Nicolin Chen wrote: On Wed, Dec 22, 2021 at 12:32:29PM +, Robin Murphy wrote: External email: Use caution

Re: [PATCH 2/2] iommu/arm-smmu: Propagate errors from platform_get_irq()

2021-12-23 Thread Robin Murphy
rrupt controller that could cause deferral, but on the other hand I don't think there's any good reason *not* to propagate the original error anyway, so sure, why not. Reviewed-by: Robin Murphy Fixes: 9ec36cafe43b ("of/irq: do irq resolution in platform_get_irq") Sig

Re: [PATCH 1/2] iommu/arm-smmu: Use platform_irq_count() to get the interrupt count

2021-12-23 Thread Robin Murphy
On 2021-12-23 13:00, Lad Prabhakar wrote: platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup an

Re: [PATCH v3 5/5] iommu/nvidia-grace-cmdqv: Limit CMDs for guest owned VINTF

2021-12-23 Thread Robin Murphy
On 2021-12-22 22:52, Nicolin Chen wrote: On Wed, Dec 22, 2021 at 12:32:29PM +, Robin Murphy wrote: External email: Use caution opening links or attachments On 2021-11-19 07:19, Nicolin Chen via iommu wrote: When VCMDQs are assigned to a VINTF that is owned by a guest, not hypervisor

Re: [PATCH v4 07/13] iommu: Add iommu_at[de]tach_device_shared() for multi-device groups

2021-12-22 Thread Robin Murphy
On 21/12/2021 6:46 pm, Jason Gunthorpe wrote: On Tue, Dec 21, 2021 at 04:50:56PM +, Robin Murphy wrote: this proposal is the worst of both worlds, in that drivers still have to be just as aware of groups in order to know whether to call the _shared interface or not, except it'

Re: [PATCH v3 5/5] iommu/nvidia-grace-cmdqv: Limit CMDs for guest owned VINTF

2021-12-22 Thread Robin Murphy
On 2021-11-19 07:19, Nicolin Chen via iommu wrote: When VCMDQs are assigned to a VINTF that is owned by a guest, not hypervisor (HYP_OWN bit is unset), only TLB invalidation commands are supported. This requires get_cmd() function to scan the input cmd before selecting cmdq between smmu->cmdq and

Re: [PATCH v3 4/5] iommu/arm-smmu-v3: Add host support for NVIDIA Grace CMDQ-V

2021-12-22 Thread Robin Murphy
On 2021-12-21 22:00, Nicolin Chen wrote: [...] The challenge to make ECMDQ useful to Linux is how to make sure that all the commands expected to be within scope of a future CMND_SYNC plus that sync itself all get issued on the same queue, so I'd be mildly surprised if you didn't have the same pro

Re: [PATCH] Swiotlb: remove a duplicate include

2021-12-22 Thread Robin Murphy
On 2021-12-22 02:54, Guo Zhengkui wrote: Remove a duplicate "#include ". The deleted one in line 43 is under "#ifdef CONFIG_DMA_RESTRICTED_POOL". However, there is already one in line 53 with no conditional compile. Signed-off-by: Guo Zhengkui --- kernel/dma/swiotlb.c | 1 - 1 file changed,

Re: [PATCH v3 4/5] iommu/arm-smmu-v3: Add host support for NVIDIA Grace CMDQ-V

2021-12-21 Thread Robin Murphy
On 2021-12-20 19:27, Nicolin Chen wrote: Hi Robin, Thank you for the reply! On Mon, Dec 20, 2021 at 06:42:26PM +, Robin Murphy wrote: On 2021-11-19 07:19, Nicolin Chen wrote: From: Nate Watterson NVIDIA's Grace Soc has a CMDQ-Virtualization (CMDQV) hardware, which extends the sta

Re: [PATCH v2 00/33] Separate struct slab from struct page

2021-12-21 Thread Robin Murphy
On 2021-12-20 23:58, Vlastimil Babka wrote: On 12/16/21 16:00, Hyeonggon Yoo wrote: On Tue, Dec 14, 2021 at 01:57:22PM +0100, Vlastimil Babka wrote: On 12/1/21 19:14, Vlastimil Babka wrote: Folks from non-slab subsystems are Cc'd only to patches affecting them, and this cover letter. Series a

Re: [PATCH v4 07/13] iommu: Add iommu_at[de]tach_device_shared() for multi-device groups

2021-12-21 Thread Robin Murphy
On 2021-12-17 06:37, Lu Baolu wrote: The iommu_attach/detach_device() interfaces were exposed for the device drivers to attach/detach their own domains. The commit <426a273834eae> ("iommu: Limit iommu_attach/detach_device to device with their own group") restricted them to singleton groups to avo

Re: [PATCH v3 4/5] iommu/arm-smmu-v3: Add host support for NVIDIA Grace CMDQ-V

2021-12-20 Thread Robin Murphy
On 2021-11-19 07:19, Nicolin Chen wrote: From: Nate Watterson NVIDIA's Grace Soc has a CMDQ-Virtualization (CMDQV) hardware, which extends the standard ARM SMMU v3 IP to support multiple VCMDQs with virtualization capabilities. In-kernel of host OS, they're used to reduce contention on a single

Re: [PATCH 4/5] iommu: Separate IOVA rcache memories from iova_domain structure

2021-12-20 Thread Robin Murphy
Hi John, On 2021-12-20 08:49, John Garry wrote: On 24/09/2021 11:01, John Garry wrote: Only dma-iommu.c and vdpa actually use the "fast" mode of IOVA alloc and free. As such, it's wasteful that all other IOVA domains hold the rcache memories. In addition, the current IOVA domain init implement

Re: [PATCH 4/5] iommu: Separate IOVA rcache memories from iova_domain structure

2021-12-20 Thread Robin Murphy
Hi John, On 2021-12-20 08:49, John Garry wrote: On 24/09/2021 11:01, John Garry wrote: Only dma-iommu.c and vdpa actually use the "fast" mode of IOVA alloc and free. As such, it's wasteful that all other IOVA domains hold the rcache memories. In addition, the current IOVA domain init implement

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

2021-12-20 Thread Robin Murphy
On 2021-12-20 12:34, Joerg Roedel wrote: 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. Acked-by: Robin Murphy Signed-off-by: Joerg Roedel --- include

Re: [PATCH 1/1] drm/nouveau/device: Get right pgsize_bitmap of iommu_domain

2021-12-20 Thread Robin Murphy
e than a year after that commit ;) As an improvement rather than a fix, though, Reviewed-by: Robin Murphy Signed-off-by: Lu Baolu --- drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/

Re: [Nouveau] [PATCH 1/1] drm/nouveau/device: Get right pgsize_bitmap of iommu_domain

2021-12-20 Thread Robin Murphy
e than a year after that commit ;) As an improvement rather than a fix, though, Reviewed-by: Robin Murphy Signed-off-by: Lu Baolu --- drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/

Re: [PATCH 1/1] drm/nouveau/device: Get right pgsize_bitmap of iommu_domain

2021-12-20 Thread Robin Murphy
e than a year after that commit ;) As an improvement rather than a fix, though, Reviewed-by: Robin Murphy Signed-off-by: Lu Baolu --- drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/

[PATCH v3 9/9] iommu: Move flush queue data into iommu_dma_cookie

2021-12-17 Thread Robin Murphy
Complete the move into iommu-dma by refactoring the flush queues themselves to belong to the DMA cookie rather than the IOVA domain. The refactoring may as well extend to some minor cosmetic aspects too, to help us stay one step ahead of the style police. Signed-off-by: Robin Murphy

[PATCH v3 8/9] iommu/iova: Move flush queue code to iommu-dma

2021-12-17 Thread Robin Murphy
code movement with no functional change; refactoring to clean up the headers and definitions will follow. Reviewed-by: John Garry Signed-off-by: Robin Murphy --- drivers/iommu/dma-iommu.c | 177 +- drivers/iommu/iova.c | 175

[PATCH v3 7/9] iommu/iova: Consolidate flush queue code

2021-12-17 Thread Robin Murphy
Squash and simplify some of the freeing code, and move the init and free routines down into the rest of the flush queue code to obviate the forward declarations. Reviewed-by: John Garry Signed-off-by: Robin Murphy --- drivers/iommu/iova.c | 131 +++ 1

[PATCH v3 6/9] iommu/vt-d: Use put_pages_list

2021-12-17 Thread Robin Murphy
de over to using free_pages_list(). Signed-off-by: Matthew Wilcox (Oracle) [rm: split from original patch, cosmetic tweaks, fix fq entries] Signed-off-by: Robin Murphy --- drivers/iommu/dma-iommu.c | 2 +- drivers/iommu/intel/iommu.c | 89 + drivers/iommu/io

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