* [PATCH] powerpc: zero out BSS for all platforms
@ 2005-10-10 19:51 Kumar Gala
2005-10-11 7:46 ` Benjamin Herrenschmidt
2005-10-11 7:47 ` Geert Uytterhoeven
0 siblings, 2 replies; 5+ messages in thread
From: Kumar Gala @ 2005-10-10 19:51 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, linuxppc64-dev
We need to ensure that the BSS is zeroed out for all platforms.
Currently only prom_init.c was clearlying out the BSS which only works
for PPC_OF platforms.
Signed-off-by: Kumar K. Gala <kumar.gala@freescale.com>
---
commit 56381a9f0765ba3ffa5f21a4cdcb93ac0279eeea
tree 9f0f353b0776129626082a46b578d637fb79dad1
parent dfc32a358c961c3fbfa94942ecb06da2e895ffe7
author Kumar K. Gala <kumar.gala@freescale.com> Mon, 10 Oct 2005 14:48:36 -0500
committer Kumar K. Gala <kumar.gala@freescale.com> Mon, 10 Oct 2005 14:48:36 -0500
arch/powerpc/kernel/setup.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/kernel/setup.c b/arch/powerpc/kernel/setup.c
--- a/arch/powerpc/kernel/setup.c
+++ b/arch/powerpc/kernel/setup.c
@@ -293,6 +293,10 @@ unsigned long __init early_init(unsigned
reloc_got2(offset);
+ /* First zero the BSS -- use memset, some arches don't have
+ * caches on yet */
+ memset_io(PTRRELOC(&__bss_start), 0, _end - __bss_start);
+
/*
* Identify the CPU type and fix up code sections
* that depend on which cpu we have.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc: zero out BSS for all platforms
2005-10-10 19:51 [PATCH] powerpc: zero out BSS for all platforms Kumar Gala
@ 2005-10-11 7:46 ` Benjamin Herrenschmidt
2005-10-11 9:30 ` Olaf Hering
2005-10-11 7:47 ` Geert Uytterhoeven
1 sibling, 1 reply; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2005-10-11 7:46 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, linuxppc64-dev
On Mon, 2005-10-10 at 14:51 -0500, Kumar Gala wrote:
> We need to ensure that the BSS is zeroed out for all platforms.
> Currently only prom_init.c was clearlying out the BSS which only works
> for PPC_OF platforms.
>
> Signed-off-by: Kumar K. Gala <kumar.gala@freescale.com>
You need to make absolutely certain that we have not written anything to
the bss yet though... Is that the case ? I usually prefer doing the
zero'ing in assembly :)
Ben.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc: zero out BSS for all platforms
2005-10-11 7:46 ` Benjamin Herrenschmidt
@ 2005-10-11 9:30 ` Olaf Hering
2005-10-11 9:48 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 5+ messages in thread
From: Olaf Hering @ 2005-10-11 9:30 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Kumar Gala, linuxppc64-dev
On Tue, Oct 11, Benjamin Herrenschmidt wrote:
> On Mon, 2005-10-10 at 14:51 -0500, Kumar Gala wrote:
> > We need to ensure that the BSS is zeroed out for all platforms.
> > Currently only prom_init.c was clearlying out the BSS which only works
> > for PPC_OF platforms.
> >
> > Signed-off-by: Kumar K. Gala <kumar.gala@freescale.com>
>
> You need to make absolutely certain that we have not written anything to
> the bss yet though... Is that the case ? I usually prefer doing the
> zero'ing in assembly :)
early_init is called so early, its almost like asm code.
--
short story of a lazy sysadmin:
alias appserv=wotan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc: zero out BSS for all platforms
2005-10-11 9:30 ` Olaf Hering
@ 2005-10-11 9:48 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2005-10-11 9:48 UTC (permalink / raw)
To: Olaf Hering; +Cc: linuxppc-dev, Kumar Gala, linuxppc64-dev
On Tue, 2005-10-11 at 11:30 +0200, Olaf Hering wrote:
> On Tue, Oct 11, Benjamin Herrenschmidt wrote:
>
> > On Mon, 2005-10-10 at 14:51 -0500, Kumar Gala wrote:
> > > We need to ensure that the BSS is zeroed out for all platforms.
> > > Currently only prom_init.c was clearlying out the BSS which only works
> > > for PPC_OF platforms.
> > >
> > > Signed-off-by: Kumar K. Gala <kumar.gala@freescale.com>
> >
> > You need to make absolutely certain that we have not written anything to
> > the bss yet though... Is that the case ? I usually prefer doing the
> > zero'ing in assembly :)
>
> early_init is called so early, its almost like asm code.
Yah, as long as that stuff is still separate between ppc32 and ppc64,
that's fine. We'll have to be careful with iSeries once we do the
merge :)
Ben.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc: zero out BSS for all platforms
2005-10-10 19:51 [PATCH] powerpc: zero out BSS for all platforms Kumar Gala
2005-10-11 7:46 ` Benjamin Herrenschmidt
@ 2005-10-11 7:47 ` Geert Uytterhoeven
1 sibling, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2005-10-11 7:47 UTC (permalink / raw)
To: Kumar Gala; +Cc: Linux/PPC Development, linuxppc64-dev
On Mon, 10 Oct 2005, Kumar Gala wrote:
> We need to ensure that the BSS is zeroed out for all platforms.
> Currently only prom_init.c was clearlying out the BSS which only works
> for PPC_OF platforms.
>
> Signed-off-by: Kumar K. Gala <kumar.gala@freescale.com>
>
> ---
> commit 56381a9f0765ba3ffa5f21a4cdcb93ac0279eeea
> tree 9f0f353b0776129626082a46b578d637fb79dad1
> parent dfc32a358c961c3fbfa94942ecb06da2e895ffe7
> author Kumar K. Gala <kumar.gala@freescale.com> Mon, 10 Oct 2005 14:48:36 -0500
> committer Kumar K. Gala <kumar.gala@freescale.com> Mon, 10 Oct 2005 14:48:36 -0500
>
> arch/powerpc/kernel/setup.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/kernel/setup.c b/arch/powerpc/kernel/setup.c
> --- a/arch/powerpc/kernel/setup.c
> +++ b/arch/powerpc/kernel/setup.c
> @@ -293,6 +293,10 @@ unsigned long __init early_init(unsigned
>
> reloc_got2(offset);
>
> + /* First zero the BSS -- use memset, some arches don't have
^^^^^^
> + * caches on yet */
> + memset_io(PTRRELOC(&__bss_start), 0, _end - __bss_start);
^^^^^^^^^
The comment is not in sync with the code.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-10-11 9:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-10 19:51 [PATCH] powerpc: zero out BSS for all platforms Kumar Gala
2005-10-11 7:46 ` Benjamin Herrenschmidt
2005-10-11 9:30 ` Olaf Hering
2005-10-11 9:48 ` Benjamin Herrenschmidt
2005-10-11 7:47 ` Geert Uytterhoeven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).