x86: Rename __{start,end}_init_task to __{start,end}_init_stack
Subsystems (3)
PATCH 1/1 x86: Rename __{start,end}_init_task to __{start,end}_init_stack
The stack of a task has been separated from the memory of a task_struct struture for a long time on x86, as a result __{start,end}_init_task no longer mark the start and end of the init_task structure, but its stack only.
Rename __{start,end}_init_task to __{start,end}_init_stack.
Note other architectures are not affected because __{start,end}_init_task are used on x86 only.
--- arch/x86/include/asm/processor.h | 4 ++-- arch/x86/kernel/head_64.S | 2 +- arch/x86/xen/xen-head.S | 2 +- include/asm-generic/vmlinux.lds.h | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-)
arch/x86/include/asm/processor.h +2 -2
@@ -636,10 +636,10 @@ static __always_inline void prefetchw(const void *x)#define KSTK_ESP (task) (task_pt_regs(task)->sp)#else -extern unsigned long __end_init_task[]; +extern unsigned long __end_init_stack[];#define INIT_THREAD { \ - .sp = (unsigned long)&__end_init_task - \ + .sp = (unsigned long)&__end_init_stack - \ TOP_OF_KERNEL_STACK_PADDING - \ sizeof(struct pt_regs), \ }
arch/x86/kernel/head_64.S +1 -1
@@ -66,7 +66,7 @@ SYM_CODE_START_NOALIGN(startup_64) mov %rsi, %r15 /* Set up the stack for verify_cpu() */ - leaq (__end_init_task - TOP_OF_KERNEL_STACK_PADDING - PTREGS_SIZE)(%rip), %rsp + leaq (__end_init_stack - TOP_OF_KERNEL_STACK_PADDING - PTREGS_SIZE)(%rip), %rsp /* Setup GSBASE to allow stack canary access for C code */ movl $MSR_GS_BASE, %ecx
arch/x86/xen/xen-head.S +1 -1
@@ -49,7 +49,7 @@ SYM_CODE_START(startup_xen) ANNOTATE_NOENDBR cld - leaq (__end_init_task - TOP_OF_KERNEL_STACK_PADDING - PTREGS_SIZE)(%rip), %rsp + leaq (__end_init_stack - TOP_OF_KERNEL_STACK_PADDING - PTREGS_SIZE)(%rip), %rsp /* Set up %gs. *
include/asm-generic/vmlinux.lds.h +4 -4
@@ -399,13 +399,13 @@#define INIT_TASK_DATA (align) \ . = ALIGN(align); \ - __start_init_task = .; \ + __start_init_stack = .; \ init_thread_union = .; \ init_stack = .; \ - KEEP(*(.data..init_task)) \ + KEEP(*(.data..init_stack)) \ KEEP(*(.data..init_thread_info)) \ - . = __start_init_task + THREAD_SIZE; \ - __end_init_task = .; + . = __start_init_stack + THREAD_SIZE; \ + __end_init_stack = .;#define JUMP_TABLE_DATA \ . = ALIGN(8); \
base-commit: 626856ae97054963e7b8c35335d4418271c8d0c4
Signature · 1 line
2.44.0
Jürgen Groß
maintainerQuoted 66 lines · Xin Li (Intel)
The stack of a task has been separated from the memory of a
task_structstruture for a long time on x86, as a result __{start,end}_init_task no longer mark the start and end of theinit_taskstructure, but its stack only.Rename __{start,end}_init_task to __{start,end}_init_stack.
Note other architectures are not affected because __{start,end}_init_task are used on x86 only.
Signed-off-by Xin Li (Intel) <[email protected]>--- arch/x86/include/asm/processor.h | 4 ++-- arch/x86/kernel/head_64.S | 2 +- arch/x86/xen/xen-head.S | 2 +- include/asm-generic/vmlinux.lds.h | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-)arch/x86/include/asm/processor.h +2
-2@@ -636,10 +636,10 @@ static __always_inline void prefetchw(const void *x)#define KSTK_ESP (task) (task_pt_regs(task)->sp)#else -extern unsigned long __end_init_task[]; +extern unsigned long __end_init_stack[];#define INIT_THREAD { \ - .sp = (unsigned long)&__end_init_task - \ + .sp = (unsigned long)&__end_init_stack - \ TOP_OF_KERNEL_STACK_PADDING - \ sizeof(struct pt_regs), \ }arch/x86/kernel/head_64.S +1
-1@@ -66,7 +66,7 @@ SYM_CODE_START_NOALIGN(startup_64) mov %rsi, %r15 /* Set up the stack for verify_cpu() */ - leaq (__end_init_task - TOP_OF_KERNEL_STACK_PADDING - PTREGS_SIZE)(%rip), %rsp + leaq (__end_init_stack - TOP_OF_KERNEL_STACK_PADDING - PTREGS_SIZE)(%rip), %rsp /* Setup GSBASE to allow stack canary access for C code */ movl $MSR_GS_BASE, %ecxarch/x86/xen/xen-head.S +1
-1@@ -49,7 +49,7 @@ SYM_CODE_START(startup_xen) ANNOTATE_NOENDBR cld - leaq (__end_init_task - TOP_OF_KERNEL_STACK_PADDING - PTREGS_SIZE)(%rip), %rsp + leaq (__end_init_stack - TOP_OF_KERNEL_STACK_PADDING - PTREGS_SIZE)(%rip), %rsp /* Set up %gs. *include/asm-generic/vmlinux.lds.h +0
-0
include/asm-generic/vmlinux.lds.h line 405
Quoted 9 lines
include/asm-generic/vmlinux.lds.h +2
-2@@ -399,13 +399,13 @@#define INIT_TASK_DATA (align) \ . = ALIGN(align); \ - __start_init_task = .; \ + __start_init_stack = .; \ init_thread_union = .; \ init_stack = .; \ - KEEP(*(.data..init_task)) \ + KEEP(*(.data..init_stack)) \
Is this modification really correct?
Quoted 10 lines
include/asm-generic/vmlinux.lds.h +2
-2KEEP(*(.data..init_thread_info)) \ - . = __start_init_task + THREAD_SIZE; \ - __end_init_task = .; + . = __start_init_stack + THREAD_SIZE; \ + __end_init_stack = .;#define JUMP_TABLE_DATA \ . = ALIGN(8); \base-commit:
626856ae97054963e7b8c35335d4418271c8d0c4
Juergen
Quoted 12 lines · Jürgen Groß
Quoted 10 lines · Xin Li (Intel)
The stack of a task has been separated from the memory of a
task_structstruture for a long time on x86, as a result __{start,end}_init_task no longer mark the start and end of theinit_taskstructure, but its stack only.Rename __{start,end}_init_task to __{start,end}_init_stack.
Note other architectures are not affected because __{start,end}_init_task are used on x86 only.
Quoted 16 lines
include/asm-generic/vmlinux.lds.h line 404
Quoted 13 lines
include/asm-generic/vmlinux.lds.h +2
-2@@ -399,13 +399,13 @@ #define INIT_TASK_DATA(align) \ . = ALIGN(align); \ - __start_init_task = .; \ + __start_init_stack = .; \ init_thread_union = .; \ init_stack = .; \ - KEEP(*(.data..init_task)) \ + KEEP(*(.data..init_stack)) \Is this modification really correct?
Good catch, I should not change it.
Thanks!
Xin