Re: [PATCH v6 02/25] iommu: Add IOMMU_DOMAIN_PLATFORM

2023-08-13 Thread Baolu Lu
On 2023/8/12 19:28, Jason Gunthorpe wrote: On Sat, Aug 12, 2023 at 09:36:33AM +0800, Baolu Lu wrote: @@ -290,6 +295,7 @@ struct iommu_ops { unsigned long pgsize_bitmap; struct module *owner; struct iommu_domain *identity_domain; + struct iommu_domain *default_domain

Re: KASAN debug kernel fails to boot at early stage when CONFIG_SMP=y is set (kernel 6.5-rc5, PowerMac G4 3,6)

2023-08-13 Thread Erhard Furtner
On Fri, 11 Aug 2023 06:45:14 + Christophe Leroy wrote: > Le 11/08/2023 à 01:48, Erhard Furtner a écrit : > > I wanted to fire up my PowerMac G4 MDD (Dual CPU) with a KASAN debug build > > of kernel 6.5-rc5 for testing purposes. But the kernel fails to boot at a > > very early stage. I only

Re: [PATCH v6 03/25] powerpc/iommu: Setup a default domain and remove set_platform_dma_ops

2023-08-13 Thread Baolu Lu
On 2023/8/3 8:07, Jason Gunthorpe wrote: POWER is using the set_platform_dma_ops() callback to hook up its private dma_ops, but this is buired under some indirection and is weirdly happening for a BLOCKED domain as well. For better documentation create a PLATFORM domain to manage the dma_ops, si

Re: [PATCH v6 04/25] iommu: Add IOMMU_DOMAIN_PLATFORM for S390

2023-08-13 Thread Baolu Lu
On 2023/8/3 8:07, Jason Gunthorpe wrote: The PLATFORM domain will be set as the default domain and attached as normal during probe. The driver will ignore the initial attach from a NULL domain to the PLATFORM domain. After this, the PLATFORM domain's attach_dev will be called whenever we detach

Re: [PATCH v6 05/25] iommu/fsl_pamu: Implement a PLATFORM domain

2023-08-13 Thread Baolu Lu
On 2023/8/3 8:07, Jason Gunthorpe wrote: This driver is nonsensical. To not block migrating the core API away from NULL default_domains give it a hacky of a PLATFORM domain that keeps it working exactly as it always did. Leave some comments around to warn away any future people looking at this.

Re: [PATCH v6 07/25] iommu/mtk_iommu_v1: Implement an IDENTITY domain

2023-08-13 Thread Baolu Lu
On 2023/8/3 8:07, Jason Gunthorpe wrote: What mtk does during mtk_iommu_v1_set_platform_dma() is actually putting the iommu into identity mode. Make this available as a proper IDENTITY domain. The mtk_iommu_v1_def_domain_type() from commit 8bbe13f52cb7 ("iommu/mediatek-v1: Add def_domain_type")

Re: [PATCH v6 09/25] iommu: Allow an IDENTITY domain as the default_domain in ARM32

2023-08-13 Thread Baolu Lu
On 2023/8/3 8:07, Jason Gunthorpe wrote: Even though dma-iommu.c and CONFIG_ARM_DMA_USE_IOMMU do approximately the same stuff, the way they relate to the IOMMU core is quiet different. dma-iommu.c expects the core code to setup an UNMANAGED domain (of type IOMMU_DOMAIN_DMA) and then configures i

Re: [PATCH v6 10/25] iommu/exynos: Implement an IDENTITY domain

2023-08-13 Thread Baolu Lu
On 2023/8/3 8:07, Jason Gunthorpe wrote: What exynos calls exynos_iommu_detach_device is actually putting the iommu into identity mode. Move to the new core support for ARM_DMA_USE_IOMMU by defining ops->identity_domain. Tested-by: Marek Szyprowski Acked-by: Marek Szyprowski Signed-off-by: Jaso

Re: [PATCH v6 11/25] iommu/tegra-smmu: Implement an IDENTITY domain

2023-08-13 Thread Baolu Lu
On 2023/8/3 8:07, Jason Gunthorpe wrote: What tegra-smmu does during tegra_smmu_set_platform_dma() is actually putting the iommu into identity mode. Move to the new core support for ARM_DMA_USE_IOMMU by defining ops->identity_domain. Signed-off-by: Jason Gunthorpe --- drivers/iommu/tegra-smmu

Re: [PATCH v6 12/25] iommu/tegra-smmu: Support DMA domains in tegra

2023-08-13 Thread Baolu Lu
On 2023/8/3 8:07, Jason Gunthorpe wrote: All ARM64 iommu drivers should support IOMMU_DOMAIN_DMA to enable dma-iommu.c. tegra is blocking dma-iommu usage, and also default_domain's, because it wants an identity translation. This is needed for some device quirk. The correct way to do this is to s

Re: [PATCH v6 13/25] iommu/omap: Implement an IDENTITY domain

2023-08-13 Thread Baolu Lu
On 2023/8/3 8:08, Jason Gunthorpe wrote: What omap does during omap_iommu_set_platform_dma() is actually putting the iommu into identity mode. Move to the new core support for ARM_DMA_USE_IOMMU by defining ops->identity_domain. This driver does not support IOMMU_DOMAIN_DMA, however it cannot be

Re: [PATCH v6 14/25] iommu/msm: Implement an IDENTITY domain

2023-08-13 Thread Baolu Lu
On 2023/8/3 8:08, Jason Gunthorpe wrote: What msm does during msm_iommu_set_platform_dma() is actually putting the iommu into identity mode. Move to the new core support for ARM_DMA_USE_IOMMU by defining ops->identity_domain. This driver does not support IOMMU_DOMAIN_DMA, however it cannot be c

Re: [PATCH] powerpc/radix: Move some functions into #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE

2023-08-13 Thread Nicholas Piggin
On Wed Aug 9, 2023 at 6:01 PM AEST, Christophe Leroy wrote: > With skiboot_defconfig, Clang reports: > > CC arch/powerpc/mm/book3s64/radix_tlb.o > arch/powerpc/mm/book3s64/radix_tlb.c:419:20: error: unused function > '_tlbie_pid_lpid' [-Werror,-Wunused-function] > static inline void _tlbie_

Re: [PATCH v6 17/25] iommu/qcom_iommu: Add an IOMMU_IDENTITIY_DOMAIN

2023-08-13 Thread Baolu Lu
On 2023/8/3 8:08, Jason Gunthorpe wrote: This brings back the ops->detach_dev() code that commit 1b932ceddd19 ("iommu: Remove detach_dev callbacks") deleted and turns it into an IDENTITY domain. Signed-off-by: Jason Gunthorpe --- drivers/iommu/arm/arm-smmu/qcom_iommu.c | 39 ++

Re: [PATCH v6 18/25] iommu/ipmmu: Add an IOMMU_IDENTITIY_DOMAIN

2023-08-13 Thread Baolu Lu
On 2023/8/3 8:08, Jason Gunthorpe wrote: This brings back the ops->detach_dev() code that commit 1b932ceddd19 ("iommu: Remove detach_dev callbacks") deleted and turns it into an IDENTITY domain. Also reverts commit 584d334b1393 ("iommu/ipmmu-vmsa: Remove ipmmu_utlb_disable()") Signed-off-by: Ja

Re: [PATCH v6 19/25] iommu/mtk_iommu: Add an IOMMU_IDENTITIY_DOMAIN

2023-08-13 Thread Baolu Lu
On 2023/8/3 8:08, Jason Gunthorpe wrote: This brings back the ops->detach_dev() code that commit 1b932ceddd19 ("iommu: Remove detach_dev callbacks") deleted and turns it into an IDENTITY domain. Signed-off-by: Jason Gunthorpe --- drivers/iommu/mtk_iommu.c | 23 +++ 1 file

Re: [PATCH v6 20/25] iommu/sun50i: Add an IOMMU_IDENTITIY_DOMAIN

2023-08-13 Thread Baolu Lu
On 2023/8/3 8:08, Jason Gunthorpe wrote: Prior to commit 1b932ceddd19 ("iommu: Remove detach_dev callbacks") the sun50i_iommu_detach_device() function was being called by ops->detach_dev(). This is an IDENTITY domain so convert sun50i_iommu_detach_device() into sun50i_iommu_identity_attach() and

Re: [PATCH v6 24/25] iommu: Convert simple drivers with DOMAIN_DMA to domain_alloc_paging()

2023-08-13 Thread Baolu Lu
On 2023/8/3 8:08, Jason Gunthorpe wrote: These drivers are all trivially converted since the function is only called if the domain type is going to be IOMMU_DOMAIN_UNMANAGED/DMA. Tested-by: Heiko Stuebner Tested-by: Steven Price Tested-by: Marek Szyprowski Tested-by: Nicolin Chen Signed-off-