Skip to contentSkip to conversation

iommu: make IPMMU_VMSA dependencies more strict

PATCH In review Randy Dunlap 4 participants 4 messages Mar 30, 2023 – May 22, 2023 IOMMU

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 iommu: make IPMMU_VMSA dependencies more strict

On riscv64, linux-next-20233030 (and for several days earlier), there is a kconfig warning:

WARNING: unmet direct dependencies detected for IOMMU_IO_PGTABLE_LPAE
Depends on [n]: IOMMU_SUPPORT [=y] && (ARM || ARM64 || COMPILE_TEST [=n]) && !GENERIC_ATOMIC64 [=n] Selected by [y]:
- IPMMU_VMSA [=y] && IOMMU_SUPPORT [=y] && (ARCH_RENESAS [=y] || COMPILE_TEST [=n]) && !GENERIC_ATOMIC64 [=n]

and build errors:

riscv64-linux-ld: drivers/iommu/io-pgtable-arm.o: in function `.L140':
io-pgtable-arm.c:(.init.text+0x1e8): undefined reference to `alloc_io_pgtable_ops'
riscv64-linux-ld: drivers/iommu/io-pgtable-arm.o: in function `.L168':
io-pgtable-arm.c:(.init.text+0xab0): undefined reference to `free_io_pgtable_ops'
riscv64-linux-ld: drivers/iommu/ipmmu-vmsa.o: in function `.L140':
ipmmu-vmsa.c:(.text+0xbc4): undefined reference to `free_io_pgtable_ops'
riscv64-linux-ld: drivers/iommu/ipmmu-vmsa.o: in function `.L0 ':
ipmmu-vmsa.c:(.text+0x145e): undefined reference to `alloc_io_pgtable_ops'

Add ARM || ARM64 || COMPILE_TEST dependencies to IPMMU_VMSA to prevent these issues, i.e., so that ARCH_RENESAS on RISC-V is not allowed.

This makes the ARCH dependencies become:

	depends on (ARCH_RENESAS && (ARM || ARM64)) || COMPILE_TEST

but that can be a bit hard to read.

Fixes 8292493c22c8 ("riscv: Kconfig.socs: Add ARCH_RENESAS kconfig option")
Cc Joerg Roedel <[email protected]>
Cc Will Deacon <[email protected]>
Cc Robin Murphy <[email protected]>
Cc Conor Dooley <[email protected]>
Cc Lad Prabhakar <[email protected]>
---
 drivers/iommu/Kconfig |    1 +
 1 file changed, 1 insertion(+)
drivers/iommu/Kconfig +1 -0
diff -- a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
@@ -287,6 +287,7 @@ config EXYNOS_IOMMU_DEBUG
 config IPMMU_VMSA
 	bool "Renesas VMSA-compatible IPMMU"
 	depends on ARCH_RENESAS || COMPILE_TEST
+	depends on ARM || ARM64 || COMPILE_TEST
 	depends on !GENERIC_ATOMIC64	# for IOMMU_IO_PGTABLE_LPAE
 	select IOMMU_API
 	select IOMMU_IO_PGTABLE_LPAE
#1 lore raw
Quoted 26 lines · Randy Dunlap

On riscv64, linux-next-20233030 (and for several days earlier), there is a kconfig warning:

WARNING: unmet direct dependencies detected for IOMMU_IO_PGTABLE_LPAE
Depends on [n]: IOMMU_SUPPORT [=y] && (ARM || ARM64 || COMPILE_TEST [=n]) && !GENERIC_ATOMIC64 [=n] Selected by [y]:
- IPMMU_VMSA [=y] && IOMMU_SUPPORT [=y] && (ARCH_RENESAS [=y] || COMPILE_TEST [=n]) && !GENERIC_ATOMIC64 [=n]

and build errors:

riscv64-linux-ld: drivers/iommu/io-pgtable-arm.o: in function `.L140':
io-pgtable-arm.c:(.init.text+0x1e8): undefined reference to `alloc_io_pgtable_ops'
riscv64-linux-ld: drivers/iommu/io-pgtable-arm.o: in function `.L168':
io-pgtable-arm.c:(.init.text+0xab0): undefined reference to `free_io_pgtable_ops'
riscv64-linux-ld: drivers/iommu/ipmmu-vmsa.o: in function `.L140':
ipmmu-vmsa.c:(.text+0xbc4): undefined reference to `free_io_pgtable_ops'
riscv64-linux-ld: drivers/iommu/ipmmu-vmsa.o: in function `.L0 ':
ipmmu-vmsa.c:(.text+0x145e): undefined reference to `alloc_io_pgtable_ops'

Add ARM || ARM64 || COMPILE_TEST dependencies to IPMMU_VMSA to prevent these issues, i.e., so that ARCH_RENESAS on RISC-V is not allowed.

This makes the ARCH dependencies become:

	depends on (ARCH_RENESAS && (ARM || ARM64)) || COMPILE_TEST

but that can be a bit hard to read.

Quoted 9 lines
Fixes 8292493c22c8 ("riscv: Kconfig.socs: Add ARCH_RENESAS kconfig option")
Cc Joerg Roedel <[email protected]>
Cc Will Deacon <[email protected]>
Cc Robin Murphy <[email protected]>
Cc Conor Dooley <[email protected]>
Cc Lad Prabhakar <[email protected]>

This is still presenting as a problem for randconfig builds:
https://lore.kernel.org/all/[email protected]/

Could it get picked up please?

Thanks,
Conor.

Quoted 15 lines
---
 drivers/iommu/Kconfig |    1 +
 1 file changed, 1 insertion(+)

diff -- a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig

drivers/iommu/Kconfig +1 -0
@@ -287,6 +287,7 @@ config EXYNOS_IOMMU_DEBUG
 config IPMMU_VMSA
 	bool "Renesas VMSA-compatible IPMMU"
 	depends on ARCH_RENESAS || COMPILE_TEST
+	depends on ARM || ARM64 || COMPILE_TEST
 	depends on !GENERIC_ATOMIC64	# for IOMMU_IO_PGTABLE_LPAE
 	select IOMMU_API
 	select IOMMU_IO_PGTABLE_LPAE
reviewer Reviewed-by on v2 1/1
#2 lore raw
In reply to Randy Dunlap
Quoted 19 lines · Randy Dunlap

On riscv64, linux-next-20233030 (and for several days earlier), there is a kconfig warning:

WARNING: unmet direct dependencies detected for IOMMU_IO_PGTABLE_LPAE
Depends on [n]: IOMMU_SUPPORT [=y] && (ARM || ARM64 || COMPILE_TEST [=n]) && !GENERIC_ATOMIC64 [=n] Selected by [y]:
- IPMMU_VMSA [=y] && IOMMU_SUPPORT [=y] && (ARCH_RENESAS [=y] || COMPILE_TEST [=n]) && !GENERIC_ATOMIC64 [=n]

and build errors:

riscv64-linux-ld: drivers/iommu/io-pgtable-arm.o: in function `.L140':
io-pgtable-arm.c:(.init.text+0x1e8): undefined reference to `alloc_io_pgtable_ops'
riscv64-linux-ld: drivers/iommu/io-pgtable-arm.o: in function `.L168':
io-pgtable-arm.c:(.init.text+0xab0): undefined reference to `free_io_pgtable_ops'
riscv64-linux-ld: drivers/iommu/ipmmu-vmsa.o: in function `.L140':
ipmmu-vmsa.c:(.text+0xbc4): undefined reference to `free_io_pgtable_ops'
riscv64-linux-ld: drivers/iommu/ipmmu-vmsa.o: in function `.L0 ':
ipmmu-vmsa.c:(.text+0x145e): undefined reference to `alloc_io_pgtable_ops'

Quoted 6 lines

Add ARM || ARM64 || COMPILE_TEST dependencies to IPMMU_VMSA to prevent these issues, i.e., so that ARCH_RENESAS on RISC-V is not allowed.

This makes the ARCH dependencies become:

	depends on (ARCH_RENESAS && (ARM || ARM64)) || COMPILE_TEST

but that can be a bit hard to read.

If it helps,

Quoted 24 lines
Fixes 8292493c22c8 ("riscv: Kconfig.socs: Add ARCH_RENESAS kconfig option")
Cc Joerg Roedel <[email protected]>
Cc Will Deacon <[email protected]>
Cc Robin Murphy <[email protected]>
Cc Conor Dooley <[email protected]>
Cc Lad Prabhakar <[email protected]>
---
  drivers/iommu/Kconfig |    1 +
  1 file changed, 1 insertion(+)

diff -- a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig

drivers/iommu/Kconfig +1 -0
@@ -287,6 +287,7 @@ config EXYNOS_IOMMU_DEBUG
  config IPMMU_VMSA
  	bool "Renesas VMSA-compatible IPMMU"
  	depends on ARCH_RENESAS || COMPILE_TEST
+	depends on ARM || ARM64 || COMPILE_TEST
  	depends on !GENERIC_ATOMIC64	# for IOMMU_IO_PGTABLE_LPAE
  	select IOMMU_API
  	select IOMMU_IO_PGTABLE_LPAE