Commit 49f3bfe9334a4cf86079d2ee1d08e674b58862a9

Authored by Paul Mundt
1 parent 1d5cfcdff7

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>

Showing 2 changed files with 17 additions and 11 deletions Side-by-side Diff

arch/sh/kernel/cpu/init.c
... ... @@ -24,6 +24,7 @@
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
30 31  
... ... @@ -342,10 +343,22 @@
342 343 speculative_execution_init();
343 344 expmask_init();
344 345  
345   - /*
346   - * Boot processor to setup the FP and extended state context info.
347   - */
348   - if (raw_smp_processor_id() == 0)
  346 + /* Do the rest of the boot processor setup */
  347 + if (raw_smp_processor_id() == 0) {
  348 + /* Save off the BIOS VBR, if there is one */
  349 + sh_bios_vbr_init();
  350 +
  351 + /*
  352 + * Setup VBR for boot CPU. Secondary CPUs do this through
  353 + * start_secondary().
  354 + */
  355 + per_cpu_trap_init();
  356 +
  357 + /*
  358 + * Boot processor to setup the FP and extended state
  359 + * context info.
  360 + */
349 361 init_thread_xstate();
  362 + }
350 363 }
arch/sh/kernel/traps_32.c
... ... @@ -30,7 +30,6 @@
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
... ... @@ -848,12 +847,6 @@
848 847 #ifdef TRAP_UBC
849 848 set_exception_table_vec(TRAP_UBC, breakpoint_trap_handler);
850 849 #endif
851   -
852   - /* Save off the BIOS VBR, if there is one */
853   - sh_bios_vbr_init();
854   -
855   - /* Setup VBR for boot cpu */
856   - per_cpu_trap_init();
857 850 }
858 851  
859 852 void show_stack(struct task_struct *tsk, unsigned long *sp)