From patchwork Fri Apr 22 03:23:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 726221 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3M3NSYG025033 for ; Fri, 22 Apr 2011 03:23:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754174Ab1DVDX0 (ORCPT ); Thu, 21 Apr 2011 23:23:26 -0400 Received: from mail-qw0-f46.google.com ([209.85.216.46]:40725 "EHLO mail-qw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753998Ab1DVDXZ (ORCPT ); Thu, 21 Apr 2011 23:23:25 -0400 Received: by qwk3 with SMTP id 3so136630qwk.19 for ; Thu, 21 Apr 2011 20:23:25 -0700 (PDT) Received: by 10.224.189.20 with SMTP id dc20mr506670qab.287.1303442604027; Thu, 21 Apr 2011 20:23:24 -0700 (PDT) Received: from xanadu.home (modemcable092.28-130-66.mc.videotron.ca [66.130.28.92]) by mx.google.com with ESMTPS id s9sm1796274qco.36.2011.04.21.20.23.22 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Apr 2011 20:23:23 -0700 (PDT) Date: Thu, 21 Apr 2011 23:23:22 -0400 (EDT) From: Nicolas Pitre X-X-Sender: nico@xanadu.home To: Tony Lindgren cc: Shawn Guo , linux-arm-kernel@lists.infradead.org, patches@linaro.org, Aaro Koskinen , linux-omap@vger.kernel.org Subject: Re: [PATCH] ARM: Fix relocation if image end past uncompressed kernel end In-Reply-To: Message-ID: References: <1303272904-31392-1-git-send-email-nicolas.pitre@linaro.org> <20110420072156.GA28679@atomide.com> <20110420165514.GE10402@atomide.com> <20110421055945.GB13688@atomide.com> <20110421104954.GH13688@atomide.com> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 22 Apr 2011 03:23:36 +0000 (UTC) On Thu, 21 Apr 2011, Nicolas Pitre wrote: > On Thu, 21 Apr 2011, Nicolas Pitre wrote: > > > On Thu, 21 Apr 2011, Tony Lindgren wrote: > > > > > Otherwise we end up overwriting ourselves. This fixes booting > > > on n900 after commit 6d7d0ae51574943bf571d269da3243257a2d15db > > > (ARM: 6750/1: improvements to compressed/head.S). > > > > > > Signed-off-by: Tony Lindgren > > > > I don't understand why this is needed. The copy loop is explicitly > > copying from the end going backward exactly to cope with this > > possibility. > > I think your patch is 1) unneeded (see the copy loop code and the > comment before it), and 2) simply hiding the real bug. > > I just need to modify the code in compressed/misc.c slightly for the > lzma decompressor to start or stop working randomly. It seems that this > code might be sensitive to slight displacement in memory caused by > modifications to totally unrelated code. I'm still trying to track this > down. I found the bugger. The problem was a bad stack alignment. ----- >8 From: Nicolas Pitre ARM: zImage: make sure the stack is 64-bit aligned With ARMv5+ and EABI, the compiler expects a 64-bit aligned stack so instructions like STRD and LDRD can be used. Without this, mysterious boot failures were seen semi randomly with the LZMA decompressor. While at it, let's align .bss as well. Signed-off-by: Nicolas Pitre Tested-by: Shawn Guo --- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 58ac434..79b5c62 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile @@ -74,7 +74,7 @@ ZTEXTADDR := $(CONFIG_ZBOOT_ROM_TEXT) ZBSSADDR := $(CONFIG_ZBOOT_ROM_BSS) else ZTEXTADDR := 0 -ZBSSADDR := ALIGN(4) +ZBSSADDR := ALIGN(8) endif SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/ diff --git a/arch/arm/boot/compressed/vmlinux.lds.in b/arch/arm/boot/compressed/vmlinux.lds.in index 5309909..ea80abe 100644 --- a/arch/arm/boot/compressed/vmlinux.lds.in +++ b/arch/arm/boot/compressed/vmlinux.lds.in @@ -54,6 +54,7 @@ SECTIONS .bss : { *(.bss) } _end = .; + . = ALIGN(8); /* the stack must be 64-bit aligned */ .stack : { *(.stack) } .stab 0 : { *(.stab) }