linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: hector@marcansoft.com (Hector Martin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] Clean up ARM compressed loader
Date: Wed, 24 Feb 2010 10:27:18 +0100	[thread overview]
Message-ID: <4B84F0F6.40902@marcansoft.com> (raw)
In-Reply-To: <20100224084259.GA8068@pengutronix.de>

Uwe Kleine-K?nig wrote:
> Hello
> 
> [expanded Cc:]
> 
> On Tue, Feb 23, 2010 at 02:57:17PM +0100, hector at marcansoft.com wrote:
>> From: Hector Martin <hector@marcansoft.com>
>>
>> The -Dstatic= stuff in the Makefile is a hack and subtly breaks the
>> current inflate implementation, because the fixed inflate tables are
>> included into a function and removing static places them in the stack,
> Maybe this is the problem that people see after e7db7b4270?  Is this the
> final hint that we should revert that one?

Quite likely it is this same issue. The switch to the other inflate
implementation is probably what introduced the breakage. However,
e7db7b4270 itself is perfectly fine. The problem has been lurking all
along in the -Dstatic= thing, and that would've caused issues with
several perfectly valid C constructs in the kernel lib/inflate stuff.

I can also 'fix' the issue with a two-line patch to the new deflate
code, but that's not a proper solution, just an ugly workaround. I don't
think restricting the inflate code to a weird subset of C due to ARM
peculiarities is a good idea.

This can also break with GCC updates - the current code depends on
unspecified behavior of the compiler. Essentially, the split relocation
is something that is not allowed nor expected by the compiler, and
-Dstatic= is a crude hack to attempt to modify code so it doesn't
trigger the cases where the hack breaks down. But it doesn't work, and
breaks legitimate code. Even worse, the bugs it introduces can be subtle
heisenbugs, as was the case here - I spent two afternoons tracking it
down through the bowels of inflate and comparing the output vs. an x86
build. In a worst-case scenario, the bug could've caused corrupted
kernel output (not just a flat-out hang or crash while uncompressing),
which would've been so much fun to debug (*cough*).

-- 
Hector Martin (hector at marcansoft.com)
Public Key: http://www.marcansoft.com/marcan.asc

  reply	other threads:[~2010-02-24  9:27 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-23 13:57 [PATCH] Clean up ARM compressed loader hector at marcansoft.com
2010-02-23 14:07 ` Russell King - ARM Linux
2010-02-24  8:42 ` Uwe Kleine-König
2010-02-24  9:27   ` Hector Martin [this message]
2010-02-24 11:03     ` Russell King - ARM Linux
2010-02-24 15:20       ` Hector Martin
2010-02-24 15:30         ` Uwe Kleine-König
2010-02-24 22:09           ` Hector Martin
2010-02-24 22:30             ` Russell King - ARM Linux
2010-02-25  0:01               ` Hector Martin
2010-02-24 16:29         ` Russell King - ARM Linux
  -- strict thread matches above, loose matches on Subject: below --
2010-02-24  2:23 Hector Martin
2010-02-24  8:51 ` Uwe Kleine-König
2010-02-24  9:28   ` Hector Martin
2010-02-24 22:34 ` Russell King - ARM Linux
2010-02-24 23:34   ` Nicolas Pitre
2010-02-24 23:42     ` Russell King - ARM Linux
2010-02-24 23:57       ` Hector Martin
2010-02-25  0:01         ` Russell King - ARM Linux
2010-02-25  0:30           ` Hector Martin
2010-02-25  4:28             ` Nicolas Pitre
2010-02-25  4:33               ` Nicolas Pitre
2010-02-25  9:38               ` Russell King - ARM Linux
2010-02-25 10:05                 ` Hector Martin
2010-02-25 18:35                   ` Nicolas Pitre
2010-02-25 19:21                     ` Hector Martin
2010-02-25 19:40                       ` Nicolas Pitre
2010-02-25 19:56                         ` Hector Martin
2010-02-25 20:29                           ` Nicolas Pitre
2010-02-25 21:05                             ` Russell King - ARM Linux
2010-02-25 21:25                               ` Nicolas Pitre
2010-02-25 20:30                         ` Russell King - ARM Linux
2010-02-25 12:24                 ` Russell King - ARM Linux
2010-02-25 19:24                   ` Nicolas Pitre
2010-02-25 19:34                     ` Russell King - ARM Linux
2010-02-25 23:48                     ` Russell King - ARM Linux
2010-02-25 23:55                       ` Russell King - ARM Linux
2010-02-25  9:51               ` Hector Martin
2010-02-25 18:30                 ` Nicolas Pitre
2010-02-25  8:23             ` Russell King - ARM Linux
2010-02-25  4:06         ` Nicolas Pitre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B84F0F6.40902@marcansoft.com \
    --to=hector@marcansoft.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).