File tree Expand file tree Collapse file tree 5 files changed +8
-16
lines changed Expand file tree Collapse file tree 5 files changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -636,12 +636,10 @@ static __always_inline void prefetchw(const void *x)
636
636
#define KSTK_ESP (task ) (task_pt_regs(task)->sp)
637
637
638
638
#else
639
- extern unsigned long __end_init_task [];
639
+ extern unsigned long __top_init_kernel_stack [];
640
640
641
641
#define INIT_THREAD { \
642
- .sp = (unsigned long)&__end_init_task - \
643
- TOP_OF_KERNEL_STACK_PADDING - \
644
- sizeof(struct pt_regs), \
642
+ .sp = (unsigned long)&__top_init_kernel_stack, \
645
643
}
646
644
647
645
extern unsigned long KSTK_ESP (struct task_struct * task );
Original file line number Diff line number Diff line change 44
44
#define X86_CAPABILITY new_cpu_data+CPUINFO_x86_capability
45
45
#define X86_VENDOR_ID new_cpu_data+CPUINFO_x86_vendor_id
46
46
47
-
48
- #define SIZEOF_PTREGS 17*4
49
-
50
47
/*
51
48
* Worst-case size of the kernel mapping we need to make:
52
49
* a relocatable kernel can live anywhere in lowmem, so we need to be able
@@ -488,13 +485,7 @@ SYM_DATA_END(initial_page_table)
488
485
489
486
.data
490
487
.balign 4
491
- /*
492
- * The SIZEOF_PTREGS gap is a convention which helps the in-kernel unwinder
493
- * reliably detect the end of the stack.
494
- */
495
- SYM_DATA(initial_stack,
496
- .long init_thread_union + THREAD_SIZE -
497
- SIZEOF_PTREGS - TOP_OF_KERNEL_STACK_PADDING)
488
+ SYM_DATA(initial_stack, .long __top_init_kernel_stack)
498
489
499
490
__INITRODATA
500
491
int_msg:
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ SYM_CODE_START_NOALIGN(startup_64)
66
66
mov %rsi , %r15
67
67
68
68
/* Set up the stack for verify_cpu() */
69
- leaq (__end_init_task - TOP_OF_KERNEL_STACK_PADDING - PTREGS_SIZE) (%rip ), %rsp
69
+ leaq __top_init_kernel_stack (%rip ), %rsp
70
70
71
71
/* Setup GSBASE to allow stack canary access for C code */
72
72
movl $MSR_GS_BASE, %ecx
Original file line number Diff line number Diff line change @@ -172,6 +172,9 @@ SECTIONS
172
172
/* init_task */
173
173
INIT_TASK_DATA(THREAD_SIZE)
174
174
175
+ /* equivalent to task_pt_regs(&init_task) */
176
+ __top_init_kernel_stack = __end_init_task - TOP_OF_KERNEL_STACK_PADDING - PTREGS_SIZE;
177
+
175
178
#ifdef CONFIG_X86_32
176
179
/* 32 bit has nosave before _edata */
177
180
NOSAVE_DATA
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ SYM_CODE_START(startup_xen)
49
49
ANNOTATE_NOENDBR
50
50
cld
51
51
52
- leaq (__end_init_task - TOP_OF_KERNEL_STACK_PADDING - PTREGS_SIZE) (%rip ), %rsp
52
+ leaq __top_init_kernel_stack (%rip ), %rsp
53
53
54
54
/* Set up %gs.
55
55
*
You can’t perform that action at this time.
0 commit comments