Message ID | 20230330060105.29460-1-rdunlap@infradead.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp901136vqo; Wed, 29 Mar 2023 23:03:26 -0700 (PDT) X-Google-Smtp-Source: AKy350aIcL/NGy72p+q+tqGX2YPumXISctv6KXvzJq3d1X/vBdeji7foepMgBILjHfMmky0rnm44 X-Received: by 2002:a17:903:70f:b0:19e:bc8e:6421 with SMTP id kk15-20020a170903070f00b0019ebc8e6421mr18135703plb.47.1680156206498; Wed, 29 Mar 2023 23:03:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680156206; cv=none; d=google.com; s=arc-20160816; b=aLflv4eR63che6EePHTCl8YkVM5xsDmS9qEnqLw2VGiBwIFwhGai0vPNUrvm0dzTm0 HhmBPRYDcl4aE4s4th76ZB7NsIouEvvOG5V0qg9UnNhOghI78s1ufKH+8W80eXDGBrcY knVSEZ6ZoLYD7hwLiO5p4I5HNcBoBtbOGoguCeVfjSRV2kBsIP5gmROSnOkxZjMFEBHz FagWRFnKlvQ6na5NPX70pRAGQYhAbqvf4WZV+Sfc+WVEgsDUX53uV7JEL56RkCf/UcKE Wbume4S+Gqw93ahVlhc63lydMtBKJEGt6+MgUgCMSPhnxZ3205AKBgVm3aFC2paMiB1I BjKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=7zxKJM+hffyzY8/mnbPlZjh2fBXL9zN4AP03zResViY=; b=Pe1cB0aBnU2UzqoG8/JpAkPr1Sfhu/m369QOJATBrdOjoTLbrrd7yy3h6LXGpqHpTP YATW/0GbgB6YqSKl1Miz54m9k7A0lzboNCdUoL7ipBHt9E6zGP+7v7MwgS8PdMiYnIBl +1zpQA4WzsUMjVRL2mlYVob8tkFKSESDMFml2/CNQ7EQ8n33PDNvgYg2xBxBS2xGCmDc w995h7U8Yo1my5gK4g94SwCNcLx6pw/uzunAakCP53/+ULImErNtVWm6qV/1zQhnjZRq /ilvg6M/kpG6Zup35Uy3GLZSnKN2YzW+ynGnNZJ0IcGlZrvndQ3T50+0+InxV7KK45JB H8wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=c11kkHW1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n189-20020a6327c6000000b004fbb6a09b99si34725211pgn.341.2023.03.29.23.03.11; Wed, 29 Mar 2023 23:03:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=c11kkHW1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229965AbjC3GBN (ORCPT <rfc822;rua109.linux@gmail.com> + 99 others); Thu, 30 Mar 2023 02:01:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbjC3GBL (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 30 Mar 2023 02:01:11 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EA3DE4 for <linux-kernel@vger.kernel.org>; Wed, 29 Mar 2023 23:01:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=7zxKJM+hffyzY8/mnbPlZjh2fBXL9zN4AP03zResViY=; b=c11kkHW1gkFJ1DDyT7B7Lq4ggE elct902Q3wmKH6ivTqzkxq1kIRLCVebdk+0lefqrqgPmmW3OzkXwLG40UAqboNlENMi1KCODtF3P0 Shr/S+4CazLK+B/7ftHazEpioiTtuZ4wZzTuAS3H1LX5bi5IXJKZBGo1UV2XNDDizxS4aEGYRBtkM VYRm3K/RrsZnMJGQ27wEp3eC6jZ4VZpi6x9vDzdFvopfIFx9cmQ7l2+iXo68Y9fYYB1Yqe8ma2PlK 6A0qUx+04xqOAOWLKKlcuPDySZHbhkmKgIE//glpNni26064xWleSL1/4DMSse8O8JLXg+DFSHVh5 /UrfNPYQ==; Received: from [2601:1c2:980:9ec0::2764] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1phlLQ-002hoJ-0x; Thu, 30 Mar 2023 06:01:08 +0000 From: Randy Dunlap <rdunlap@infradead.org> To: linux-kernel@vger.kernel.org Cc: Randy Dunlap <rdunlap@infradead.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 Subject: [PATCH] iommu: PGTABLE_LPAE is also for RISCV Date: Wed, 29 Mar 2023 23:01:05 -0700 Message-Id: <20230330060105.29460-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761771474036672532?= X-GMAIL-MSGID: =?utf-8?q?1761771474036672532?= |
Series |
iommu: PGTABLE_LPAE is also for RISCV
|
|
Commit Message
Randy Dunlap
March 30, 2023, 6:01 a.m. UTC
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(-)
Comments
Hey Randy, 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? 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. Cheers, Conor. > select IOMMU_IO_PGTABLE > - depends on ARM || ARM64 || COMPILE_TEST > + depends on ARM || ARM64 || RISCV || COMPILE_TEST > depends on !GENERIC_ATOMIC64 # for cmpxchg64() > help > Enable support for the ARM long descriptor pagetable format. >
Hi Conor, 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 > > select IOMMU_IO_PGTABLE > > - depends on ARM || ARM64 || COMPILE_TEST > > + depends on ARM || ARM64 || RISCV || COMPILE_TEST > > depends on !GENERIC_ATOMIC64 # for cmpxchg64() > > help > > Enable support for the ARM long descriptor pagetable format. Gr{oetje,eeting}s, Geert
On 2023-03-30 08:31, Geert Uytterhoeven wrote: > Hi Conor, > > 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 Indeed, I thought we'd settled on something like that in the previous thread(s) on ARCH_RENESAS vs. RV32, but I guess nobody got round to actually respininng the patch (possibly since my refactoring here ended up papering over the immediate RV32 issue). Cheers, Robin. >>> select IOMMU_IO_PGTABLE >>> - depends on ARM || ARM64 || COMPILE_TEST >>> + depends on ARM || ARM64 || RISCV || COMPILE_TEST >>> depends on !GENERIC_ATOMIC64 # for cmpxchg64() >>> help >>> Enable support for the ARM long descriptor pagetable format. > > Gr{oetje,eeting}s, > > Geert >
Hi all, On 3/30/23 00:31, Geert Uytterhoeven wrote: > Hi Conor, > > 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 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] I am attaching the config file. >>> select IOMMU_IO_PGTABLE >>> - depends on ARM || ARM64 || COMPILE_TEST >>> + depends on ARM || ARM64 || RISCV || COMPILE_TEST >>> depends on !GENERIC_ATOMIC64 # for cmpxchg64() >>> help >>> Enable support for the ARM long descriptor pagetable format. > > Gr{oetje,eeting}s, > > Geert >
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 > > 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]
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.
On 2023-03-30 07:01, 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") BTW that doesn't look like the right fix target - this presumably dates back as far as when ARCH_RENESAS was added to RISCV, such that it was possible to start selecting IPMMU_VMSA without COMPILE_TEST? Thanks, Robin. > 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" > select IOMMU_IO_PGTABLE > - depends on ARM || ARM64 || COMPILE_TEST > + depends on ARM || ARM64 || RISCV || COMPILE_TEST > depends on !GENERIC_ATOMIC64 # for cmpxchg64() > help > Enable support for the ARM long descriptor pagetable format.
On 3/30/23 09:34, Robin Murphy wrote: > On 2023-03-30 07:01, 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") > > BTW that doesn't look like the right fix target - this presumably dates back as far as when ARCH_RENESAS was added to RISCV, such that it was possible to start selecting IPMMU_VMSA without COMPILE_TEST? OK, I can go with that. Thanks for your help.
Hi Randy, On 3/30/23 18:49, Randy Dunlap wrote: > > On 3/30/23 09:34, Robin Murphy wrote: >> On 2023-03-30 07:01, 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") >> BTW that doesn't look like the right fix target - this presumably dates back as far as when ARCH_RENESAS was added to RISCV, such that it was possible to start selecting IPMMU_VMSA without COMPILE_TEST? > OK, I can go with that. Thanks for your help. > Any updates on this fix? Thanks, Alex
On Tue, May 16, 2023 at 09:02:50AM +0200, Alexandre Ghiti wrote: > Hi Randy, > > > On 3/30/23 18:49, Randy Dunlap wrote: > > > > On 3/30/23 09:34, Robin Murphy wrote: > > > On 2023-03-30 07:01, 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") > > > BTW that doesn't look like the right fix target - this presumably dates back as far as when ARCH_RENESAS was added to RISCV, such that it was possible to start selecting IPMMU_VMSA without COMPILE_TEST? > > OK, I can go with that. Thanks for your help. > > > > Any updates on this fix? Superseeded by https://lore.kernel.org/linux-iommu/20230330165817.21920-1-rdunlap@infradead.org/ I guess that never went anywhere?
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" select IOMMU_IO_PGTABLE - depends on ARM || ARM64 || COMPILE_TEST + depends on ARM || ARM64 || RISCV || COMPILE_TEST depends on !GENERIC_ATOMIC64 # for cmpxchg64() help Enable support for the ARM long descriptor pagetable format.