Skip to contentSkip to conversation

x86: vmlinux_64.lds.S - use THREAD_SIZE instead of numeric constant

PATCH In review Cyrill Gorcunov 4 participants 6 messages Feb 4, 2008 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: vmlinux_64.lds.S - use THREAD_SIZE instead of numeric constant

---

arch/x86/kernel/vmlinux_64.lds.S +1 -1
Index: linux-2.6.git/arch/x86/kernel/vmlinux_64.lds.S
===================================================================
@@ -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
#1 lore raw

Hi Cyrill.

Quoted 1 line · Cyrill Gorcunov

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
#2 lore raw
Quoted 9 lines · Sam Ravnborg

Hi Cyrill.

Quoted 1 line · Cyrill Gorcunov

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.c require all variables allocated in the section .data.init_task to be aligned with THREAD_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

#3 lore raw
Quoted 7 lines · Ingo Molnar
Quoted 5 lines · Sam Ravnborg

Hi Cyrill.

Quoted 1 line · Cyrill Gorcunov

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.c require all variables allocated in the section .data.init_task to be aligned with THREAD_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

#4 lore raw

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

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.

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

#5 lore raw
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