Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp242521iol; Thu, 9 Jun 2022 03:02:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4D0RwUTeAcmvaWQI5Gfnszo6znhdJY4+n/ME7L5nLCP1DcBCJgFLH8eMZISjolF11opNT X-Received: by 2002:a17:907:2d2a:b0:710:76a1:4d89 with SMTP id gs42-20020a1709072d2a00b0071076a14d89mr26014882ejc.307.1654768978966; Thu, 09 Jun 2022 03:02:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654768978; cv=none; d=google.com; s=arc-20160816; b=KfKDRRZumaNQ1S7kSGG1Vo1wGbV1MhKYd/B2v4Kp8s2wW5bcKgpRN9D5XxNyi1z7ps VEQUsSuUa7MCvvFtnf8HcfD54XWYDYEwY57MG0ITd/xVx6PiZXxtxL47gxOEL/c1vnZ2 G2nVrUsS1+5xZQ1FA+Si9mdtJJ/eKZkhIEUTm5llsZGRFH+WoTbIP5+i4eig0hBRx0gZ L/Fx2b9+hCIIOX4SwclhuzyHp1l5IFUx7lfzMlyWLhZccN/eVzK1qsHhwNpXtBPQJnGF pDTPe0gXa0JymJzFnHDPruPyyxdCiStYooNqk9nIkr+7gyy8SyUvYk+djbj98S2HNOdU /eBw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=TKluWggm2f0Z+OR9lv60G7cfFjsEoIBP3m8QEv6iOjc=; b=v3QVmxFS5ydCeO61xRSe7JYCi+hPhf7Vvh+Glns7SyRQ9JpDfV4RE+F3NSM93m5a0L kfYIQApXi5mC2Bs8txT1sZX2lZBTckyH4sXRWhFHP6JyA1Oq/iOKdDj0NowUhkPKebug yQO5uhGiyPmiUvX/HkhQYQUUR1wOJ6uPI8Nb7z4bp38OT/xxEqahvz7mK8Fu28vfP4t/ FHtiLHhlPVkJX2bwzrDmRdij12hl86hdkIanG9zTZHErlyE2ykS7+ap+RCTvNhRxePsZ 2rvQQrx0ELKkhAjmMMIgvC+Z7CC0oLoKSuHmpPUGUQb6eP2RP6llrgWqTO0eKRhV9CAn xesg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hs27-20020a1709073e9b00b00708546030ffsi6950916ejc.101.2022.06.09.03.02.24; Thu, 09 Jun 2022 03:02:58 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234409AbiFIJ64 (ORCPT + 99 others); Thu, 9 Jun 2022 05:58:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234128AbiFIJ6z (ORCPT ); Thu, 9 Jun 2022 05:58:55 -0400 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50A143F29D2 for ; Thu, 9 Jun 2022 02:58:52 -0700 (PDT) Received: from ip5b412258.dynamic.kabel-deutschland.de ([91.65.34.88] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nzEw8-0004ug-HR; Thu, 09 Jun 2022 11:58:44 +0200 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Guo Ren Cc: Palmer Dabbelt , Paul Walmsley , linux-riscv , Linux Kernel Mailing List , Wei Fu , Christoph Muellner , Philipp Tomsich , Christoph Hellwig , Ron Economos Subject: Re: [PATCH] riscv: don't warn for sifive erratas in modules Date: Thu, 09 Jun 2022 11:58:40 +0200 Message-ID: <7523610.lvqk35OSZv@diego> In-Reply-To: References: <20220608120849.1695191-1-heiko@sntech.de> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS, T_SCC_BODY_TEXT_LINE,T_SPF_HELO_TEMPERROR autolearn=ham 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 Guo, Am Donnerstag, 9. Juni 2022, 03:39:24 CEST schrieb Guo Ren: > On Wed, Jun 8, 2022 at 8:09 PM Heiko Stuebner wrote: > > > > The SiFive errata code contains code checking applicable erratas > > vs. actually applied erratas to suggest missing erratas to the > > user when their Kconfig options are not enabled. > > > > In the main kernel image one can be quite sure that all available > > erratas appear at least once, so that check will succeed. > > On the other hand modules can very well not use any errata-relevant > > code, so the newly added module-alternative support may also patch > > the module code, but not touch SiFive-specific erratas at all. > > > > So to restore the original behaviour don't warn when patching > > modules. This will keep the warning if necessary for the main kernel > > image but prevent spurious warnings for modules. > > > > Of course having such a vendor-specific warning may not be needed at > > all, as CONFIG_ERRATA_SIFIVE is selected by CONFIG_SOC_SIFIVE and the > > individual erratas are default-y so disabling them requires > > deliberate action anyway. But for now just restore the old behaviour. > > > > Fixes: a8e910168bba ("riscv: implement module alternatives") > > Reported-by: Ron Economos > > Signed-off-by: Heiko Stuebner > > --- > > arch/riscv/errata/sifive/errata.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/arch/riscv/errata/sifive/errata.c b/arch/riscv/errata/sifive/errata.c > > index 672f02b21ce0..1031038423e7 100644 > > --- a/arch/riscv/errata/sifive/errata.c > > +++ b/arch/riscv/errata/sifive/errata.c > > @@ -111,6 +111,7 @@ void __init_or_module sifive_errata_patch_func(struct alt_entry *begin, > > cpu_apply_errata |= tmp; > > } > > } > > - if (cpu_apply_errata != cpu_req_errata) > > + if (stage != RISCV_ALTERNATIVES_MODULE && > > + cpu_apply_errata != cpu_req_errata) > if (cpu_apply_errata &= ~cpu_req_errata) Hmm, I don't see what that changes? > Shall we still guarantee the module's must be a subset of the main kernel.'s? The warning generated there is mainly to warn about some Kconfig options not being enabled and in individual modules even no errata usage may be required. The intent for the patch is to restore how things behaved before module-alternatives were introduced, so I don't really want to introduce functional changes ;-) . But also in the future we could debate if that warning is helpful at all, as the erratas are enabled automatically by CONFIG_SOC_SIFIVE and thus disabling individual erratas requires someone to turn them off manually in their .config . Heiko > > warn_miss_errata(cpu_req_errata - cpu_apply_errata); > > } > > -- > > 2.35.1 > > > > >