Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp20489521rwd; Thu, 29 Jun 2023 03:04:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Uu2FjeJcSiJFSX8M7auqpae0z+DsO8ECMDx19j9tDvlOBnUuN8M6b9NIpTVyQPeVmtVe/ X-Received: by 2002:a17:902:c3c6:b0:1b5:5aa0:cfd9 with SMTP id j6-20020a170902c3c600b001b55aa0cfd9mr11509169plj.48.1688033056516; Thu, 29 Jun 2023 03:04:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688033056; cv=none; d=google.com; s=arc-20160816; b=W+GKRxWeI+mzVfD/CN/HGpEkIkLN0QLx8jwZltuBk2Ajb/xbVuvTUUndrojrkab77+ qLbKvRV5VHIhWdindI8hKyp5G27z3A2V1rji0KLq/d+hqD/L4tDuF26ueUXrSjIwC7jd QNnC3XqbIsWqhx2vy40ybKYLetAUJpr76sxFr0hjhLqv1T1JXzqvV62iAeaPwRInDaXa vti5kZl3smCkUS3Rshcqu0jIZJrEgwp7F+lPdaLlbQd7UF6yZG6TOncx5PzrqRtK25be Ded3OLwwLZFAIYG/d4+coINPNqFDNOOxxA2OgNBDHE4wH108M6XvMC7iuaUdTOqu+B7p rdPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ajD4Xlmgnwv8O+jtu7HYaXxwVa4EBrrrsttRRo2IsCo=; fh=vwOFrSbmnCjYdWJ6C4s+7T5OaCjNGUMCDpwTbmcgYHo=; b=bitmtfQYQh8/1xT8amT5y+FJSJYHonZ1RvlK3D0sN+rLq5YU4Q63dWkt4FjLbvJo/2 uCKRzWCNqu/riitDLnYIZF1kgTKGRYcwQyBu9grffO8mC5UEJ+KXsivcokL/lcHu8c0E kOCXQ2uf+ZlZzVKIGVr+YUrOQEowv6LAKs5FIul0YV7osinNlrPQx1HDY1eNSKpLjsL8 XeS+omt1TpOsIp+qOH13wvZQUNwPm/9a31N6FSa5W5+JNeRoeGljSvMF9Yhm08zKN6pb MpsbN5tLoDZUb0xlLbhUNDLAf4g+qXEdQXWa+ZgJN6DpRWjnNCXE2xkLbeSVfQwA7MDW mnhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=S6CoM+QL; 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 f8-20020a170902ce8800b001b50cc75c2dsi11060797plg.611.2023.06.29.03.04.02; Thu, 29 Jun 2023 03:04: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=@ventanamicro.com header.s=google header.b=S6CoM+QL; 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 S229615AbjF2JcQ (ORCPT + 99 others); Thu, 29 Jun 2023 05:32:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231783AbjF2Jbo (ORCPT ); Thu, 29 Jun 2023 05:31:44 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87E7635AB for ; Thu, 29 Jun 2023 02:31:36 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-4fb960b7c9dso724051e87.0 for ; Thu, 29 Jun 2023 02:31:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1688031095; x=1690623095; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ajD4Xlmgnwv8O+jtu7HYaXxwVa4EBrrrsttRRo2IsCo=; b=S6CoM+QL+IrLFXgIDSFYfgP3xref1Lw3zrAa+ruoTEOTjEaeaWuoTi/yED9tjbOX3e WPy4uhNOuQ/FNXaRj8aD0G3pH+8qlO8D4BxuYAa4lGpwdcf6eftfPCG2ANJ7sdFMv4kV NjVwHbhrtAJVyuyZ6UtzcDQEYkrtRwFgHZJUI8GaBcf3os1KN5dYL6QD2xr5mcK6mkY/ SYXwzjIiHG7dgcHXiVmE0eqmwaXbKdm9KjwnCZS+otS/r8deZFL7rxvIoPhgnLRIdzhE z/1HTz7KLstyepnVUfFEUHJ39fR2O1TkMdm/bfO0XjWzVpm1xIjslxTdUBlh/u1r2iC0 Z2oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688031095; x=1690623095; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ajD4Xlmgnwv8O+jtu7HYaXxwVa4EBrrrsttRRo2IsCo=; b=cTBSuVrAfQ5ApEmB6XqgpudyQmsjJoHBKfIs0mjBRFac1/qUpagLu7uSaa8QkL5u3W YotMMwfjIpprpxdvA60SCwBNUEiSx6I9I5yUyjSx6HjrGIoUquwOJt7o4QUEg8TM0bQv VahStxsFe/aQxiKdCy3YFPMzmfw4MUAL2p6BBAuMj5tj+rrAr+Izzy4mSImhaculP+qr UurZekABzreC3+v4Cf/918N3B/xwPLyPdpvy+jKtWORlID6f91drlbc7AogdacMlP70l PnIzOKNXwxvrhswiR2HGdEBxeozgLB0u1bcyut98zfwtD5DNADfT0ZEcAUO/lfv9V3HP Izfw== X-Gm-Message-State: ABy/qLaNSbYtY4rZvmgqp9jQz6fiCUANHcHQKBoTxVu4nAmiXN/EuJh2 IQimCwtMM+IvifrL0DtVxcRhRgn+ad2w5Z5+7E4= X-Received: by 2002:a05:6512:2355:b0:4fb:97d9:382b with SMTP id p21-20020a056512235500b004fb97d9382bmr1730502lfu.60.1688031094662; Thu, 29 Jun 2023 02:31:34 -0700 (PDT) Received: from localhost (cst2-173-16.cust.vodafone.cz. [31.30.173.16]) by smtp.gmail.com with ESMTPSA id m6-20020a7bce06000000b003f733c1129fsm7205674wmc.33.2023.06.29.02.31.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jun 2023 02:31:34 -0700 (PDT) Date: Thu, 29 Jun 2023 11:31:33 +0200 From: Andrew Jones To: Conor Dooley Cc: palmer@dabbelt.com, conor@kernel.org, Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Albert Ou , Heiko Stuebner , Evan Green , Sunil V L , linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Palmer Dabbelt Subject: Re: [PATCH v2 10/10] RISC-V: provide a Kconfig option to disable parsing "riscv,isa" Message-ID: <20230629-a80f112e6ed4158080867694@orel> References: <20230629-rebuttal-vagueness-a699deb7c7b3@wendy> <20230629-resilient-grievance-d782163b09d6@wendy> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230629-resilient-grievance-d782163b09d6@wendy> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Thu, Jun 29, 2023 at 09:28:56AM +0100, Conor Dooley wrote: > As it says on the tin, provide a Kconfig option to disabling parsing the > "riscv,isa" devicetree property. Hide the option behind NONPORTABLE so > that only those willing to keep the pieces enable it, and make sure the > default kernel contains the fallback code. > > Suggested-by: Palmer Dabbelt > Signed-off-by: Conor Dooley > --- > arch/riscv/Kconfig | 16 ++++++++++++++++ > arch/riscv/kernel/cpu.c | 3 +++ > arch/riscv/kernel/cpufeature.c | 2 +- > 3 files changed, 20 insertions(+), 1 deletion(-) > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > index 1d39efe2b940..0e1909ac5947 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -291,6 +291,22 @@ config NONPORTABLE > > If unsure, say N. > > +config NO_RISCV_ISA_FALLBACK > + bool "Permit falling back to parsing riscv,isa for extension support" > + depends on NONPORTABLE > + help > + Parsing the "riscv,isa" devicetree property has been deprecated and > + replaced by a list of explicitly defined strings. For compatibility > + with existing platforms, the kernel will fall back to parsing the > + "riscv,isa" property if the replacements are not found. > + > + Selecting Y here will result in a kernel without this fallback, and > + will not work on platforms where the devicetree does not contain the > + replacement properties of "riscv,isa-base" and ^ spacing issue > + "riscv,isa-extensions". Please see the dt-binding, located at > + Documentation/devicetree/bindings/riscv/extensions.yaml for details > + on the replacement properties. > + > choice > prompt "Base ISA" > default ARCH_RV64I > diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c > index 9a4f4a23afcd..86a1d98b8b3b 100644 > --- a/arch/riscv/kernel/cpu.c > +++ b/arch/riscv/kernel/cpu.c > @@ -81,6 +81,9 @@ int riscv_early_of_processor_hartid(struct device_node *node, unsigned long *har > return 0; > > old_interface: > + if (IS_ENABLED(CONFIG_NO_RISCV_ISA_FALLBACK)) > + return -ENODEV; > + > if (of_property_read_string(node, "riscv,isa", &isa)) { > pr_warn("CPU with hartid=%lu has no \"riscv,isa-base\" or \"riscv,isa\" property\n", > *hart); > diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c > index 2c4503fa984f..f6fb18d2af84 100644 > --- a/arch/riscv/kernel/cpufeature.c > +++ b/arch/riscv/kernel/cpufeature.c > @@ -490,7 +490,7 @@ void __init riscv_fill_hwcap(void) > } else { > int ret = riscv_fill_hwcap_from_ext_list(isa2hwcap); > > - if (ret) { > + if (ret && !IS_ENABLED(CONFIG_NO_RISCV_ISA_FALLBACK)) { > pr_info("Falling back to deprecated \"riscv,isa\"\n"); > riscv_fill_hwcap_from_isa_string(isa2hwcap); > } > -- > 2.40.1 > Should we also have a kernel command line option, 'isa_fallback', where without this config the command line option is not necessary to fallback, but, with this config, no fallback will be done unless 'isa_fallback' is provided? Thanks, drew