Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1407966pxb; Fri, 21 Jan 2022 17:58:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLimCGd29XqSeuch0QpVxV+nJ/JWAWbuJ6weZ1SMk2e1iADvQUpDBInOOVscQ7PSLF4ghn X-Received: by 2002:a17:90b:4a8e:: with SMTP id lp14mr2699694pjb.73.1642816725107; Fri, 21 Jan 2022 17:58:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642816725; cv=none; d=google.com; s=arc-20160816; b=Wt7NaQgtlIxrV6z7slkBQKcO+DQbvrxgRjGNyF6Dm//ErOwBoF3ZLIrv4+bjY6snbb 7ta8HmeKr8+IdoCS/PgX5mn+kFlcS2BlSXOBAC9uhq4N0KXsApDtDpw8yncey7SjzQqd bZGUBc4qSHe5rNurC8pYJSXaMvAy0klme0nbhuFHK6giLuPFLj/YaZXcq+tkneixsFWy ur1fnuJK5w5Hzx2Z6V3FtGdDBQ6ilBiRolfoFapTGOA7rziOhB6IDL9JnDa1wbjeE6Vs yCM8te9jGdMqcgGz73shEp/2pV2JEPTy0AQgPoIVAlf8Qpg2Er48l+Mxki2NQW4W3zse FQfQ== 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=MbtVCQVgGWa2JoKlJ96LMQ2Tub8oCl14OG1vMhnAf+E=; b=R8n3+YSeokIKyBjyQBvzbYGXa0mdyhxFGzJXnooCCeyJj8I2oN9KT9LCZaiF9tc7z6 kk/dKhWhI+MjOJErRhPLdkxIqn/QJRcxPn0d8K/EUAb48/yPpn34YpZ4C92RmLIh6Xp3 Mrs7+E/EiTZ5RSaOkJH3A+PTedGCIhCEbWRojDCUN1QbbeAWKZuM56ns1di0aT/WqBri WDXJ2pfMjlacJo2ubr/BtzSa3U+Mupj0pLQC8XOan7nTCPai9aU0UkfW+BK2xjXjKK32 burLlpqeZVK+friESOLXRuPosIpz8mWIhVd0fmkT86EF5s0BKSYncgED/K7XvFI75akc hh/Q== 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 l11si1492165pga.8.2022.01.21.17.58.33; Fri, 21 Jan 2022 17:58:45 -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 S1350874AbiAUQhO (ORCPT + 99 others); Fri, 21 Jan 2022 11:37:14 -0500 Received: from gloria.sntech.de ([185.11.138.130]:35248 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349264AbiAUQhF (ORCPT ); Fri, 21 Jan 2022 11:37:05 -0500 Received: from p508fcef5.dip0.t-ipconnect.de ([80.143.206.245] 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 1nAwuM-0008GA-Vw; Fri, 21 Jan 2022 17:37:03 +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, dlustig@nvidia.com, 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 v5 08/14] riscv: move boot alternatives to a slightly earlier position Date: Fri, 21 Jan 2022 17:36:12 +0100 Message-Id: <20220121163618.351934-9-heiko@sntech.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220121163618.351934-1-heiko@sntech.de> References: <20220121163618.351934-1-heiko@sntech.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 db062279d9ed..432fe7b3f897 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