Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3038752pxp; Tue, 8 Mar 2022 06:42:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJy135zDFPapcnajfIJkU1CPDJ2O+dalJ2x8ljgKMX8svkObCsEXemx31EMlY3FOa9fmCfz4 X-Received: by 2002:a62:1a87:0:b0:4f6:cf19:a2d4 with SMTP id a129-20020a621a87000000b004f6cf19a2d4mr18707881pfa.2.1646750521211; Tue, 08 Mar 2022 06:42:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646750521; cv=none; d=google.com; s=arc-20160816; b=qtj+do04MhafFeXQXDs9YZTFWp0nLOJWZBtO6VRraP7gSpwMY9RCR3/Lz98Nzk9pd8 zQ92EO6zSWpV5lv7SJAQ4elz2YirjW5dPYerVXQdxu7VUqT8HpFzteefHLpwxP1XgqRg De1Xubz3N+q9OOGsfhLd0BZg45JxFV2SHTIWBnHIhCFMCKbob2QlBIZi5iJVnCBNy0ww nVMieHTknn4F+gRi8kwpl1OX2J6k77Z5oEPRwfr6WZZ9fs4jU2Hv0Hzop4ayY8W9RacL jsRt/7o3FDCuh3Zq8OoSAfxvPgAS20gVW82na6pRPrOv/P7IwIt8DIpSp1rxKVdIiHxW 5J2g== 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=Iq0d0syXwicMYULN8aPpjWA2ZYJyh5s+m2hFfffl7iU=; b=h0EFlnnJF4JFK8xBfcKElRzMhcxgn9e8Jz/Zun4lYNs9aebWStqIIKcc3RX20ipM3M T5x4EVTLOUYjrcZ4kEs3F1h8C2/GEepxtAcs9Hf/5u64VS0pO87YinNLbH2CS57+bQwR Qn85Tfe02dL6h0UzvaWnWi9sQZCOHdYjkKfl4SiTxWYuKD01pbhcKTbafllkxanXctel CFyT51bgBSqaCXbVQ3PoGxRSJkoS0t/D6xnNuJME52fZqFB/rzobcfiiU4P4Zl0BVYCU NbKE+8ox0vAlqTRhPaajfsvHloOGRC9zyFW13/FRFNw70X9PvaQ4q6+SINhFAKlNJeRA vSBw== 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 c8-20020a63da08000000b00372f3e99ee8si16220878pgh.865.2022.03.08.06.41.43; Tue, 08 Mar 2022 06:42:01 -0800 (PST) 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 S245462AbiCGUyx (ORCPT + 99 others); Mon, 7 Mar 2022 15:54:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245392AbiCGUyU (ORCPT ); Mon, 7 Mar 2022 15:54:20 -0500 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6C0529C84 for ; Mon, 7 Mar 2022 12:53:25 -0800 (PST) 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 1nRKM4-0002DJ-LE; Mon, 07 Mar 2022 21:53:20 +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 v7 08/13] riscv: move boot alternatives to after fill_hwcap Date: Mon, 7 Mar 2022 21:53:05 +0100 Message-Id: <20220307205310.1905628-9-heiko@sntech.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220307205310.1905628-1-heiko@sntech.de> References: <20220307205310.1905628-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.30.2