Linux IOMMU Development
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Conor Dooley <conor.dooley@microchip.com>,
	linux-kernel@vger.kernel.org, Joerg Roedel <joro@8bytes.org>,
	Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	iommu@lists.linux.dev, Conor Dooley <conor@kernel.org>,
	linux-riscv@lists.infradead.org, geert+renesas@glider.be
Subject: Re: [PATCH] iommu: PGTABLE_LPAE is also for RISCV
Date: Thu, 30 Mar 2023 09:33:59 -0700	[thread overview]
Message-ID: <4dbba30e-9c7a-ec73-8a5b-deda182e7f08@infradead.org> (raw)
In-Reply-To: <CAMuHMdX_=T9EB=rE_p9XO2-MtaV3jNkX76_PxYd9wi17NhaYHQ@mail.gmail.com>

Hi--

On 3/30/23 09:11, Geert Uytterhoeven wrote:
> Hi Randy,
> 
> On Thu, Mar 30, 2023 at 5:48 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>> On 3/30/23 00:31, Geert Uytterhoeven wrote:
>>> On Thu, Mar 30, 2023 at 8:25 AM Conor Dooley <conor.dooley@microchip.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@infradead.org>
>>>>> Cc: Joerg Roedel <joro@8bytes.org>
>>>>> Cc: Will Deacon <will@kernel.org>
>>>>> Cc: Robin Murphy <robin.murphy@arm.com>
>>>>> Cc: iommu@lists.linux.dev
>>>>> Cc: Conor Dooley <conor@kernel.org>
>>>>> Cc: linux-riscv@lists.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
> 

OK, that fixes the kconfig warning and the build errors.
I can read the first method easier that the second one, but I'll
go with your suggestion. Hopefully no one will come along and
"fix it up" but instead muck it up.

Thanks.
-- 
~Randy

  reply	other threads:[~2023-03-30 16:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30  6:01 [PATCH] iommu: PGTABLE_LPAE is also for RISCV Randy Dunlap
2023-03-30  6:25 ` Conor Dooley
2023-03-30  7:31   ` Geert Uytterhoeven
2023-03-30 10:43     ` Robin Murphy
2023-03-30 15:48     ` Randy Dunlap
2023-03-30 16:11       ` Geert Uytterhoeven
2023-03-30 16:33         ` Randy Dunlap [this message]
2023-03-30 16:34 ` Robin Murphy
2023-03-30 16:49   ` Randy Dunlap
2023-05-16  7:02     ` Alexandre Ghiti
2023-05-16  7:12       ` Conor Dooley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4dbba30e-9c7a-ec73-8a5b-deda182e7f08@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=conor.dooley@microchip.com \
    --cc=conor@kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=robin.murphy@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox