Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1228513pxb; Thu, 24 Mar 2022 15:34:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1oujxWVRxaCyVSxki+tXK9BUg79bdAQFODNPRmtm4TIloldEIevSTJEmJdPopSr04S2gS X-Received: by 2002:a17:90a:7f84:b0:1bc:aba8:f281 with SMTP id m4-20020a17090a7f8400b001bcaba8f281mr8875029pjl.101.1648161294831; Thu, 24 Mar 2022 15:34:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648161294; cv=none; d=google.com; s=arc-20160816; b=q1Uv4ObfHbDT3bmewTWyvadmq0k3RlJJrZyqi0FOJ6+2OHr66MRSkwEiKEeMr6PQ/J G/OhgxLk3TuvH/EIBX6AKBztA0s9r4DCMf0DS3bShMsd3qAEsbmw7W88zuvuxIP+eoR6 ePcL01kREdiKuVtHx9byhTXk0QS9C6EuHSadCr9VsDSJ1b136pj8QkELwO1Py2ec9YLb AvM+sispcjePFz3vjw+FKRgbCW2szO/bsYJLnz2+3EJSDoZeo35QZZJfQBNYiusGiJBo Kw3c+sroFmqxXo8QSbVf9ltp8skt/27lQNN9vlk2ALnfTyGw/4kKY7hscRbo7Kzayu4A kkeQ== 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=CM1ZFTTYHlCy7clPjAXr5xPXWpKR2n7DpBW09aXV+zM=; b=QAehB5cUi7Ivdc5bov5sA12nlBcpZPeUyxfqJEGfhAW+qdugIo2Coac3olTUFG+ui5 +QHDa5TIDDjfgaicqsi7kmTcgUavdnabetxAxL+2yvTPlhZ8BZbeATpNXAXhmQPXE4/6 avGZkyynGIyfECjyYFNbgkugMTglJU+WGoIhTkZYLBvoN0v0tQFopGrlpzszIfwd9Wmz VTpoUrcqWY8AaiF0in7TvlZ6IXyyxmH4u7r7ZJNxELt7449n9/1y2vxb2LPKs4urHPF7 4JfnZAs4iN3SX2vgLHlTf8IwoqGwXF/LaAtV8VUTreALnvLf/By1Nn/qFBmbYofPipg2 f0HA== 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 z8-20020a170903018800b00153be5d2ecasi686661plg.186.2022.03.24.15.34.40; Thu, 24 Mar 2022 15:34:54 -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 S1346679AbiCXAJ3 (ORCPT + 99 others); Wed, 23 Mar 2022 20:09:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346619AbiCXAJM (ORCPT ); Wed, 23 Mar 2022 20:09:12 -0400 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6E0F8CCFB for ; Wed, 23 Mar 2022 17:07:39 -0700 (PDT) Received: from ip5b412258.dynamic.kabel-deutschland.de ([91.65.34.88] helo=phil.lan) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nXB0q-00055s-7h; Thu, 24 Mar 2022 01:07:36 +0100 From: Heiko Stuebner To: palmer@dabbelt.com, paul.walmsley@sifive.com, aou@eecs.berkeley.edu Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, wefu@redhat.com, liush@allwinnertech.com, guoren@kernel.org, atishp@atishpatra.org, anup@brainfault.org, drew@beagleboard.org, hch@lst.de, arnd@arndb.de, wens@csie.org, maxime@cerno.tech, gfavor@ventanamicro.com, andrea.mondelli@huawei.com, behrensj@mit.edu, xinhaoqu@huawei.com, mick@ics.forth.gr, allen.baum@esperantotech.com, jscheid@ventanamicro.com, rtrauben@gmail.com, samuel@sholland.org, cmuellner@linux.com, philipp.tomsich@vrull.eu, Heiko Stuebner Subject: [PATCH v8 08/14] riscv: move boot alternatives to after fill_hwcap Date: Thu, 24 Mar 2022 01:07:04 +0100 Message-Id: <20220324000710.575331-9-heiko@sntech.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220324000710.575331-1-heiko@sntech.de> References: <20220324000710.575331-1-heiko@sntech.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_NONE, 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 Move the application of boot alternatives to after the hw-capabilities are populated. This allows to check for available extensions when determining which alternatives to apply and also makes it actually work if CONFIG_SMP is disabled for whatever reason. Signed-off-by: Heiko Stuebner --- arch/riscv/kernel/setup.c | 2 ++ arch/riscv/kernel/smpboot.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c index 339ceb595b38..b4879c942b42 100644 --- a/arch/riscv/kernel/setup.c +++ b/arch/riscv/kernel/setup.c @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -295,6 +296,7 @@ void __init setup_arch(char **cmdline_p) #endif riscv_fill_hwcap(); + apply_boot_alternatives(); } static int __init topology_init(void) diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c index a6d13dca1403..f1e4948a4b52 100644 --- a/arch/riscv/kernel/smpboot.c +++ b/arch/riscv/kernel/smpboot.c @@ -32,7 +32,6 @@ #include #include #include -#include #include "head.h" @@ -41,7 +40,6 @@ static DECLARE_COMPLETION(cpu_running); void __init smp_prepare_boot_cpu(void) { init_cpu_topology(); - apply_boot_alternatives(); } void __init smp_prepare_cpus(unsigned int max_cpus) -- 2.35.1