From patchwork Thu Mar 30 16:58:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 77339 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp10225vqo; Thu, 30 Mar 2023 10:11:39 -0700 (PDT) X-Google-Smtp-Source: AKy350aXOMw0Uz51zf2Upy27JMU12+Fe7qDv394iqnBcNBz1bRjR+GgRwBC2ZS7wqirpYSkCArmB X-Received: by 2002:a05:6402:5a:b0:4fa:7679:d44a with SMTP id f26-20020a056402005a00b004fa7679d44amr21363721edu.11.1680196299279; Thu, 30 Mar 2023 10:11:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680196299; cv=none; d=google.com; s=arc-20160816; b=GotM1YwrvPUfW/XV96gSK98Ls8jwKUgld1FD+751Lh2XD+6W0cYpiOC96BNzGAEyzK YZObCti6P6Rgu6A64XRor4AajNoZyEdejbPnKAc4SHVQDxXAbdQuoKLLS7qjnfWhOn9U mzL62f6XpH3+wkuK5u7kJzWu5PG/m6hzBdVNrO10DqWIP8iK3KtmkglDrmZUppDSr4ku ieZrRbKxwa6tH6bWEb3j/Zspu38ceeY79BaubGRcIPbg8UZT8Nsc0EXXIvSDtuMsmg2v 5AqNh9BZVQlvpd33T7X2GhAzo679lldJOOTBL54NSbaBNeOd7kVfZW8Gl6+00gCtzjZm q6mg== 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=lH22MfJIcQmsTzdoJbOcWiocllL7iIB6Gn2R5IPwbtA=; b=wLzQ/F4ADT4JfIzyWPKSj/pNvjfuUETS6k5XBfdD9GNmvs4XhMKQxauMrhHFsaSh6D mLeIA76v8PSVaavZVQDgNA8Hlvg85moRDqSH/sl4eY5YV9+9QwUYXheIuOw4e++BAxM7 6goyMAU2mmzgnL/mBNMHsRL+kS+ZbzdpAXPAVF+9jQ2JfjxroexvlB7AkOHdKFZuGK4x 9IEs08McYkvr4/2woUAeQzUB+YIkKADNbvnoT2oVIRkB8MUfoenH1Dhj+7CUupalVp4x QRYgjde7CXbeJ9xfsBAXuwR9mExFguExFOyQYWAwVII/cUz1qWg24403DvwVsacTAp8D EGSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=chSMsIYm; 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 g22-20020aa7c596000000b00501da1bc72csi218122edq.521.2023.03.30.10.11.11; Thu, 30 Mar 2023 10:11:39 -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=chSMsIYm; 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 S231356AbjC3Q6X (ORCPT + 99 others); Thu, 30 Mar 2023 12:58:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229564AbjC3Q6V (ORCPT ); Thu, 30 Mar 2023 12:58:21 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87B345B8E for ; Thu, 30 Mar 2023 09:58:20 -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=lH22MfJIcQmsTzdoJbOcWiocllL7iIB6Gn2R5IPwbtA=; b=chSMsIYmRHyrgsJenrc6k7iulK vkLxxOqgENYMoMgVQdjMvd3+YmI/wtTuZwoWhojz7C/5UWFv+1oitVkJjl9TXV8SLPAu1F6Jap+1h NtUsnCtOHxmZPgUYdGuDSHsoKjwHcrQQ1j56AooEiKQppTvIeFoJW1ku7IZYwNVszKVqNcKPRX9aj FxMwGPvAffQ6rA4TLkTnuYkxW7gwhwcfHeC77OTg78cbdPtN0FbG9wLTASwJJf2428tPWaQmFCOuN s/xowZsTepl0+4ghPdAPaf6DGOOPZtQj27G1yXhVLsZrvGqV6w3b+novy4/82dO3dhXcKD5H1wARe nt4FBkmQ==; Received: from [71.59.149.187] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1phvbO-004YvS-2H; Thu, 30 Mar 2023 16:58:18 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Geert Uytterhoeven , Joerg Roedel , Will Deacon , Robin Murphy , iommu@lists.linux.dev, Conor Dooley , Lad Prabhakar Subject: [PATCH v2] iommu: make IPMMU_VMSA dependencies more strict Date: Thu, 30 Mar 2023 09:58:17 -0700 Message-Id: <20230330165817.21920-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761813514165238180?= X-GMAIL-MSGID: =?utf-8?q?1761813514165238180?= 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 ARM || ARM64 || COMPILE_TEST dependencies to IPMMU_VMSA to prevent these issues, i.e., so that ARCH_RENESAS on RISC-V is not allowed. This makes the ARCH dependencies become: depends on (ARCH_RENESAS && (ARM || ARM64)) || COMPILE_TEST but that can be a bit hard to read. Fixes: 8292493c22c8 ("riscv: Kconfig.socs: Add ARCH_RENESAS kconfig option") Signed-off-by: Randy Dunlap Suggested-by: Geert Uytterhoeven Cc: Joerg Roedel Cc: Will Deacon Cc: Robin Murphy Cc: iommu@lists.linux.dev Cc: Conor Dooley Cc: Lad Prabhakar Reviewed-by: Robin Murphy --- drivers/iommu/Kconfig | 1 + 1 file changed, 1 insertion(+) diff -- a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -287,6 +287,7 @@ config EXYNOS_IOMMU_DEBUG config IPMMU_VMSA bool "Renesas VMSA-compatible IPMMU" depends on ARCH_RENESAS || COMPILE_TEST + depends on ARM || ARM64 || COMPILE_TEST depends on !GENERIC_ATOMIC64 # for IOMMU_IO_PGTABLE_LPAE select IOMMU_API select IOMMU_IO_PGTABLE_LPAE