Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1752156rwl; Thu, 30 Mar 2023 00:40:15 -0700 (PDT) X-Google-Smtp-Source: AKy350Y2T22WoIbViebKc9KujrBmTen9gA0XQZVhOUHvL9HTn45bwRcD2oDkMFbUf3Ogvs6NJstG X-Received: by 2002:a05:6402:1d48:b0:4bb:afe3:e0a with SMTP id dz8-20020a0564021d4800b004bbafe30e0amr1767391edb.3.1680162014895; Thu, 30 Mar 2023 00:40:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680162014; cv=none; d=google.com; s=arc-20160816; b=h3wCZTV1avmnjtZOf+do3AdgxhVVwXOaZgwnREPv5+DlTTM2xxYUCwteslpP6ONs6N FTwvYqaCWE32OV4XPzzGUWtkpE3WDq1xn8HaIGtfP6S0cf79behzrL8jbB5o19QiSDKW i2WHQPpbnq2XP3rb3Y9kstFA6vzSPNy0quIcy45z2lyMH/CTpIk6ce/DNbZeOY50a2o+ NFJQ9Mf2o1lRBJuXPb5uv1Pmw4TCX0UR5XS7uA13ttkvFdss7ii2eTX4hhWIv/VzFuw4 KDzrOlMCMyushFRxESzp+cGLMJ1m3mQznVSkSpQaTnbv54j7ORvenQ0Vlwnrcofkjq3m +ljg== 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=STcein7P2FXlIkhX6OaEJXuIuQ9fL+mOqb1M+6XD3lI=; b=V+wiWRte+SGveBuj+EHAp7HVtfE2Gu9HMo98RZRUzMmMnNUAAEI0XuN4Zcxy8L8LtB SL2OvwknCcUT9+Rv2pf4gn/16q6XB7ixUNjI4+7LpjrrqWIBptuOlf3Jbx6Gzgd0tBbq PNxan/wpebbJPphBiXKxeQdqy0MrZ4/RtIN3j6h42Jb8CWY33WUMCQMWsyCbSeGPsZiK s2R9k41TEcS7KfSjEvU1rXpSPocQqkDDXIFprM54FFpctx3i2Mnfh8xBdpFYMNo9Rfip K5i2UbgXl2wy+gQnNfVvI0ShYqzZeN/gfBys2wc3uj9GRfPJsSgfbX4Vm0dbbaRMd4rK F50Q== 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 i23-20020a056402055700b004fd03dd5f0dsi32820631edx.563.2023.03.30.00.39.49; Thu, 30 Mar 2023 00:40:14 -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 S230506AbjC3HcI convert rfc822-to-8bit (ORCPT + 99 others); Thu, 30 Mar 2023 03:32:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231167AbjC3Hbs (ORCPT ); Thu, 30 Mar 2023 03:31:48 -0400 Received: from mail-yw1-f179.google.com (mail-yw1-f179.google.com [209.85.128.179]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A91F729B for ; Thu, 30 Mar 2023 00:31:41 -0700 (PDT) Received: by mail-yw1-f179.google.com with SMTP id 00721157ae682-544f7c176easo338891447b3.9 for ; Thu, 30 Mar 2023 00:31:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680161500; 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=LxN0r0AhgneifQhzqL4mjT7JfsmxnYyFrUEJ452tNfU=; b=UJAKo2hjT5XN0jjvBr2vo0JiQAQPK5+gdUNYYR3tww7JMIaWR+CLHUEv8AQzCs/eQ6 67ZBIxM+4H2lx8mM25tdCMGZqavotgXdgwinqXOeu2+d+rLRRe5aR0x+XieN5nu3vDIs XHYA2w7oEFF4bbbqZi7bXiYxtHhsGsqaqkwfJJkmjRSlGzCES7XuAX4q7GA0MV+xrswZ Vn4jAVXbO2qGvO0VuUZn5JvU9G0CdX9I4ilulDy7yuBm7mvzHvAxlF7i6smNws7LPFt+ G0i0jEZe5iODiQJ9yG82taHUqAqOa9mcNg3zKlELCQf9yGbEgPRUZ7mXoAjBKYWOJOW0 QwIw== X-Gm-Message-State: AAQBX9cZqZ1pJRS0ixoy+P6xDkGtn4VnNpMHrpUKnErYS5peopEm9kIz EreAxbGhFfqUg9G8RO3w92ftAniTwNADjQ== X-Received: by 2002:a81:7889:0:b0:544:b64e:f3dc with SMTP id t131-20020a817889000000b00544b64ef3dcmr4861063ywc.6.1680161499989; Thu, 30 Mar 2023 00:31:39 -0700 (PDT) Received: from mail-yb1-f173.google.com (mail-yb1-f173.google.com. [209.85.219.173]) by smtp.gmail.com with ESMTPSA id 85-20020a810358000000b0054621137a77sm790815ywd.26.2023.03.30.00.31.39 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Mar 2023 00:31:39 -0700 (PDT) Received: by mail-yb1-f173.google.com with SMTP id k17so22347758ybm.11 for ; Thu, 30 Mar 2023 00:31:39 -0700 (PDT) X-Received: by 2002:a25:1185:0:b0:a27:3ecc:ffe7 with SMTP id 127-20020a251185000000b00a273eccffe7mr2687305ybr.3.1680161499271; Thu, 30 Mar 2023 00:31:39 -0700 (PDT) MIME-Version: 1.0 References: <20230330060105.29460-1-rdunlap@infradead.org> In-Reply-To: From: Geert Uytterhoeven Date: Thu, 30 Mar 2023 09:31:27 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] iommu: PGTABLE_LPAE is also for RISCV To: Conor Dooley Cc: Randy Dunlap , 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, RCVD_IN_MSPIKE_H2,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 Conor, 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 > > 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 -- 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