x86: vmlinux_64.lds.S - use THREAD_SIZE instead of numeric constant
PATCH 1/1 x86: vmlinux_64.lds.S - use THREAD_SIZE instead of numeric constant
---
arch/x86/kernel/vmlinux_64.lds.S +1 -1
@@ -129,7 +129,7 @@ SECTIONS #undef VVIRT_OFFSET #undef VVIRT - . = ALIGN(8192); /* init_task */ + . = ALIGN(THREAD_SIZE); /* init_task */ .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) { *(.data.init_task) }:data.init
Hi Cyrill.
Quoted 1 line · Cyrill Gorcunov
Signed-off-by Cyrill Gorcunov <[email protected]>
The patch looks simple but please explain why you do what you do. It took me some digging before I could convince mysleft this was indeed a correct change.
And I am pretty sure you did the same investigation yourself.
A comment like:
arch/x866/kernel/inittask.c require all variables allocated in the section .data.init_task to be aligned with THREAD_SIZE.
would have made me happy.
Sam
Quoted 15 lines
---
Index:
linux-2.6.git/arch/x86/kernel/vmlinux_64.lds.S
===================================================================arch/x86/kernel/vmlinux_64.lds.S +1
-1@@ -129,7 +129,7 @@ SECTIONS #undef VVIRT_OFFSET #undef VVIRT - . = ALIGN(8192); /* init_task */ + . = ALIGN(THREAD_SIZE); /* init_task */ .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) { *(.data.init_task) }:data.init
Quoted 9 lines · Sam Ravnborg
Hi Cyrill.
Quoted 1 line · Cyrill Gorcunov
Signed-off-by Cyrill Gorcunov <[email protected]>The patch looks simple but please explain why you do what you do. It took me some digging before I could convince mysleft this was indeed a correct change. And I am pretty sure you did the same investigation yourself.
Quoted 6 lines
A comment like:
arch/x866/kernel/inittask.crequire all variables allocated in the section .data.init_task to be aligned withTHREAD_SIZE.would have made me happy.
Btw., given that on x86 we've moved away from the %esp based task stack trick and use an %fs based Percpu-Data-Area (PDA) to access the current task pointer, this alignment might not be necessary anymore. It's a historic relic of the mask-%esp trick.
Ingo
H. Peter Anvin
reviewerQuoted 7 lines · Ingo Molnar
Quoted 5 lines · Sam Ravnborg
Hi Cyrill.
Quoted 1 line · Cyrill Gorcunov
Signed-off-by Cyrill Gorcunov <[email protected]>The patch looks simple but please explain why you do what you do. It took me some digging before I could convince mysleft this was indeed a correct change. And I am pretty sure you did the same investigation yourself.
Quoted 9 lines
Quoted 6 lines
A comment like:
arch/x866/kernel/inittask.crequire all variables allocated in the section .data.init_task to be aligned withTHREAD_SIZE.would have made me happy.
Btw., given that on x86 we've moved away from the %esp based task stack trick and use an %fs based Percpu-Data-Area (PDA) to access the current task pointer, this alignment might not be necessary anymore. It's a historic relic of the mask-%esp trick.
Was that *ever* used on x86-64? I thought x86-64 always used %gs for this.
-hpa
Sam, Ingo, Peter, i didn't commented it 'cause there was no comment in 32bit version. And Sam, you are so right - i spent some time on trying to remember that 8192 bytes trick, and it seems it's not actual anymore for 64bits cpu. As punishment for myself i'm going to shut up for a week. Sorry for spent yours time.
Quoted 28 lines · H. Peter Anvin
Quoted 15 lines · Ingo Molnar
Quoted 13 lines · Sam Ravnborg
Hi Cyrill.
Quoted 1 line · Cyrill Gorcunov
Signed-off-by Cyrill Gorcunov <[email protected]>The patch looks simple but please explain why you do what you do. It took me some digging before I could convince mysleft this was indeed a correct change. And I am pretty sure you did the same investigation yourself.
A comment like:
arch/x866/kernel/inittask.crequire all variables allocated in the section .data.init_task to be aligned withTHREAD_SIZE.Quoted 7 lines
Quoted 1 line
would have made me happy.
Btw., given that on x86 we've moved away from the %esp based task stack trick and use an %fs based Percpu-Data-Area (PDA) to access the current task pointer, this alignment might not be necessary anymore. It's a historic relic of the mask-%esp trick.
Was that *ever* used on x86-64? I thought x86-64 always used %gs for this.
-hpa
Quoted 5 lines · Cyrill Gorcunov
Sam, Ingo, Peter, i didn't commented it 'cause there was no comment in 32bit version. And Sam, you are so right - i spent some time on trying to remember that 8192 bytes trick, and it seems it's not actual anymore for 64bits cpu. As punishment for myself i'm going to shut up for a week. Sorry for spent yours time.
Please take this as learning-by-doing - and continue to submit patches. It it by no means the last time you are asked to do something different. It happens all the time for all of us.
Sam