public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: vmlinux_64.lds.S - use THREAD_SIZE instead of numeric constant
@ 2008-02-04 17:10 Cyrill Gorcunov
  2008-02-04 20:22 ` Sam Ravnborg
  0 siblings, 1 reply; 6+ messages in thread
From: Cyrill Gorcunov @ 2008-02-04 17:10 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Andi Kleen, Thomas Gleixner, H. Peter Anvin, LKML, Sam Ravnborg

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---

Index: linux-2.6.git/arch/x86/kernel/vmlinux_64.lds.S
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/vmlinux_64.lds.S	2008-01-30 17:51:57.000000000 +0300
+++ linux-2.6.git/arch/x86/kernel/vmlinux_64.lds.S	2008-02-03 22:38:48.000000000 +0300
@@ -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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86: vmlinux_64.lds.S - use THREAD_SIZE instead of numeric constant
  2008-02-04 17:10 [PATCH] x86: vmlinux_64.lds.S - use THREAD_SIZE instead of numeric constant Cyrill Gorcunov
@ 2008-02-04 20:22 ` Sam Ravnborg
  2008-02-04 20:33   ` Ingo Molnar
  0 siblings, 1 reply; 6+ messages in thread
From: Sam Ravnborg @ 2008-02-04 20:22 UTC (permalink / raw)
  To: Cyrill Gorcunov
  Cc: Ingo Molnar, Andi Kleen, Thomas Gleixner, H. Peter Anvin, LKML

Hi Cyrill.
On Mon, Feb 04, 2008 at 08:10:37PM +0300, Cyrill Gorcunov wrote:
> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>

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

> ---
> 
> Index: linux-2.6.git/arch/x86/kernel/vmlinux_64.lds.S
> ===================================================================
> --- linux-2.6.git.orig/arch/x86/kernel/vmlinux_64.lds.S	2008-01-30 17:51:57.000000000 +0300
> +++ linux-2.6.git/arch/x86/kernel/vmlinux_64.lds.S	2008-02-03 22:38:48.000000000 +0300
> @@ -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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86: vmlinux_64.lds.S - use THREAD_SIZE instead of numeric constant
  2008-02-04 20:22 ` Sam Ravnborg
@ 2008-02-04 20:33   ` Ingo Molnar
  2008-02-04 20:39     ` H. Peter Anvin
  0 siblings, 1 reply; 6+ messages in thread
From: Ingo Molnar @ 2008-02-04 20:33 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Cyrill Gorcunov, Andi Kleen, Thomas Gleixner, H. Peter Anvin,
	LKML


* Sam Ravnborg <sam@ravnborg.org> wrote:

> Hi Cyrill.
> On Mon, Feb 04, 2008 at 08:10:37PM +0300, Cyrill Gorcunov wrote:
> > Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
> 
> 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.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86: vmlinux_64.lds.S - use THREAD_SIZE instead of numeric constant
  2008-02-04 20:33   ` Ingo Molnar
@ 2008-02-04 20:39     ` H. Peter Anvin
  2008-02-04 21:12       ` Cyrill Gorcunov
  0 siblings, 1 reply; 6+ messages in thread
From: H. Peter Anvin @ 2008-02-04 20:39 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Sam Ravnborg, Cyrill Gorcunov, Andi Kleen, Thomas Gleixner, LKML

Ingo Molnar wrote:
> * Sam Ravnborg <sam@ravnborg.org> wrote:
> 
>> Hi Cyrill.
>> On Mon, Feb 04, 2008 at 08:10:37PM +0300, Cyrill Gorcunov wrote:
>>> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
>> 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.
> 
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86: vmlinux_64.lds.S - use THREAD_SIZE instead of numeric constant
  2008-02-04 20:39     ` H. Peter Anvin
@ 2008-02-04 21:12       ` Cyrill Gorcunov
  2008-02-04 21:26         ` Sam Ravnborg
  0 siblings, 1 reply; 6+ messages in thread
From: Cyrill Gorcunov @ 2008-02-04 21:12 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Ingo Molnar, Sam Ravnborg, Andi Kleen, Thomas Gleixner, LKML

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.

On 2/4/08, H. Peter Anvin <hpa@zytor.com> wrote:
> Ingo Molnar wrote:
> > * Sam Ravnborg <sam@ravnborg.org> wrote:
> >
> >> Hi Cyrill.
> >> On Mon, Feb 04, 2008 at 08:10:37PM +0300, Cyrill Gorcunov wrote:
> >>> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
> >> 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.
> >
> > 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
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86: vmlinux_64.lds.S - use THREAD_SIZE instead of numeric constant
  2008-02-04 21:12       ` Cyrill Gorcunov
@ 2008-02-04 21:26         ` Sam Ravnborg
  0 siblings, 0 replies; 6+ messages in thread
From: Sam Ravnborg @ 2008-02-04 21:26 UTC (permalink / raw)
  To: Cyrill Gorcunov
  Cc: H. Peter Anvin, Ingo Molnar, Andi Kleen, Thomas Gleixner, LKML

On Tue, Feb 05, 2008 at 12:12:32AM +0300, Cyrill Gorcunov wrote:
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-02-04 21:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-04 17:10 [PATCH] x86: vmlinux_64.lds.S - use THREAD_SIZE instead of numeric constant Cyrill Gorcunov
2008-02-04 20:22 ` Sam Ravnborg
2008-02-04 20:33   ` Ingo Molnar
2008-02-04 20:39     ` H. Peter Anvin
2008-02-04 21:12       ` Cyrill Gorcunov
2008-02-04 21:26         ` Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox