Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh: Setup boot CPU VBR early to enable early page faults.

vmemmap and the vmsplit code amongst others need to be able to take page
faults much earlier than trap_init() time, so move this in to the early
CPU initialization. VBR setup for secondary CPUs is already handled
through start_secondary(), so we only need to do this for the boot CPU.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

+17 -11
+17 -4
arch/sh/kernel/cpu/init.c
··· 24 24 #include <asm/elf.h> 25 25 #include <asm/io.h> 26 26 #include <asm/smp.h> 27 + #include <asm/sh_bios.h> 27 28 28 29 #ifdef CONFIG_SH_FPU 29 30 #define cpu_has_fpu 1 ··· 343 342 speculative_execution_init(); 344 343 expmask_init(); 345 344 346 - /* 347 - * Boot processor to setup the FP and extended state context info. 348 - */ 349 - if (raw_smp_processor_id() == 0) 345 + /* Do the rest of the boot processor setup */ 346 + if (raw_smp_processor_id() == 0) { 347 + /* Save off the BIOS VBR, if there is one */ 348 + sh_bios_vbr_init(); 349 + 350 + /* 351 + * Setup VBR for boot CPU. Secondary CPUs do this through 352 + * start_secondary(). 353 + */ 354 + per_cpu_trap_init(); 355 + 356 + /* 357 + * Boot processor to setup the FP and extended state 358 + * context info. 359 + */ 350 360 init_thread_xstate(); 361 + } 351 362 }
-7
arch/sh/kernel/traps_32.c
··· 30 30 #include <asm/alignment.h> 31 31 #include <asm/fpu.h> 32 32 #include <asm/kprobes.h> 33 - #include <asm/sh_bios.h> 34 33 35 34 #ifdef CONFIG_CPU_SH2 36 35 # define TRAP_RESERVED_INST 4 ··· 847 848 #ifdef TRAP_UBC 848 849 set_exception_table_vec(TRAP_UBC, breakpoint_trap_handler); 849 850 #endif 850 - 851 - /* Save off the BIOS VBR, if there is one */ 852 - sh_bios_vbr_init(); 853 - 854 - /* Setup VBR for boot cpu */ 855 - per_cpu_trap_init(); 856 851 } 857 852 858 853 void show_stack(struct task_struct *tsk, unsigned long *sp)