Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2378018rwl; Thu, 30 Mar 2023 09:27:23 -0700 (PDT) X-Google-Smtp-Source: AKy350amkJPdRPMX/ENAXmr7WcW1myIQE8Ae2HJIBnefsUjvNwFwof1OQclfAikAjnPga9i2odMS X-Received: by 2002:a17:906:28e:b0:947:404b:eb2 with SMTP id 14-20020a170906028e00b00947404b0eb2mr3244098ejf.0.1680193643404; Thu, 30 Mar 2023 09:27:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680193643; cv=none; d=google.com; s=arc-20160816; b=XrpP1NyM+EzbBuga9qKIfVfXcoBXW8cqIJqFsikrC1OWDwHqZt5tGOCAeM/om36YHm cKzHLTOkWB2i5RiFeHpHHgkkeuRZhjaoowsgbp+/80R33Ht1jLvoe1d23H4K3UF8OK/P z40sK7fDx122dz7Teuu8j9CeItNSbssJ5n8s8y2cMQj+vx+29nmf8T21bUawaJLJoJfr OnUeGD4EtD9oeW2FMuNfFxiGgT4B9D8xmjuk8rOc0rFHPBVk2fZ+lhyZuHFMD4KacThy KTSFg1+bDREm86dbr1waB7LQ0YFBC670VfI7VDWBbyGGc/NH5AY7LrQ6PynuewwDIfaE HZJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=T/eMvjVXOS8DWKFh5ue1cOL8tujO0NLjt3yx+IE+FSs=; b=ssDNbT6NPuBSu3CyE+g53inJHqwssMDHA1+ACeGRKz/ApLfg3vOZNz9L+clZcotxUY gC6+6oQLo1osJh/tSjLey7yOffrU8tcBqnl+rBHG55K29ToBLvrJZo5k2jK078NSRnJr m0FkfYUWknypCgxBuBZtmw/zRpument5CuoP6L9NUzDtE4G38AkSKWQyxBgzXezxPRFd 6ybE/jYwQjQZ7kXpkbXnxHFQzXRYVoYgC8o96xHSPLHm0Nfpn/+iWx4+CDHLQxkJOwCi bha7uiv1OczUBXtKY5yds+ccWoQ3JnBzn4G83tu2lUEC7VFlsTPceTtlvgldTYfUL3GO dz0g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ck13-20020a170906c44d00b0093e328cf51bsi14363ejb.519.2023.03.30.09.26.58; Thu, 30 Mar 2023 09:27:23 -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; 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 S231191AbjC3QNb convert rfc822-to-8bit (ORCPT + 99 others); Thu, 30 Mar 2023 12:13:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229655AbjC3QNa (ORCPT ); Thu, 30 Mar 2023 12:13:30 -0400 Received: from mail-yw1-x1136.google.com (mail-yw1-x1136.google.com [IPv6:2607:f8b0:4864:20::1136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0433E3A4 for ; Thu, 30 Mar 2023 09:13:04 -0700 (PDT) Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-545cb3c9898so288219307b3.7 for ; Thu, 30 Mar 2023 09:13:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680192720; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1ASMwRAXSxQ56uzRQV9rpj0YNrKR/hLF/lFweUlSAcY=; b=yFftUyuEFnhd5imrtSqwj6kRE+XB0WLfBmQnXan3GFIhF7NCgb1P4kuIzlCwC2/8oG Eqwbbhccu/vFB5eHehHIjisVP3ERIhDX7fj8OtO12HipiMT4Co63ehOvttGRThY7Jps9 rDns6TyZ3Vazlzg58RFa73wP30Abk2VCufJhfzecj7U2tKYiTb5/3i9owyqB3jRdGMPU a5O9Vmkaa9zFO2mSN2t536YkE9ibMiQCmtCEwmltz2fdLHtidRn7TtkE7B+jYjOGURb0 4bzWm32vmbrWVH7hdWKrfi34etmnLHquwTWnOoH3nCUJme0SeQnWFoPfNZfK15kw0z10 i9cg== X-Gm-Message-State: AAQBX9ebbXgp7BR/gS/iF6jUqAJJdTrM2OTv0hEGnS56oBIxCVvgoiIz toPq/TbWg2RVdBw3PpU8P8rub8eDrebnSLf/ X-Received: by 2002:a81:52d2:0:b0:544:179f:528 with SMTP id g201-20020a8152d2000000b00544179f0528mr23538412ywb.32.1680192720297; Thu, 30 Mar 2023 09:12:00 -0700 (PDT) Received: from mail-yw1-f181.google.com (mail-yw1-f181.google.com. [209.85.128.181]) by smtp.gmail.com with ESMTPSA id bp3-20020a05690c068300b00545ce97d474sm2737838ywb.39.2023.03.30.09.11.59 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Mar 2023 09:11:59 -0700 (PDT) Received: by mail-yw1-f181.google.com with SMTP id 00721157ae682-545cb3c9898so288218247b3.7 for ; Thu, 30 Mar 2023 09:11:59 -0700 (PDT) X-Received: by 2002:a81:b65f:0:b0:545:611c:8d19 with SMTP id h31-20020a81b65f000000b00545611c8d19mr12055261ywk.4.1680192719618; Thu, 30 Mar 2023 09:11:59 -0700 (PDT) MIME-Version: 1.0 References: <20230330060105.29460-1-rdunlap@infradead.org> In-Reply-To: From: Geert Uytterhoeven Date: Thu, 30 Mar 2023 18:11:47 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] iommu: PGTABLE_LPAE is also for RISCV To: Randy Dunlap Cc: Conor Dooley , linux-kernel@vger.kernel.org, Joerg Roedel , Will Deacon , Robin Murphy , iommu@lists.linux.dev, Conor Dooley , linux-riscv@lists.infradead.org, geert+renesas@glider.be Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=0.5 required=5.0 tests=FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=no 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: X-Mailing-List: linux-kernel@vger.kernel.org Hi Randy, On Thu, Mar 30, 2023 at 5:48 PM Randy Dunlap wrote: > On 3/30/23 00:31, Geert Uytterhoeven wrote: > > On Thu, Mar 30, 2023 at 8:25 AM Conor Dooley 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 > >>> Cc: Joerg Roedel > >>> Cc: Will Deacon > >>> Cc: Robin Murphy > >>> Cc: iommu@lists.linux.dev > >>> Cc: Conor Dooley > >>> 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] -- Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@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