Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2389839rwl; Thu, 30 Mar 2023 09:36:16 -0700 (PDT) X-Google-Smtp-Source: AKy350b9fk2Gu5GGxIpATCYxJXrrmbZLMI3DE1wOepigYIcvC25na1CXMqFCh3vhRTnJTLa3h3ya X-Received: by 2002:a17:906:207:b0:933:23c4:820b with SMTP id 7-20020a170906020700b0093323c4820bmr2508947ejd.4.1680194176029; Thu, 30 Mar 2023 09:36:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680194176; cv=none; d=google.com; s=arc-20160816; b=nuxCh98almw6in9e2eScbvMXxyuJcL94VO9yowpG+3dVQKsaf6B8EM67ZU8cUhMzAY cURT16rZv3+8s5nWjVeknFJp4fe3AhfjDGRqLEg8APtvNKXggGVmQT5SmOv4KQGpbG/B Y2NnMTEx4ZGql6MHcIhFZwuOiRco3BWeWPrVA9+pPdy3GtljOKGNaibajMe3DPOuvlgN wKkAnuIgUtOqYjs3IGs9YQOojf9pZcknEHnU6WXt3uCsI7YloUWwpSZMposODUIkCIub xyYGn7daXlX1msQbmU+2hXcgB6wT/Hx5zunqVJYsOPxR7UHMKnF11+aQ+z+UVdWUGTN7 2hnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=m8D/JQoBMm2jqOtesJ3nZ3JZ78jqPtB8Jc7muxKTPP8=; b=wQvGRI3Lg0GSyzl30tjFePIacqCfVvOUBGDwAX54oXtRUh3POcUDObJxb2x6+Knb9b 2XZyDlI2IYog8ppu+4Cm+vIGUogrntW6DdMpWVciRhhq7/daIi9aoZ9KfCCz3cnEUdFk blwcpVKtrWTBoAk5xFaSNJwqGpm0LgRFNH2hPk/bqq+Kooy6x78xNX4+HpdaF3VyauI6 UfpDnpizSQG6tqLzdZPhQmr8ESNjodtsylcT02HfEv+agaL3iEdjsIsWlvDJBnV/4ygC jC6Rh36NmCthRiz/46/TaDOcm7FFCdaUdX+UYTyV7oaBbjh+U5WdJbkJSRMK8UYBmNWM j/gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=W9ZqHt6m; 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 bt22-20020a170906b15600b008c215db35a7si63013ejb.37.2023.03.30.09.35.50; Thu, 30 Mar 2023 09:36:16 -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=W9ZqHt6m; 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 S231656AbjC3QeL (ORCPT + 99 others); Thu, 30 Mar 2023 12:34:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231671AbjC3QeG (ORCPT ); Thu, 30 Mar 2023 12:34:06 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 073E6CC3E for ; Thu, 30 Mar 2023 09:34:02 -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: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Sender:Reply-To:Content-ID:Content-Description; bh=m8D/JQoBMm2jqOtesJ3nZ3JZ78jqPtB8Jc7muxKTPP8=; b=W9ZqHt6mOwQsZFEUIYww0z/wOr kaFA8c9eq2vSOaJ4g2HG18f81mRkDKej1QczX/q2YljhvEo5VcwmUpNw8/0Ne+5HkSK0umkpaEcMv 7FrIGbv7mgCSXWLpg00r5u58JN6DQ6dqb8lMzM9kfpdhZY/OIGydOXplWCVYJe0Dbz1XXJABUq8lr TQYxtmWuOCSkQoVFIjuykgKFbgi+ox/NxSEutQc7uQ33H0KgWDonQ42k0ASBeXzHv2sx1+UavZ1S0 b9kcarbrW6LPACobFCeMfRjo7eRw7pCZHNGjflkC8lsK7ctZ4E+KP6yugp9y/CctZU9H3D/cq+0Tv QZyqjy1w==; Received: from [2601:1c2:980:9ec0::2764] by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1phvDs-004UmK-18; Thu, 30 Mar 2023 16:34:00 +0000 Message-ID: <4dbba30e-9c7a-ec73-8a5b-deda182e7f08@infradead.org> Date: Thu, 30 Mar 2023 09:33:59 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH] iommu: PGTABLE_LPAE is also for RISCV Content-Language: en-US To: Geert Uytterhoeven 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 References: <20230330060105.29460-1-rdunlap@infradead.org> From: Randy Dunlap In-Reply-To: Content-Type: text/plain; charset=UTF-8 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,NICE_REPLY_A,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: X-Mailing-List: linux-kernel@vger.kernel.org Hi-- On 3/30/23 09:11, Geert Uytterhoeven wrote: > 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 > 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