lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdX_=T9EB=rE_p9XO2-MtaV3jNkX76_PxYd9wi17NhaYHQ@mail.gmail.com>
Date:   Thu, 30 Mar 2023 18:11:47 +0200
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Randy Dunlap <rdunlap@...radead.org>
Cc:     Conor Dooley <conor.dooley@...rochip.com>,
        linux-kernel@...r.kernel.org, Joerg Roedel <joro@...tes.org>,
        Will Deacon <will@...nel.org>,
        Robin Murphy <robin.murphy@....com>, iommu@...ts.linux.dev,
        Conor Dooley <conor@...nel.org>,
        linux-riscv@...ts.infradead.org, geert+renesas@...der.be
Subject: Re: [PATCH] iommu: PGTABLE_LPAE is also for RISCV

Hi Randy,

On Thu, Mar 30, 2023 at 5:48 PM Randy Dunlap <rdunlap@...radead.org> wrote:
> On 3/30/23 00:31, Geert Uytterhoeven wrote:
> > On Thu, Mar 30, 2023 at 8:25 AM Conor Dooley <conor.dooley@...rochip.com> wrote:
> >> On Wed, Mar 29, 2023 at 11:01:05PM -0700, Randy Dunlap wrote:
> >>> 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 RISCV as an allowed ARCH dependency to fix these problems.
> >>>
> >>> Fixes: d286a58bc8f4 ("iommu: Tidy up io-pgtable dependencies")
> >>> Signed-off-by: Randy Dunlap <rdunlap@...radead.org>
> >>> Cc: Joerg Roedel <joro@...tes.org>
> >>> Cc: Will Deacon <will@...nel.org>
> >>> Cc: Robin Murphy <robin.murphy@....com>
> >>> Cc: iommu@...ts.linux.dev
> >>> Cc: Conor Dooley <conor@...nel.org>
> >>> Cc: linux-riscv@...ts.infradead.org
> >>> ---
> >>>  drivers/iommu/Kconfig |    2 +-
> >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> diff -- a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
> >>> --- a/drivers/iommu/Kconfig
> >>> +++ b/drivers/iommu/Kconfig
> >>> @@ -32,7 +32,7 @@ config IOMMU_IO_PGTABLE
> >>>  config IOMMU_IO_PGTABLE_LPAE
> >>>       bool "ARMv7/v8 Long Descriptor Format"
> >>
> >> I'm probably missing something here, but why would we want to enable
> >> "ARMv7/v8 Long Descriptor Format" on RISC-V?
> >
> > Indeed, we should not enable it, unless compile-testing.
> >
> >> Would it not be better to make the Renesas depend on, rather than
> >> select the option? It does seem highly arch specific, and I feel like
> >> Geert previously mentioned that the RZ/Five (their RISC-V offering)
> >> didn't use it.
> >
> > I think the IPMMU_VMSA dependency should gain
> >
> >         depends on ARM || ARM64 || COMPILE_TEST
>
> so like this?
> Or did you mean to drop the ARCH_RENESAS part also?
>
>
>  config IPMMU_VMSA
>         bool "Renesas VMSA-compatible IPMMU"
> -       depends on ARCH_RENESAS || COMPILE_TEST
> +       depends on ARCH_RENESAS || ARM || ARM64 || COMPILE_TEST

No, you want "depends on (ARCH_RENESAS && (ARM || ARM64)) || COMPILE_TEST",
which is a bit hard to read.

Hence I really meant adding that line, i.e.:

     config IPMMU_VMSA
           bool "Renesas VMSA-compatible IPMMU"
           depends on ARCH_RENESAS || COMPILE_TEST
    +      depends on ARM || ARM64 || COMPILE_TEST

>
> The failing config file has ARCH_RENESAS=y.  After the change above, I still get:
>
> 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] || ARM || ARM64 || COMPILE_TEST [=n]) && !GENERIC_ATOMIC64 [=n]
-- 
Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ