Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2463084iof; Wed, 8 Jun 2022 05:36:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0m5BJHa2tPMojZjjQDu7Y3i1frc9xFKOmDyhvbyJaJodmmWhRxj5SjWU4hgajdZQlVflP X-Received: by 2002:a17:902:f353:b0:167:7bc1:b1b9 with SMTP id q19-20020a170902f35300b001677bc1b1b9mr15760484ple.117.1654691763456; Wed, 08 Jun 2022 05:36:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654691763; cv=none; d=google.com; s=arc-20160816; b=h7v8yhIbO2SXO88A7b3pfMvWG5U5P1IXGL1I49CZyCSZ3OLln0mGuebDdQJOfncC6h 8yGpgCU4sabU5TYzDVMya2XAS0BGhN9TNTlg6V4tS+l8IVMGRayiemmug2K2VPr2qlYx s73eZinuEkxBWAp0tRiqeSO87Eh0Dmt31ShkcXEyf7C85Wn7odLc0ZYROu1/Kr65uz3o PkQqa+/qhA/7UlM6dprBoEqFFwFQdkRRDEdBQ8nVT0BwIC6w9Nl47k0oSPslzPwknQQa LKMhkgQ4Q2AdO+GqggVWVzKkto52TFaO3gBD6QCvgHixhMMGRtbKagIlpv33UeTsUvzt qm5g== 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; bh=qkzJIPAfBveUeWSlcA+eXZ0ueWWJxe/RIvP26KifcQo=; b=JhJzjrPvGaPGAaz28H+w8baC1SJFF6GrzUa/8EsOerkW7GVAQoW5dOIk5JLe/r5W7F 6Kwi0GpLSakEt46w4GmIQn/y85uY2jEBR6vkR2PjYMqLCGLNpcpfR9k74q+AGXm+w73d 2NpSYfFYJbUTTY6tfKLqRXTfca5BFmaI+C2A3C2IY75JXMiLprFh28UKHR34/gcHhSim wZDvqdc+B2F9ODKMgzBSQuq+F8qRsMHncLS95FOeTl5Y8SPVpU/gxkmY0woZQN2G4Ww5 rBX+VhtktDSfqCnKRXctMrzSn6jvxAmjUEXtAO/50vYRSV8Fj/bPyC9ilEAHIK/rGr7/ SUUA== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id m6-20020a637106000000b0039cb8fe4bddsi19592432pgc.259.2022.06.08.05.36.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 05:36:03 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F2F5E1D92E7; Wed, 8 Jun 2022 05:09:23 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238739AbiFHMJS (ORCPT + 99 others); Wed, 8 Jun 2022 08:09:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238646AbiFHMJQ (ORCPT ); Wed, 8 Jun 2022 08:09:16 -0400 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C241F4B for ; Wed, 8 Jun 2022 05:09:12 -0700 (PDT) Received: from ip5b412258.dynamic.kabel-deutschland.de ([91.65.34.88] helo=phil.lan) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nyuUh-0006dy-Vz; Wed, 08 Jun 2022 14:09:04 +0200 From: Heiko Stuebner To: palmer@dabbelt.com, paul.walmsley@sifive.com Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, wefu@redhat.com, guoren@kernel.org, cmuellner@linux.com, philipp.tomsich@vrull.eu, hch@lst.de, Heiko Stuebner , Ron Economos Subject: [PATCH] riscv: don't warn for sifive erratas in modules Date: Wed, 8 Jun 2022 14:08:49 +0200 Message-Id: <20220608120849.1695191-1-heiko@sntech.de> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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 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) warn_miss_errata(cpu_req_errata - cpu_apply_errata); } -- 2.35.1