linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sh: include empty zero page in zImage
@ 2009-12-03 12:26 Magnus Damm
  2009-12-03 13:48 ` Stuart MENEFY
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Magnus Damm @ 2009-12-03 12:26 UTC (permalink / raw)
  To: linux-sh

From: Magnus Damm <damm@opensource.se>

Include the empty zero page data in the zImage.
Without this patch the empty zero page may be
uninitialized.

Signed-off-by: Magnus Damm <damm@opensource.se>
---

 I suppose we should have a fallback option to
 allow boot loaders passing data in the zero page.
 Or perhaps doing it the other way around is better.

 arch/sh/boot/compressed/Makefile |    2 --
 arch/sh/boot/compressed/misc.c   |    2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

--- 0001/arch/sh/boot/compressed/Makefile
+++ work/arch/sh/boot/compressed/Makefile	2009-12-03 21:06:02.000000000 +0900
@@ -48,8 +48,6 @@ $(obj)/vmlinux.bin.bz2: $(vmlinux.bin.al
 $(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE
 	$(call if_changed,lzma)
 
-OBJCOPYFLAGS += -R .empty_zero_page
-
 LDFLAGS_piggy.o := -r --format binary --oformat $(ld-bfd) -T
 
 $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE
--- 0001/arch/sh/boot/compressed/misc.c
+++ work/arch/sh/boot/compressed/misc.c	2009-12-03 21:05:58.000000000 +0900
@@ -131,7 +131,7 @@ void decompress_kernel(void)
 #ifdef CONFIG_SUPERH64
 	output_addr = (CONFIG_MEMORY_START + 0x2000);
 #else
-	output_addr = __pa((unsigned long)&_text+PAGE_SIZE);
+	output_addr = __pa((unsigned long)&_text);
 #ifdef CONFIG_29BIT
 	output_addr |= P2SEG;
 #endif

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

* Re: [PATCH] sh: include empty zero page in zImage
  2009-12-03 12:26 [PATCH] sh: include empty zero page in zImage Magnus Damm
@ 2009-12-03 13:48 ` Stuart MENEFY
  2009-12-03 14:22 ` Magnus Damm
  2009-12-03 21:09 ` Paul Mundt
  2 siblings, 0 replies; 4+ messages in thread
From: Stuart MENEFY @ 2009-12-03 13:48 UTC (permalink / raw)
  To: linux-sh

Magnus

If you do this won't you overwrite any parameters from the boot loader?

Stuart

Magnus Damm wrote:
> From: Magnus Damm <damm@opensource.se>
> 
> Include the empty zero page data in the zImage.
> Without this patch the empty zero page may be
> uninitialized.
> 
> Signed-off-by: Magnus Damm <damm@opensource.se>
> ---
> 
>  I suppose we should have a fallback option to
>  allow boot loaders passing data in the zero page.
>  Or perhaps doing it the other way around is better.
> 
>  arch/sh/boot/compressed/Makefile |    2 --
>  arch/sh/boot/compressed/misc.c   |    2 +-
>  2 files changed, 1 insertion(+), 3 deletions(-)
> 
> --- 0001/arch/sh/boot/compressed/Makefile
> +++ work/arch/sh/boot/compressed/Makefile	2009-12-03 21:06:02.000000000 +0900
> @@ -48,8 +48,6 @@ $(obj)/vmlinux.bin.bz2: $(vmlinux.bin.al
>  $(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE
>  	$(call if_changed,lzma)
>  
> -OBJCOPYFLAGS += -R .empty_zero_page
> -
>  LDFLAGS_piggy.o := -r --format binary --oformat $(ld-bfd) -T
>  
>  $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE
> --- 0001/arch/sh/boot/compressed/misc.c
> +++ work/arch/sh/boot/compressed/misc.c	2009-12-03 21:05:58.000000000 +0900
> @@ -131,7 +131,7 @@ void decompress_kernel(void)
>  #ifdef CONFIG_SUPERH64
>  	output_addr = (CONFIG_MEMORY_START + 0x2000);
>  #else
> -	output_addr = __pa((unsigned long)&_text+PAGE_SIZE);
> +	output_addr = __pa((unsigned long)&_text);
>  #ifdef CONFIG_29BIT
>  	output_addr |= P2SEG;
>  #endif
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


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

* Re: [PATCH] sh: include empty zero page in zImage
  2009-12-03 12:26 [PATCH] sh: include empty zero page in zImage Magnus Damm
  2009-12-03 13:48 ` Stuart MENEFY
@ 2009-12-03 14:22 ` Magnus Damm
  2009-12-03 21:09 ` Paul Mundt
  2 siblings, 0 replies; 4+ messages in thread
From: Magnus Damm @ 2009-12-03 14:22 UTC (permalink / raw)
  To: linux-sh

Hi Stuart,

On Thu, Dec 3, 2009 at 8:48 AM, Stuart MENEFY <stuart.menefy@st.com> wrote:
> If you do this won't you overwrite any parameters from the boot loader?

True, so we probably want to do this in a different way.

I don't want to break anything of course, but I'm not sure if u-boot
supports passing parameters to zImages. It's not a u-boot centric
world though.

I remember adding command line passing code to kexec-tools for either
vmlinux or zImage, but I doubt that both image types are properly
supported in kexec today.

Any ideas? How are things for ST? I need to fix up romImage somehow at
least. Maybe zImage should be left alone as-is and work should be put
into fixing the boot loaders.

Cheers,

/ magnus

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

* Re: [PATCH] sh: include empty zero page in zImage
  2009-12-03 12:26 [PATCH] sh: include empty zero page in zImage Magnus Damm
  2009-12-03 13:48 ` Stuart MENEFY
  2009-12-03 14:22 ` Magnus Damm
@ 2009-12-03 21:09 ` Paul Mundt
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Mundt @ 2009-12-03 21:09 UTC (permalink / raw)
  To: linux-sh

On Thu, Dec 03, 2009 at 09:22:04AM -0500, Magnus Damm wrote:
> Hi Stuart,
> 
> On Thu, Dec 3, 2009 at 8:48 AM, Stuart MENEFY <stuart.menefy@st.com> wrote:
> > If you do this won't you overwrite any parameters from the boot loader?
> 
> True, so we probably want to do this in a different way.
> 
> I don't want to break anything of course, but I'm not sure if u-boot
> supports passing parameters to zImages. It's not a u-boot centric
> world though.
> 
> I remember adding command line passing code to kexec-tools for either
> vmlinux or zImage, but I doubt that both image types are properly
> supported in kexec today.
> 
> Any ideas? How are things for ST? I need to fix up romImage somehow at
> least. Maybe zImage should be left alone as-is and work should be put
> into fixing the boot loaders.
> 
Yes, it is the boot loader that is broken, as it doesen't comply with the
boot ABI. We will not be applying any patches to the kernel to work
around boot loader laziness. The romImage case is a special one, similar
to XIP, and that's something that the current argument passing scheme
wasn't intended for. On the other hand, you can easily do what all of the
other boot loaders do and wrap the zImage while inserting the argument
page immediately following it.

I'm quite frankly amazed at the number of patches that have shown up to
work around this "problem" in multiple ways. It's called an ABI for a
reason folks, if you don't want to support it properly, don't be
surprised when things blow up.

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

end of thread, other threads:[~2009-12-03 21:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-03 12:26 [PATCH] sh: include empty zero page in zImage Magnus Damm
2009-12-03 13:48 ` Stuart MENEFY
2009-12-03 14:22 ` Magnus Damm
2009-12-03 21:09 ` Paul Mundt

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).