* [PATCH] Fix ARM PIC problems with new decompressor code
[not found] ` <4B87907B.7080008@knaff.lu>
@ 2010-02-28 15:49 ` Russell King
2010-03-02 22:43 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: Russell King @ 2010-02-28 15:49 UTC (permalink / raw)
To: Alain Knaff; +Cc: Andrew Morton, linux-arch
On Fri, Feb 26, 2010 at 10:12:27AM +0100, Alain Knaff wrote:
> Yes, that should be fine. So it would be static in full kernel context
> (initrd decompression) but global in preboot. As long as it doesn't clash
> with other variables of the same name, but I think that's rather unlikely
> in the "small" preboot environment.
Here's a patch to this end. I decided to change the name of the
define to something more sensible.
Are we happy with this? Shall I queue it for merging? I'd be nice
to get this into -stable as well as some other fixes for this feature.
Subject: Fix new decompressor for PIC
The ARM kernel decompressor wants to be able to relocate r/w data
independently from the rest of the image, and we do this by ensuring
that r/w data has global visibility. Define STATIC_RW_DATA to be
empty to achieve this.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
--
include/linux/decompress/mm.h | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/include/linux/decompress/mm.h b/include/linux/decompress/mm.h
index 5032b9a..278e6c8 100644
--- a/include/linux/decompress/mm.h
+++ b/include/linux/decompress/mm.h
@@ -14,11 +14,21 @@
/* Code active when included from pre-boot environment: */
+/*
+ * Some architectures want to ensure there is no local data in their
+ * pre-boot environment, so that data can arbitarily relocated (via
+ * GOT references). This is achieved by defining STATIC_RW_DATA to
+ * be null.
+ */
+#ifndef STATIC_RW_DATA
+#define STATIC_RW_DATA static
+#endif
+
/* A trivial malloc implementation, adapted from
* malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
*/
-static unsigned long malloc_ptr;
-static int malloc_count;
+STATIC_RW_DATA unsigned long malloc_ptr;
+STATIC_RW_DATA int malloc_count;
static void *malloc(int size)
{
--
Russell King
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix ARM PIC problems with new decompressor code
2010-02-28 15:49 ` [PATCH] Fix ARM PIC problems with new decompressor code Russell King
@ 2010-03-02 22:43 ` Andrew Morton
2010-03-02 22:53 ` Russell King
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2010-03-02 22:43 UTC (permalink / raw)
To: Russell King; +Cc: Alain Knaff, linux-arch
On Sun, 28 Feb 2010 15:49:08 +0000
Russell King <rmk@arm.linux.org.uk> wrote:
> On Fri, Feb 26, 2010 at 10:12:27AM +0100, Alain Knaff wrote:
> > Yes, that should be fine. So it would be static in full kernel context
> > (initrd decompression) but global in preboot. As long as it doesn't clash
> > with other variables of the same name, but I think that's rather unlikely
> > in the "small" preboot environment.
>
> Here's a patch to this end. I decided to change the name of the
> define to something more sensible.
>
> Are we happy with this? Shall I queue it for merging?
I grabbed it, but you can preempt that by merging it if that's more
convenient.
> I'd be nice
> to get this into -stable as well as some other fixes for this feature.
>
I don't think I've seen any other fixes.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix ARM PIC problems with new decompressor code
2010-03-02 22:43 ` Andrew Morton
@ 2010-03-02 22:53 ` Russell King
0 siblings, 0 replies; 3+ messages in thread
From: Russell King @ 2010-03-02 22:53 UTC (permalink / raw)
To: Andrew Morton; +Cc: Alain Knaff, linux-arch
On Tue, Mar 02, 2010 at 02:43:04PM -0800, Andrew Morton wrote:
> On Sun, 28 Feb 2010 15:49:08 +0000
> Russell King <rmk@arm.linux.org.uk> wrote:
>
> > On Fri, Feb 26, 2010 at 10:12:27AM +0100, Alain Knaff wrote:
> > > Yes, that should be fine. So it would be static in full kernel context
> > > (initrd decompression) but global in preboot. As long as it doesn't clash
> > > with other variables of the same name, but I think that's rather unlikely
> > > in the "small" preboot environment.
> >
> > Here's a patch to this end. I decided to change the name of the
> > define to something more sensible.
> >
> > Are we happy with this? Shall I queue it for merging?
>
> I grabbed it, but you can preempt that by merging it if that's more
> convenient.
Thanks.
> > I'd be nice
> > to get this into -stable as well as some other fixes for this feature.
> >
>
> I don't think I've seen any other fixes.
There's one other in my tree on the same subject in the master branch,
but it's ARM specific.
I'll need an additional patch to define this new STATIC_RW_DATA, so it
probably makes sense for me to collect up all three patches. Main reason
was to let you see it and check that it passes your taste test. ;)
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-03-02 22:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20100226081926.GA3511@flint.arm.linux.org.uk>
[not found] ` <4B87907B.7080008@knaff.lu>
2010-02-28 15:49 ` [PATCH] Fix ARM PIC problems with new decompressor code Russell King
2010-03-02 22:43 ` Andrew Morton
2010-03-02 22:53 ` Russell King
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).