Commit b32f96c7 authored by Josh Poimboeuf's avatar Josh Poimboeuf Committed by Ingo Molnar

x86/asm/head: Rename 'stack_start' -> 'initial_stack'

The 'stack_start' variable is similar in usage to 'initial_code' and
'initial_gs': they're all stored in head_64.S and they're all updated by
SMP and ACPI suspend before starting a CPU.

Rename it to 'initial_stack' to be consistent with the others.
Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Byungchul Park <byungchul.park@lge.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Nilay Vaish <nilayvaish@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/87063d773a3212051b77e17b0ee427f6582a5050.1471535549.git.jpoimboe@redhat.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 32541b47
...@@ -46,6 +46,7 @@ extern unsigned char real_mode_blob_end[]; ...@@ -46,6 +46,7 @@ extern unsigned char real_mode_blob_end[];
extern unsigned long initial_code; extern unsigned long initial_code;
extern unsigned long initial_gs; extern unsigned long initial_gs;
extern unsigned long initial_stack;
extern unsigned char real_mode_blob[]; extern unsigned char real_mode_blob[];
extern unsigned char real_mode_relocs[]; extern unsigned char real_mode_relocs[];
......
...@@ -39,9 +39,6 @@ DECLARE_EARLY_PER_CPU_READ_MOSTLY(u16, x86_bios_cpu_apicid); ...@@ -39,9 +39,6 @@ DECLARE_EARLY_PER_CPU_READ_MOSTLY(u16, x86_bios_cpu_apicid);
DECLARE_EARLY_PER_CPU_READ_MOSTLY(int, x86_cpu_to_logical_apicid); DECLARE_EARLY_PER_CPU_READ_MOSTLY(int, x86_cpu_to_logical_apicid);
#endif #endif
/* Static state in head.S used to set up a CPU */
extern unsigned long stack_start; /* Initial stack pointer address */
struct task_struct; struct task_struct;
struct smp_ops { struct smp_ops {
......
...@@ -99,7 +99,7 @@ int x86_acpi_suspend_lowlevel(void) ...@@ -99,7 +99,7 @@ int x86_acpi_suspend_lowlevel(void)
saved_magic = 0x12345678; saved_magic = 0x12345678;
#else /* CONFIG_64BIT */ #else /* CONFIG_64BIT */
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
stack_start = (unsigned long)temp_stack + sizeof(temp_stack); initial_stack = (unsigned long)temp_stack + sizeof(temp_stack);
early_gdt_descr.address = early_gdt_descr.address =
(unsigned long)get_cpu_gdt_table(smp_processor_id()); (unsigned long)get_cpu_gdt_table(smp_processor_id());
initial_gs = per_cpu_offset(smp_processor_id()); initial_gs = per_cpu_offset(smp_processor_id());
......
...@@ -94,7 +94,7 @@ RESERVE_BRK(pagetables, INIT_MAP_SIZE) ...@@ -94,7 +94,7 @@ RESERVE_BRK(pagetables, INIT_MAP_SIZE)
*/ */
__HEAD __HEAD
ENTRY(startup_32) ENTRY(startup_32)
movl pa(stack_start),%ecx movl pa(initial_stack),%ecx
/* test KEEP_SEGMENTS flag to see if the bootloader is asking /* test KEEP_SEGMENTS flag to see if the bootloader is asking
us to not reload segments */ us to not reload segments */
...@@ -286,7 +286,7 @@ num_subarch_entries = (. - subarch_entries) / 4 ...@@ -286,7 +286,7 @@ num_subarch_entries = (. - subarch_entries) / 4
* start_secondary(). * start_secondary().
*/ */
ENTRY(start_cpu0) ENTRY(start_cpu0)
movl stack_start, %ecx movl initial_stack, %ecx
movl %ecx, %esp movl %ecx, %esp
jmp *(initial_code) jmp *(initial_code)
ENDPROC(start_cpu0) ENDPROC(start_cpu0)
...@@ -307,7 +307,7 @@ ENTRY(startup_32_smp) ...@@ -307,7 +307,7 @@ ENTRY(startup_32_smp)
movl %eax,%es movl %eax,%es
movl %eax,%fs movl %eax,%fs
movl %eax,%gs movl %eax,%gs
movl pa(stack_start),%ecx movl pa(initial_stack),%ecx
movl %eax,%ss movl %eax,%ss
leal -__PAGE_OFFSET(%ecx),%esp leal -__PAGE_OFFSET(%ecx),%esp
...@@ -703,7 +703,7 @@ ENTRY(initial_page_table) ...@@ -703,7 +703,7 @@ ENTRY(initial_page_table)
.data .data
.balign 4 .balign 4
ENTRY(stack_start) ENTRY(initial_stack)
.long init_thread_union+THREAD_SIZE .long init_thread_union+THREAD_SIZE
__INITRODATA __INITRODATA
......
...@@ -66,7 +66,7 @@ startup_64: ...@@ -66,7 +66,7 @@ startup_64:
*/ */
/* /*
* Setup stack for verify_cpu(). "-8" because stack_start is defined * Setup stack for verify_cpu(). "-8" because initial_stack is defined
* this way, see below. Our best guess is a NULL ptr for stack * this way, see below. Our best guess is a NULL ptr for stack
* termination heuristics and we don't want to break anything which * termination heuristics and we don't want to break anything which
* might depend on it (kgdb, ...). * might depend on it (kgdb, ...).
...@@ -226,7 +226,7 @@ ENTRY(secondary_startup_64) ...@@ -226,7 +226,7 @@ ENTRY(secondary_startup_64)
movq %rax, %cr0 movq %rax, %cr0
/* Setup a boot time stack */ /* Setup a boot time stack */
movq stack_start(%rip), %rsp movq initial_stack(%rip), %rsp
/* zero EFLAGS after setting rsp */ /* zero EFLAGS after setting rsp */
pushq $0 pushq $0
...@@ -310,7 +310,7 @@ ENDPROC(secondary_startup_64) ...@@ -310,7 +310,7 @@ ENDPROC(secondary_startup_64)
* start_secondary(). * start_secondary().
*/ */
ENTRY(start_cpu0) ENTRY(start_cpu0)
movq stack_start(%rip),%rsp movq initial_stack(%rip),%rsp
movq initial_code(%rip),%rax movq initial_code(%rip),%rax
pushq $0 # fake return address to stop unwinder pushq $0 # fake return address to stop unwinder
pushq $__KERNEL_CS # set correct cs pushq $__KERNEL_CS # set correct cs
...@@ -319,15 +319,14 @@ ENTRY(start_cpu0) ...@@ -319,15 +319,14 @@ ENTRY(start_cpu0)
ENDPROC(start_cpu0) ENDPROC(start_cpu0)
#endif #endif
/* SMP bootup changes these two */ /* Both SMP bootup and ACPI suspend change these variables */
__REFDATA __REFDATA
.balign 8 .balign 8
GLOBAL(initial_code) GLOBAL(initial_code)
.quad x86_64_start_kernel .quad x86_64_start_kernel
GLOBAL(initial_gs) GLOBAL(initial_gs)
.quad INIT_PER_CPU_VAR(irq_stack_union) .quad INIT_PER_CPU_VAR(irq_stack_union)
GLOBAL(initial_stack)
GLOBAL(stack_start)
.quad init_thread_union+THREAD_SIZE-8 .quad init_thread_union+THREAD_SIZE-8
.word 0 .word 0
__FINITDATA __FINITDATA
......
...@@ -969,7 +969,7 @@ static int do_boot_cpu(int apicid, int cpu, struct task_struct *idle) ...@@ -969,7 +969,7 @@ static int do_boot_cpu(int apicid, int cpu, struct task_struct *idle)
early_gdt_descr.address = (unsigned long)get_cpu_gdt_table(cpu); early_gdt_descr.address = (unsigned long)get_cpu_gdt_table(cpu);
initial_code = (unsigned long)start_secondary; initial_code = (unsigned long)start_secondary;
stack_start = idle->thread.sp; initial_stack = idle->thread.sp;
/* /*
* Enable the espfix hack for this CPU * Enable the espfix hack for this CPU
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment