riscv: move boot alternatives to a slightly earlier

A patch from »riscv: support for svpbmt and D1 memory types« in state Mainline for linux-kernel

From: Heiko Stuebner <heiko@...> Date: Wed, 12 Jan 2022 21:15:04 +0100

Commit-Message

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 <heiko@...>

Patch-Comment

arch/riscv/kernel/head.S | 2 ++ arch/riscv/kernel/smpboot.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-)

Statistics

  • 2 lines added
  • 2 lines removed

Changes

--------------------------- arch/riscv/kernel/head.S ---------------------------
index db062279d9ed..432fe7b3f897 100644
@@ -10,6 +10,7 @@
#include <asm/thread_info.h>
#include <asm/page.h>
#include <asm/pgtable.h>
+#include <asm/alternative.h>
#include <asm/csr.h>
#include <asm/cpu_ops_sbi.h>
#include <asm/hwcap.h>
@@ -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
------------------------- arch/riscv/kernel/smpboot.c --------------------------
index a6d13dca1403..f1e4948a4b52 100644
@@ -32,7 +32,6 @@
#include <asm/sections.h>
#include <asm/sbi.h>
#include <asm/smp.h>
-#include <asm/alternative.h>
#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)
 
 

Recent Patches

About Us

Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum vel, tempor at, varius non, purus. Mauris vitae nisl nec metus placerat consectetuer.

Read More...