Skip to content

Commit ffb0b0a

Browse files
mmindpalmer-dabbelt
authored andcommitted
riscv: move boot alternatives to after fill_hwcap
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 <heiko@sntech.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu> Reviewed-by: Guo Ren <guoren@kernel.org> Link: https://lore.kernel.org/r/20220511192921.2223629-8-heiko@sntech.de Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent 49b290e commit ffb0b0a

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

arch/riscv/kernel/setup.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <linux/efi.h>
2222
#include <linux/crash_dump.h>
2323

24+
#include <asm/alternative.h>
2425
#include <asm/cpu_ops.h>
2526
#include <asm/early_ioremap.h>
2627
#include <asm/pgtable.h>
@@ -295,6 +296,7 @@ void __init setup_arch(char **cmdline_p)
295296
#endif
296297

297298
riscv_fill_hwcap();
299+
apply_boot_alternatives();
298300
}
299301

300302
static int __init topology_init(void)

arch/riscv/kernel/smpboot.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include <asm/sections.h>
3333
#include <asm/sbi.h>
3434
#include <asm/smp.h>
35-
#include <asm/alternative.h>
3635

3736
#include "head.h"
3837

@@ -41,7 +40,6 @@ static DECLARE_COMPLETION(cpu_running);
4140
void __init smp_prepare_boot_cpu(void)
4241
{
4342
init_cpu_topology();
44-
apply_boot_alternatives();
4543
}
4644

4745
void __init smp_prepare_cpus(unsigned int max_cpus)

0 commit comments

Comments
 (0)