Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp239101pxb; Tue, 12 Apr 2022 22:59:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzukIeJKXYqcUIl7pWKjJ1S9H1I1KhFEF2VioZjL60GZKCRAiMHqvotNIMjdnvamBHhft8T X-Received: by 2002:a17:906:d54e:b0:6db:b241:c0e2 with SMTP id cr14-20020a170906d54e00b006dbb241c0e2mr36853671ejc.724.1649829546122; Tue, 12 Apr 2022 22:59:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649829546; cv=none; d=google.com; s=arc-20160816; b=lG6vh3xKOCtDxEm7NWh0ntHSrJ1hblYksXO5BrUSQ4wLypHiB9CwRv+Z6wezsvgiaU i+winE0grWXdaDP0h8ywCbM4Q2muCX6QZ+g9wdYvTHHy5t+7eWZ4ybQXPWrVc+b5ru/l 0/xIec8H4eNGgFxp8F4f4QP5g/IAhTNmUZM7mDFdYkUlA/fbpSjxOU3dMQeLps2F9Y+T K+LfB4gn21nkaN7LEdsr9X64wkOF5ZWGbQ2Ax98O7cH86E0bfdpE5O4NjTOkl0zQKEoj TnX2A2SyUlKEeImQ4LMSGx29P0YW7snyP3cOhqwY3MYDLQATaR4wvjqXeg+MdZ6rm3TI M7PQ== 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=wqdeRl7jHofN4Z1alkv3hGslmUw1rjDMh2GLBbQfddQ=; b=ZHlQoN4WiOGxWJgg1bPkMZ7aLRCJ2CeHQAN200qlw//CAe766qGiZM7H+SRp61omKf FZ7C0GB9fkcf8LvdB/Bvz3F4OoGxg4OI7uSeVG6rDyp4W0fKU0R3zkJ+9qRQ6altHYAF fcjHY6GIkKWB9D73QQ7Dq1dNDK/NE/Rwpiobpq74Mpl2Hu0sTVL8R/kS0epp4Lf4cXTP GpRDI6TYVI8Q77J9rIHc/7gKt+H5eq1iyTJkMgFvMaKafUn+aJXKbodfKPmK/zn23ilg mgKATx3d0pcqYnX6qaZG8PAuPeCfYaMxKDEFGsx/cG1wa8lblyNiwuA1Y1YTfhxYo3hJ bOkA== 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 w25-20020a170906385900b006e7f47d22a9si10329492ejc.434.2022.04.12.22.58.40; Tue, 12 Apr 2022 22:59:06 -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 S231863AbiDMDF6 (ORCPT + 99 others); Tue, 12 Apr 2022 23:05:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229721AbiDMDFs (ORCPT ); Tue, 12 Apr 2022 23:05:48 -0400 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F31A254BF0 for ; Tue, 12 Apr 2022 20:03:21 -0700 (PDT) Received: from ip5b412258.dynamic.kabel-deutschland.de ([91.65.34.88] helo=phil.fritz.box) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1neTHr-0006sN-Ne; Wed, 13 Apr 2022 05:03:19 +0200 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 v9 07/12] riscv: move boot alternatives to after fill_hwcap Date: Wed, 13 Apr 2022 05:03:02 +0200 Message-Id: <20220413030307.133807-8-heiko@sntech.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220413030307.133807-1-heiko@sntech.de> References: <20220413030307.133807-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 Reviewed-by: Christoph Hellwig --- 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 f4f4a64bc3a0..9162e9a824d2 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