diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2018-08-31 04:42:24 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2018-10-09 05:20:55 -0400 |
commit | 53c99bd665a2649341ed6aed358ab56a3eedcd00 (patch) | |
tree | b7fb2be29c66039b6f986f988e064bfdff7dd392 /init/main.c | |
parent | 00e9e6645adc2c02c9ec5b42fd39d2a7f0880e6a (diff) |
init: add arch_call_rest_init to allow stack switching
With CONFIG_VMAP_STACK=y the kernel stack of all tasks should be
allocated in the vmalloc space. The initial stack used for all
the early init code is in the init_thread_union. To be able to
switch from this early stack to a properly allocated stack
from vmalloc the architecture needs a switch-over point.
Introduce the arch_call_rest_init() function with a weak definition
in init/main.c with the only purpose to call rest_init() from the
end of start_kernel(). The architecture override can then do the
necessary magic to switch to the new vmalloc'ed stack.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'init/main.c')
-rw-r--r-- | init/main.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/init/main.c b/init/main.c index 18f8f0140fa0..78b714a5fa94 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -394,7 +394,7 @@ static void __init setup_command_line(char *command_line) | |||
394 | 394 | ||
395 | static __initdata DECLARE_COMPLETION(kthreadd_done); | 395 | static __initdata DECLARE_COMPLETION(kthreadd_done); |
396 | 396 | ||
397 | static noinline void __ref rest_init(void) | 397 | noinline void __ref rest_init(void) |
398 | { | 398 | { |
399 | struct task_struct *tsk; | 399 | struct task_struct *tsk; |
400 | int pid; | 400 | int pid; |
@@ -528,6 +528,11 @@ static void __init mm_init(void) | |||
528 | pti_init(); | 528 | pti_init(); |
529 | } | 529 | } |
530 | 530 | ||
531 | void __init __weak arch_call_rest_init(void) | ||
532 | { | ||
533 | rest_init(); | ||
534 | } | ||
535 | |||
531 | asmlinkage __visible void __init start_kernel(void) | 536 | asmlinkage __visible void __init start_kernel(void) |
532 | { | 537 | { |
533 | char *command_line; | 538 | char *command_line; |
@@ -736,7 +741,7 @@ asmlinkage __visible void __init start_kernel(void) | |||
736 | } | 741 | } |
737 | 742 | ||
738 | /* Do the rest non-__init'ed, we're now alive */ | 743 | /* Do the rest non-__init'ed, we're now alive */ |
739 | rest_init(); | 744 | arch_call_rest_init(); |
740 | } | 745 | } |
741 | 746 | ||
742 | /* Call all constructor functions linked into the kernel. */ | 747 | /* Call all constructor functions linked into the kernel. */ |