2013-03-17 21:49:11

by Will Deacon

[permalink] [raw]
Subject: [PATCH] alpha: makefile: don't enforce small data model for kernel builds

Due to all of the goodness being packed into today's kernels, the
resulting image isn't as slim as it once was.

In light of this, don't pass -msmall-data to the tools, which results in
link failures due to impossible relocations when compiling anything but
the most trivial configurations.

Cc: Richard Henderson <[email protected]>
Cc: Ivan Kokshaysky <[email protected]>
Cc: Matt Turner <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
---
arch/alpha/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/alpha/Makefile b/arch/alpha/Makefile
index 4759fe7..2cc3cc5 100644
--- a/arch/alpha/Makefile
+++ b/arch/alpha/Makefile
@@ -12,7 +12,7 @@ NM := $(NM) -B

LDFLAGS_vmlinux := -static -N #-relax
CHECKFLAGS += -D__alpha__ -m64
-cflags-y := -pipe -mno-fp-regs -ffixed-8 -msmall-data
+cflags-y := -pipe -mno-fp-regs -ffixed-8
cflags-y += $(call cc-option, -fno-jump-tables)

cpuflags-$(CONFIG_ALPHA_EV4) := -mcpu=ev4
--
1.8.0


2013-03-18 04:21:42

by Michael Cree

[permalink] [raw]
Subject: Re: [PATCH] alpha: makefile: don't enforce small data model for kernel builds

On 18/03/2013, at 10:48 AM, Will Deacon wrote:
> Due to all of the goodness being packed into today's kernels, the
> resulting image isn't as slim as it once was.
>
> In light of this, don't pass -msmall-data to the tools, which
> results in
> link failures due to impossible relocations when compiling anything
> but
> the most trivial configurations.

I think many of us have been using -mlarge-data when compiling with
gcc-4.6 or later so maybe it is time to get the change upstream.

The interesting thing is that the kernel still compiles fine with
gcc-4.5 and the relocation errors only appear if compiling with
gcc-4.6 or later. I had asked before on this forum what had changed
with gcc-4.6 that results in the extra usage of the small data area
but never got an answer. I am still curious to know.

BTW, the phrase "to the tools" in the commit message makes me think
immediately of the tools directory (containing perf, etc.) which is
not what is intended.

Matt: Are you able to collect up this and the other patches of Will
and get them sent to Linus?

Cheers
Michael.

2013-03-18 18:36:12

by Thorsten Kranzkowski

[permalink] [raw]
Subject: Re: [PATCH] alpha: makefile: don't enforce small data model for kernel builds

On Sun, Mar 17, 2013 at 09:48:46PM +0000, Will Deacon wrote:
> Due to all of the goodness being packed into today's kernels, the
> resulting image isn't as slim as it once was.
>
> In light of this, don't pass -msmall-data to the tools, which results in
> link failures due to impossible relocations when compiling anything but
> the most trivial configurations.

I use the same patch locally for quite some time, so

Tested-by: Thorsten Kranzkowski <[email protected]>

>
> Cc: Richard Henderson <[email protected]>
> Cc: Ivan Kokshaysky <[email protected]>
> Cc: Matt Turner <[email protected]>
> Signed-off-by: Will Deacon <[email protected]>
> ---
> arch/alpha/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/alpha/Makefile b/arch/alpha/Makefile
> index 4759fe7..2cc3cc5 100644
> --- a/arch/alpha/Makefile
> +++ b/arch/alpha/Makefile
> @@ -12,7 +12,7 @@ NM := $(NM) -B
>
> LDFLAGS_vmlinux := -static -N #-relax
> CHECKFLAGS += -D__alpha__ -m64
> -cflags-y := -pipe -mno-fp-regs -ffixed-8 -msmall-data
> +cflags-y := -pipe -mno-fp-regs -ffixed-8
> cflags-y += $(call cc-option, -fno-jump-tables)
>
> cpuflags-$(CONFIG_ALPHA_EV4) := -mcpu=ev4

--
| Thorsten Kranzkowski Internet: [email protected] |
| Mobile: ++49 170 1876134 Snail: Kiebitzstr. 14, 49324 Melle, Germany |
| Ampr: dl8bcu@db0lj.#rpl.deu.eu, [email protected] [44.130.8.19] |

2013-03-25 13:37:45

by Will Deacon

[permalink] [raw]
Subject: Re: [PATCH] alpha: makefile: don't enforce small data model for kernel builds

On Mon, Mar 18, 2013 at 04:11:15AM +0000, Michael Cree wrote:
> On 18/03/2013, at 10:48 AM, Will Deacon wrote:
> > Due to all of the goodness being packed into today's kernels, the
> > resulting image isn't as slim as it once was.
> >
> > In light of this, don't pass -msmall-data to the tools, which
> > results in
> > link failures due to impossible relocations when compiling anything
> > but
> > the most trivial configurations.
>
> I think many of us have been using -mlarge-data when compiling with
> gcc-4.6 or later so maybe it is time to get the change upstream.
>
> The interesting thing is that the kernel still compiles fine with
> gcc-4.5 and the relocation errors only appear if compiling with
> gcc-4.6 or later. I had asked before on this forum what had changed
> with gcc-4.6 that results in the extra usage of the small data area
> but never got an answer. I am still curious to know.
>
> BTW, the phrase "to the tools" in the commit message makes me think
> immediately of the tools directory (containing perf, etc.) which is
> not what is intended.
>
> Matt: Are you able to collect up this and the other patches of Will
> and get them sent to Linus?

Any news on these? I've included an updated version of the first patch, with
the Tested-by-tag and a tweaked commit message below.

Will

--->8

>From 8cbd016322bb01593795ec76cbdcbb52ac010203 Mon Sep 17 00:00:00 2001
From: Will Deacon <[email protected]>
Date: Mon, 4 Mar 2013 04:46:44 +0000
Subject: [PATCH] alpha: makefile: don't enforce small data model for kernel
builds

Due to all of the goodness being packed into today's kernels, the
resulting image isn't as slim as it once was.

In light of this, don't pass -msmall-data to gcc, which otherwise results
in link failures due to impossible relocations when compiling anything but
the most trivial configurations.

Cc: Richard Henderson <[email protected]>
Cc: Ivan Kokshaysky <[email protected]>
Cc: Matt Turner <[email protected]>
Tested-by: Thorsten Kranzkowski <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
---
arch/alpha/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/alpha/Makefile b/arch/alpha/Makefile
index 4759fe7..2cc3cc5 100644
--- a/arch/alpha/Makefile
+++ b/arch/alpha/Makefile
@@ -12,7 +12,7 @@ NM := $(NM) -B

LDFLAGS_vmlinux := -static -N #-relax
CHECKFLAGS += -D__alpha__ -m64
-cflags-y := -pipe -mno-fp-regs -ffixed-8 -msmall-data
+cflags-y := -pipe -mno-fp-regs -ffixed-8
cflags-y += $(call cc-option, -fno-jump-tables)

cpuflags-$(CONFIG_ALPHA_EV4) := -mcpu=ev4
--
1.8.0

2013-03-25 15:29:09

by Tobias Klausmann

[permalink] [raw]
Subject: Re: [PATCH] alpha: makefile: don't enforce small data model for kernel builds

Hi!

On Mon, 25 Mar 2013, Will Deacon wrote:
> Any news on these? I've included an updated version of the first patch, with
> the Tested-by-tag and a tweaked commit message below.

As a data point, I tried vanilla 3.8.4 on the weekend. With my
usual config on a UP1500, it will fail at build time with
relocation errors. If I remove -msmall-data (or replace it with
~big~), the machine hangs hard immediatly after aboot telling me
it's starting it. I'll take a closer look later today, but there
seems to be a very fundamental thing wrong with the startup code
in these scenarios.

Regards,
Tobias

--
"Brain, konban wa nani o shimashitai?"
"Your Japanese is terrible, Pinky."

2013-03-25 20:07:01

by Michael Cree

[permalink] [raw]
Subject: Re: [PATCH] alpha: makefile: don't enforce small data model for kernel builds

On 26/03/2013, at 4:09 AM, Tobias Klausmann wrote:
> On Mon, 25 Mar 2013, Will Deacon wrote:
>> Any news on these? I've included an updated version of the first
>> patch, with
>> the Tested-by-tag and a tweaked commit message below.
>
> As a data point, I tried vanilla 3.8.4 on the weekend. With my
> usual config on a UP1500, it will fail at build time with
> relocation errors. If I remove -msmall-data (or replace it with
> ~big~), the machine hangs hard immediatly after aboot telling me
> it's starting it.

You probably want the "alpha: Add irongate_io to to PCI bus resources"
patch posted by Matt Turner in the linux-alpha forum. Looks like it
has not been sent to Linus.

If Matt does not respond in the next day or two I'll collect patches
and send them on to Linus.

Cheers
Michael.


2013-03-25 20:55:53

by Matt Turner

[permalink] [raw]
Subject: Re: [PATCH] alpha: makefile: don't enforce small data model for kernel builds

On Mon, Mar 25, 2013 at 1:06 PM, Michael Cree <[email protected]> wrote:
> On 26/03/2013, at 4:09 AM, Tobias Klausmann wrote:
>>
>> On Mon, 25 Mar 2013, Will Deacon wrote:
>>>
>>> Any news on these? I've included an updated version of the first patch,
>>> with
>>> the Tested-by-tag and a tweaked commit message below.
>>
>>
>> As a data point, I tried vanilla 3.8.4 on the weekend. With my
>> usual config on a UP1500, it will fail at build time with
>> relocation errors. If I remove -msmall-data (or replace it with
>> ~big~), the machine hangs hard immediatly after aboot telling me
>> it's starting it.
>
>
> You probably want the "alpha: Add irongate_io to to PCI bus resources" patch
> posted by Matt Turner in the linux-alpha forum. Looks like it has not been
> sent to Linus.
>
> If Matt does not respond in the next day or two I'll collect patches and
> send them on to Linus.

Yes, please do. I haven't powered on an alpha in a few months.

Matt

2013-03-26 01:52:48

by Rob Landley

[permalink] [raw]
Subject: Re: [PATCH] alpha: makefile: don't enforce small data model for kernel builds

On 03/25/2013 03:55:28 PM, Matt Turner wrote:
> On Mon, Mar 25, 2013 at 1:06 PM, Michael Cree <[email protected]>
> wrote:
> > On 26/03/2013, at 4:09 AM, Tobias Klausmann wrote:
> >>
> >> On Mon, 25 Mar 2013, Will Deacon wrote:
> >>>
> >>> Any news on these? I've included an updated version of the first
> patch,
> >>> with
> >>> the Tested-by-tag and a tweaked commit message below.
> >>
> >>
> >> As a data point, I tried vanilla 3.8.4 on the weekend. With my
> >> usual config on a UP1500, it will fail at build time with
> >> relocation errors. If I remove -msmall-data (or replace it with
> >> ~big~), the machine hangs hard immediatly after aboot telling me
> >> it's starting it.
> >
> >
> > You probably want the "alpha: Add irongate_io to to PCI bus
> resources" patch
> > posted by Matt Turner in the linux-alpha forum. Looks like it has
> not been
> > sent to Linus.
> >
> > If Matt does not respond in the next day or two I'll collect
> patches and
> > send them on to Linus.
>
> Yes, please do. I haven't powered on an alpha in a few months.

What would it take to add Alpha system support to qemu? (It's got
userspace, but not the system management mode instructions, mmu, or a
board emulation.)

Rob-

2013-03-27 17:56:40

by Tobias Klausmann

[permalink] [raw]
Subject: Re: [PATCH] alpha: makefile: don't enforce small data model for kernel builds

Hi!

On Tue, 26 Mar 2013, Michael Cree wrote:

> On 26/03/2013, at 4:09 AM, Tobias Klausmann wrote:
> > On Mon, 25 Mar 2013, Will Deacon wrote:
> >> Any news on these? I've included an updated version of the first
> >> patch, with
> >> the Tested-by-tag and a tweaked commit message below.
> >
> > As a data point, I tried vanilla 3.8.4 on the weekend. With my
> > usual config on a UP1500, it will fail at build time with
> > relocation errors. If I remove -msmall-data (or replace it with
> > ~big~), the machine hangs hard immediatly after aboot telling me
> > it's starting it.
>
> You probably want the "alpha: Add irongate_io to to PCI bus resources"
> patch posted by Matt Turner in the linux-alpha forum. Looks like it
> has not been sent to Linus.

Tried that, same effect. Interestingly, rebooting without a full
init cycle crashes differently:

aboot: loading uncompressed vmlinuz-3.8.4...
aboot: loading compressed vmlinuz-3.8.4...
aboot: PHDR 0 vaddr 0xfffffc0000310000 offset 0x100 size 0x59e4ac
aboot: bss at 0xfffffc00008ae4ac, size 0x1814dc
aboot: zero-filling 1578204 bytes at 0xfffffc00008ae4ac
aboot: starting kernel vmlinuz-3.8.4 with arguments root=/dev/md0 console=tty1 console=ttyS0 rootfstype=ext4

halted CPU 0

halt code = 5
HALT instruction executed
PC = fffffc00008b4e40
IrqVectorSet 60
Adding Vector ffffffe0 b
impure halt code 5
>>>

Without the irongate patch, the same (HALT on soft reboot, hard
crash on full init) happens.

Any hints on making the whole thing more debuggable are
appreciated.

Regards,
Tobias


--
One of the main causes of the fall of the roman empire was that, lacking zero,
they had no way to indicate successful termination of their C programs.

2013-03-28 10:25:15

by Tobias Klausmann

[permalink] [raw]
Subject: Re: [PATCH] alpha: makefile: don't enforce small data model for kernel builds

Hi!

On a whim, I tried fiddling with ALPHA_LEGACY_START_ADDRESS.
While this necessitates switching the system type to
GENERIC_ALPHA, it makes the whole thing work. I suspect the
change in segment size shifted stuff around enough to make the
DP264 layout a "legacy" one.

Regards,
Tobias


--
Sent from aboard the Culture ship
ROU (Killer-class) Trade Surplus

2013-04-03 18:03:18

by Will Deacon

[permalink] [raw]
Subject: Re: [PATCH] alpha: makefile: don't enforce small data model for kernel builds

Hi guys,

On Mon, Mar 18, 2013 at 04:11:15AM +0000, Michael Cree wrote:
> On 18/03/2013, at 10:48 AM, Will Deacon wrote:
> > Due to all of the goodness being packed into today's kernels, the
> > resulting image isn't as slim as it once was.
> >
> > In light of this, don't pass -msmall-data to the tools, which
> > results in
> > link failures due to impossible relocations when compiling anything
> > but
> > the most trivial configurations.
>
> I think many of us have been using -mlarge-data when compiling with
> gcc-4.6 or later so maybe it is time to get the change upstream.
>
> The interesting thing is that the kernel still compiles fine with
> gcc-4.5 and the relocation errors only appear if compiling with
> gcc-4.6 or later. I had asked before on this forum what had changed
> with gcc-4.6 that results in the extra usage of the small data area
> but never got an answer. I am still curious to know.
>
> BTW, the phrase "to the tools" in the commit message makes me think
> immediately of the tools directory (containing perf, etc.) which is
> not what is intended.
>
> Matt: Are you able to collect up this and the other patches of Will
> and get them sent to Linus?

I noticed Matt agreed to this, but I was dropped from CC:

https://lkml.org/lkml/2013/3/25/486

Any chance you could send the patches on please?

Thanks,

Will