Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1799500pxb; Wed, 9 Feb 2022 04:55:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxnMEZgk1TYJ+sdS29364T8zWnfYGn1Rm7CqPdcn3SWD1SAyYbM6/nA/J0lSz9TwRxOs7X1 X-Received: by 2002:a63:e70b:: with SMTP id b11mr1754004pgi.161.1644411309146; Wed, 09 Feb 2022 04:55:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644411309; cv=none; d=google.com; s=arc-20160816; b=J6OSZS2iNClRXGxoFtLM6N9jewFUMHCdx/NELsv3/wckOmRrST2eUCmETw+VHs+onO ipOtdh2eOS20xtrRsvYcQ5m7BU7Ox/sR/ubTbcSu43XmDb+797T8eVr52dFRXjO7ICnk 8NKy79DAWtD4Femhp2NY2Y3KpMGu+moA7ddvfnGcmhKSTHFkrmbv9fwVWQSMtlSX6HaJ +LSGMWxR+9NDG/WbbhjZNiivDFbcHNUr0xMe/hQzdMucfTSezsCNCo0uefl1vqrGevxT I48TqRl9LTgYnBq4D9DT716UxB2piSivfRJXTVRDgEq1qAHSzRFiMdyuYCCoCwTU1Qox 7KGA== 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=AgprLzDR8q5V7DZbDq1uU3YEpq7nR6IXWTchkWevszQ=; b=mV46DFDYJBeyyXGT+gVk3PFZRXkJMG6VlbshTfUB09nWbeZ3aLgIYyMDcs5EDxx/48 2pEkJ7RZT52RU0wfAUAxpn/vbDKXQ+j9GQw9hwmKXBHJ8jiSJ8WY8MJGz3gx6fCJkxK8 SbZMycbgmgwXEzkIoXur2Y1Xm2i/bgC82MVpc3OEGfveQIDWBHqHcGs+3NNyB6T9gRlH 1QgSeRZs4neP6JLPdwXtUvViJ8bgwZn7k0CQdxZrnXNREUIKsODN0qASL1KRrdVPnkC2 lsaPKtG4ZeAS7rHN8llmxsKu637zxbL0JJ0+fcmQdQD+HBJw2kfqBxMV2F5oep35TBXR wQsg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p27si15054237pgb.407.2022.02.09.04.54.55; Wed, 09 Feb 2022 04:55:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233521AbiBIMjC (ORCPT + 99 others); Wed, 9 Feb 2022 07:39:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233368AbiBIMi1 (ORCPT ); Wed, 9 Feb 2022 07:38:27 -0500 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22D99C05CBB0; Wed, 9 Feb 2022 04:38:28 -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 1nHmEq-0001Mv-5A; Wed, 09 Feb 2022 13:38:24 +0100 From: Heiko Stuebner To: palmer@dabbelt.com, paul.walmsley@sifive.com, aou@eecs.berkeley.edu Cc: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, robh+dt@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, huffman@cadence.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 v6 08/14] riscv: move boot alternatives to a slightly earlier position Date: Wed, 9 Feb 2022 13:37:54 +0100 Message-Id: <20220209123800.269774-9-heiko@sntech.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220209123800.269774-1-heiko@sntech.de> References: <20220209123800.269774-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 soc_early_init(). This allows to catch more generic cases of code needing patches than doing it in smp_prepare_boot_cpu() and also makes it actually work if CONFIG_SMP is disabled for whatever reason. The position is chosen mainly as it is before the actual soc early init runs but also already allows accessing the devicetree via fdt_* functions. Signed-off-by: Heiko Stuebner --- arch/riscv/kernel/head.S | 2 ++ arch/riscv/kernel/smpboot.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S index 2363b43312fc..0e1bb97f9749 100644 --- a/arch/riscv/kernel/head.S +++ b/arch/riscv/kernel/head.S @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -341,6 +342,7 @@ clear_bss_done: call kasan_early_init #endif /* Start the kernel */ + call apply_boot_alternatives call soc_early_init tail start_kernel 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