* [Q] x86 - boot/header.S @ 2008-02-23 8:20 Cyrill Gorcunov 2008-02-23 8:44 ` Yinghai Lu 2008-02-25 2:15 ` H. Peter Anvin 0 siblings, 2 replies; 8+ messages in thread From: Cyrill Gorcunov @ 2008-02-23 8:20 UTC (permalink / raw) To: H. Peter Anvin; +Cc: Sam Ravnborg, LKML Hi Peter, Sam, could you take a look on x86/boot/header.S:280 please? # Zero the bss movw $__bss_start, %di movw $_end+3, %cx xorl %eax, %eax subw %di, %cx shrw $2, %cx rep; stosl I wonder why is $_end there instead of $__bss_stop? Well, accroding to vmlinux_32.lsd both _end and __bss_stop are the same BUT __bss_stop is more convenient methink. Would it be usefull to change? - Cyrill - ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Q] x86 - boot/header.S 2008-02-23 8:20 [Q] x86 - boot/header.S Cyrill Gorcunov @ 2008-02-23 8:44 ` Yinghai Lu 2008-02-23 9:07 ` Cyrill Gorcunov 2008-02-25 2:15 ` H. Peter Anvin 1 sibling, 1 reply; 8+ messages in thread From: Yinghai Lu @ 2008-02-23 8:44 UTC (permalink / raw) To: Cyrill Gorcunov, Ingo Molnar, Eric W. Biederman Cc: H. Peter Anvin, Sam Ravnborg, LKML On Sat, Feb 23, 2008 at 12:20 AM, Cyrill Gorcunov <gorcunov@gmail.com> wrote: > Hi Peter, Sam, > > could you take a look on x86/boot/header.S:280 please? > > # Zero the bss > movw $__bss_start, %di > movw $_end+3, %cx > xorl %eax, %eax > subw %di, %cx > shrw $2, %cx > rep; stosl > > I wonder why is $_end there instead of $__bss_stop? > Well, accroding to vmlinux_32.lsd both _end and __bss_stop > are the same BUT __bss_stop is more convenient methink. > Would it be usefull to change? we should have head32.c like head64.c and x86_32_start_kernel. Eric's patch long time ago... YH ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Q] x86 - boot/header.S 2008-02-23 8:44 ` Yinghai Lu @ 2008-02-23 9:07 ` Cyrill Gorcunov 2008-02-23 9:18 ` Sam Ravnborg 2008-02-25 2:17 ` H. Peter Anvin 0 siblings, 2 replies; 8+ messages in thread From: Cyrill Gorcunov @ 2008-02-23 9:07 UTC (permalink / raw) To: Yinghai Lu Cc: Ingo Molnar, Eric W. Biederman, H. Peter Anvin, Sam Ravnborg, LKML [Yinghai Lu - Sat, Feb 23, 2008 at 12:44:49AM -0800] | On Sat, Feb 23, 2008 at 12:20 AM, Cyrill Gorcunov <gorcunov@gmail.com> wrote: | > Hi Peter, Sam, | > | > could you take a look on x86/boot/header.S:280 please? | > | > # Zero the bss | > movw $__bss_start, %di | > movw $_end+3, %cx | > xorl %eax, %eax | > subw %di, %cx | > shrw $2, %cx | > rep; stosl | > | > I wonder why is $_end there instead of $__bss_stop? | > Well, accroding to vmlinux_32.lsd both _end and __bss_stop | > are the same BUT __bss_stop is more convenient methink. | > Would it be usefull to change? | | we should have head32.c like head64.c | and x86_32_start_kernel. | | Eric's patch long time ago... | | YH | Hi Yinghai, thanks for reply BUT that is not the point (or maybe I miss something). Look, we only have head64.c - there is no head32.c at all. Both vmlinux_32/64.lds defines _end exactly the same as __bss_stop. So in code which DO fillup bss section with zeros the prefered name is __bss_stop. The only thing I'm trying to say that it would be clean naming scheme and I think it would help for further review - instead of searching all over x86 files to find _end definition __bss_stop tell us WHAT we are zeroing from the code. - Cyrill - ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Q] x86 - boot/header.S 2008-02-23 9:07 ` Cyrill Gorcunov @ 2008-02-23 9:18 ` Sam Ravnborg 2008-02-23 9:21 ` Cyrill Gorcunov 2008-02-25 2:17 ` H. Peter Anvin 1 sibling, 1 reply; 8+ messages in thread From: Sam Ravnborg @ 2008-02-23 9:18 UTC (permalink / raw) To: Cyrill Gorcunov Cc: Yinghai Lu, Ingo Molnar, Eric W. Biederman, H. Peter Anvin, LKML On Sat, Feb 23, 2008 at 12:07:39PM +0300, Cyrill Gorcunov wrote: > [Yinghai Lu - Sat, Feb 23, 2008 at 12:44:49AM -0800] > | On Sat, Feb 23, 2008 at 12:20 AM, Cyrill Gorcunov <gorcunov@gmail.com> wrote: > | > Hi Peter, Sam, > | > > | > could you take a look on x86/boot/header.S:280 please? > | > > | > # Zero the bss > | > movw $__bss_start, %di > | > movw $_end+3, %cx > | > xorl %eax, %eax > | > subw %di, %cx > | > shrw $2, %cx > | > rep; stosl > | > > | > I wonder why is $_end there instead of $__bss_stop? > | > Well, accroding to vmlinux_32.lsd both _end and __bss_stop > | > are the same BUT __bss_stop is more convenient methink. > | > Would it be usefull to change? > | > | we should have head32.c like head64.c > | and x86_32_start_kernel. > | > | Eric's patch long time ago... > | > | YH > | > > Hi Yinghai, > > thanks for reply BUT that is not the point (or maybe I miss something). > > Look, we only have head64.c - there is no head32.c at all. Both > vmlinux_32/64.lds defines _end exactly the same as __bss_stop. So in > code which DO fillup bss section with zeros the prefered name is > __bss_stop. The only thing I'm trying to say that it would be clean > naming scheme and I think it would help for further review - instead > of searching all over x86 files to find _end definition __bss_stop > tell us WHAT we are zeroing from the code. We should introduce head32.c and then we can use the exact same function as 64 bit does: /* Don't add a printk in there. printk relies on the PDA which is not initialized yet. */ static void __init clear_bss(void) { memset(__bss_start, 0, (unsigned long) __bss_stop - (unsigned long) __bss_start); } This answers your Q. I already resubmitted Eric's original patch to introduce head32.c as I also liked the cleanup in two Makefiles. Sam ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Q] x86 - boot/header.S 2008-02-23 9:18 ` Sam Ravnborg @ 2008-02-23 9:21 ` Cyrill Gorcunov 0 siblings, 0 replies; 8+ messages in thread From: Cyrill Gorcunov @ 2008-02-23 9:21 UTC (permalink / raw) To: Sam Ravnborg Cc: Yinghai Lu, Ingo Molnar, Eric W. Biederman, H. Peter Anvin, LKML [Sam Ravnborg - Sat, Feb 23, 2008 at 10:18:17AM +0100] | On Sat, Feb 23, 2008 at 12:07:39PM +0300, Cyrill Gorcunov wrote: | > [Yinghai Lu - Sat, Feb 23, 2008 at 12:44:49AM -0800] | > | On Sat, Feb 23, 2008 at 12:20 AM, Cyrill Gorcunov <gorcunov@gmail.com> wrote: | > | > Hi Peter, Sam, | > | > | > | > could you take a look on x86/boot/header.S:280 please? | > | > | > | > # Zero the bss | > | > movw $__bss_start, %di | > | > movw $_end+3, %cx | > | > xorl %eax, %eax | > | > subw %di, %cx | > | > shrw $2, %cx | > | > rep; stosl | > | > | > | > I wonder why is $_end there instead of $__bss_stop? | > | > Well, accroding to vmlinux_32.lsd both _end and __bss_stop | > | > are the same BUT __bss_stop is more convenient methink. | > | > Would it be usefull to change? | > | | > | we should have head32.c like head64.c | > | and x86_32_start_kernel. | > | | > | Eric's patch long time ago... | > | | > | YH | > | | > | > Hi Yinghai, | > | > thanks for reply BUT that is not the point (or maybe I miss something). | > | > Look, we only have head64.c - there is no head32.c at all. Both | > vmlinux_32/64.lds defines _end exactly the same as __bss_stop. So in | > code which DO fillup bss section with zeros the prefered name is | > __bss_stop. The only thing I'm trying to say that it would be clean | > naming scheme and I think it would help for further review - instead | > of searching all over x86 files to find _end definition __bss_stop | > tell us WHAT we are zeroing from the code. | | We should introduce head32.c and then we can use the exact same function | as 64 bit does: | | /* Don't add a printk in there. printk relies on the PDA which is not initialized | yet. */ | static void __init clear_bss(void) | { | memset(__bss_start, 0, | (unsigned long) __bss_stop - (unsigned long) __bss_start); | } | | This answers your Q. | | I already resubmitted Eric's original patch to introduce head32.c as I also | liked the cleanup in two Makefiles. | | Sam | thanks Sam, i just saw your patch. - Cyrill - ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Q] x86 - boot/header.S 2008-02-23 9:07 ` Cyrill Gorcunov 2008-02-23 9:18 ` Sam Ravnborg @ 2008-02-25 2:17 ` H. Peter Anvin 1 sibling, 0 replies; 8+ messages in thread From: H. Peter Anvin @ 2008-02-25 2:17 UTC (permalink / raw) To: Cyrill Gorcunov Cc: Yinghai Lu, Ingo Molnar, Eric W. Biederman, Sam Ravnborg, LKML Cyrill Gorcunov wrote: > Look, we only have head64.c - there is no head32.c at all. That's true to some degree, but head64.c contains a bunch of stuff which lives in setup_32.c in the 32-bit world. -hpa ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Q] x86 - boot/header.S 2008-02-23 8:20 [Q] x86 - boot/header.S Cyrill Gorcunov 2008-02-23 8:44 ` Yinghai Lu @ 2008-02-25 2:15 ` H. Peter Anvin 2008-02-25 8:06 ` Cyrill Gorcunov 1 sibling, 1 reply; 8+ messages in thread From: H. Peter Anvin @ 2008-02-25 2:15 UTC (permalink / raw) To: Cyrill Gorcunov; +Cc: Sam Ravnborg, LKML Cyrill Gorcunov wrote: > Hi Peter, Sam, > > could you take a look on x86/boot/header.S:280 please? > > # Zero the bss > movw $__bss_start, %di > movw $_end+3, %cx > xorl %eax, %eax > subw %di, %cx > shrw $2, %cx > rep; stosl > > I wonder why is $_end there instead of $__bss_stop? > Well, accroding to vmlinux_32.lsd both _end and __bss_stop > are the same BUT __bss_stop is more convenient methink. > Would it be usefull to change? x86/boot/header.S goes with x86/boot/setup.ld and no other linker script. -hpa ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Q] x86 - boot/header.S 2008-02-25 2:15 ` H. Peter Anvin @ 2008-02-25 8:06 ` Cyrill Gorcunov 0 siblings, 0 replies; 8+ messages in thread From: Cyrill Gorcunov @ 2008-02-25 8:06 UTC (permalink / raw) To: H. Peter Anvin; +Cc: Sam Ravnborg, LKML [H. Peter Anvin - Sun, Feb 24, 2008 at 06:15:52PM -0800] > Cyrill Gorcunov wrote: >> Hi Peter, Sam, >> could you take a look on x86/boot/header.S:280 please? >> # Zero the bss >> movw $__bss_start, %di >> movw $_end+3, %cx >> xorl %eax, %eax >> subw %di, %cx >> shrw $2, %cx >> rep; stosl >> I wonder why is $_end there instead of $__bss_stop? >> Well, accroding to vmlinux_32.lsd both _end and __bss_stop >> are the same BUT __bss_stop is more convenient methink. >> Would it be usefull to change? > > x86/boot/header.S goes with x86/boot/setup.ld and no other linker script. > > -hpa > indeed... :( anyway, setup.ld has the definition of __bss_stop too though in this case __bss_stop is not equal to _end BUT [__bss_start;__bss_stop] do cover *bss section anyway. According to Sam's last post it will not be a problem anymore 'cause of memset further usage. Thanks for comments, Peter. - Cyrill - ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2008-02-25 8:07 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-02-23 8:20 [Q] x86 - boot/header.S Cyrill Gorcunov 2008-02-23 8:44 ` Yinghai Lu 2008-02-23 9:07 ` Cyrill Gorcunov 2008-02-23 9:18 ` Sam Ravnborg 2008-02-23 9:21 ` Cyrill Gorcunov 2008-02-25 2:17 ` H. Peter Anvin 2008-02-25 2:15 ` H. Peter Anvin 2008-02-25 8:06 ` Cyrill Gorcunov
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox