[PATCH] RISC-V: Disable IPMMU_VMSA on rv32

Geert Uytterhoeven geert at linux-m68k.org
Thu Dec 15 01:04:34 PST 2022


Hi Prabhakar,

On Wed, Dec 14, 2022 at 10:40 PM Prabhakar Mahadev Lad
<prabhakar.mahadev-lad.rj at bp.renesas.com> wrote:
> > From: Robin Murphy <robin.murphy at arm.com>
> > On 2022-12-14 19:46, Conor Dooley wrote:
> > > On 14 December 2022 10:04:09 GMT-08:00, Palmer Dabbelt <palmer at rivosinc.com> wrote:
> > >> Without this I get a Kconfig warning and then subsequent build
> > >> failure when building allmodconfig on rv32.
> > >>
> > >> WARNING: unmet direct dependencies detected for IOMMU_IO_PGTABLE_LPAE
> > >>   Depends on [n]: IOMMU_SUPPORT [=y] && (ARM || ARM64 || COMPILE_TEST [=y] && !GENERIC_ATOMIC64
> > [=y])
> > >>   Selected by [y]:
> > >>   - IPMMU_VMSA [=y] && IOMMU_SUPPORT [=y] && (ARCH_RENESAS [=y] ||
> > >> COMPILE_TEST [=y]
> > >
> > > This here is your problem afaict
> > > I got a report from lkp about it yesterday, "blaming" Prabhakar for it:
> > > https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore
> > > .kernel.org%2Fall%2F202212142355.b7vf3Jh0-lkp%40intel.com%2F&data=
> > > 05%7C01%7Cprabhakar.mahadev-lad.rj%40bp.renesas.com%7Ca51ccd27ccda45e7
> > > 53c208dade16c553%7C53d82571da1947e49cb4625a166a4a2a%7C0%7C0%7C63806648
> > > 6632283001%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzI
> > > iLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=FshRCpnIoU0b
> > > c38MYnesotcgOV4JT%2FXVOidbDMpAWbc%3D&reserved=0
> > >
> > > I hate selects, just ignores the dependency :(
> > >
> > >   && !GENERIC_ATOMIC64 [=y])
> >
> > I think the existing assumption was that ARCH_RENESAS implied !GENERIC_ATOMIC64. If that is no longer
> > true then please feel free to adjust drivers/iommu/Kconfig to suit.
> >
> IPMMU is not available on Renesas RISCV SoCs, so maybe something like below?
>
> --- a/drivers/iommu/Kconfig
> +++ b/drivers/iommu/Kconfig
> @@ -283,7 +283,7 @@ config EXYNOS_IOMMU_DEBUG
>
>  config IPMMU_VMSA
>         bool "Renesas VMSA-compatible IPMMU"
> -       depends on ARCH_RENESAS || (COMPILE_TEST && !GENERIC_ATOMIC64)
> +       depends on (ARCH_RENESAS && !RISCV) || (COMPILE_TEST && !GENERIC_ATOMIC64)

Negative dependencies on a symbol like that tend to need future
extension.

What about

    depends on ARCH_RENESAS || COMPILE_TEST
    depends on !GENERIC_ATOMIC64

instead?

That does mean the question will show up on RV64, too.
Adding

    depends on ARM || ARM64 || COMPILE_TEST

(like we sort of had before commit 97215a7df4351fdd
("iommu/renesas: Expand COMPILE_TEST coverage")
would fix that.

>         select IOMMU_API
>         select IOMMU_IO_PGTABLE_LPAE
>         select ARM_DMA_USE_IOMMU

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



More information about the linux-riscv mailing list