Skip to content

Commit

Permalink
riscv: move boot alternatives to after fill_hwcap
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Heiko Stuebner authored and Palmer Dabbelt committed May 12, 2022
1 parent 49b290e commit ffb0b0a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions arch/riscv/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <linux/efi.h>
#include <linux/crash_dump.h>

#include <asm/alternative.h>
#include <asm/cpu_ops.h>
#include <asm/early_ioremap.h>
#include <asm/pgtable.h>
Expand Down Expand Up @@ -295,6 +296,7 @@ void __init setup_arch(char **cmdline_p)
#endif

riscv_fill_hwcap();
apply_boot_alternatives();
}

static int __init topology_init(void)
Expand Down
2 changes: 0 additions & 2 deletions arch/riscv/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <asm/sections.h>
#include <asm/sbi.h>
#include <asm/smp.h>
#include <asm/alternative.h>

#include "head.h"

Expand All @@ -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)
Expand Down

0 comments on commit ffb0b0a

Please sign in to comment.