public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* v2.6.28-rc2: x86_32 relocation regression?
@ 2008-11-24 21:19 Vegard Nossum
  2008-11-25  1:30 ` Huang Ying
  0 siblings, 1 reply; 4+ messages in thread
From: Vegard Nossum @ 2008-11-24 21:19 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Huang Ying, H. Peter Anvin

Hi,

I couldn't help noticing that addr2line no longer works for me since
at least v2.6.28-rc2. I get this:

EIP: 0060:[<c039e613>] EFLAGS: 00000202 CPU: 0
EIP is at strcpy+0x13/0x30

    $ addr2line -e vmlinux -i c039e613
    ??:0

...even though the kernel was configured with CONFIG_DEBUG_INFO=y.

    $ grep DEBUG_INFO .config
    CONFIG_DEBUG_INFO=y

gdb too:

    (gdb) disas 0xc039e613
    No function contains specified address.

This is a simple x86_32 defconfig with CONFIG_DEBUG_INFO toggled.

    $ nm vmlinux | grep strcpy
    c12a3b90 t scsi_strcpy_devinfo
    c119e600 T strcpy

It looks like everything was offset by 0xe00000:

    $ addr2line -e vmlinux c119e613
    arch/x86/lib/string_32.c:20

I have also this:

 virtual kernel memory layout:
     fixmap  : 0xffc79000 - 0xfffff000   (3608 kB)
     pkmap   : 0xff400000 - 0xff800000   (4096 kB)
     vmalloc : 0xc87f0000 - 0xff3fe000   ( 876 MB)
     lowmem  : 0xc0000000 - 0xc7ff0000   ( 127 MB)
       .init : 0xc08ce000 - 0xc0932000   ( 400 kB)
       .data : 0xc06c9a4b - 0xc08c46ec   (2027 kB)
       .text : 0xc0200000 - 0xc06c9a4b   (4902 kB)

Any ideas?

Thanks,


Vegard

-- 
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
	-- E. W. Dijkstra, EWD1036

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

* Re: v2.6.28-rc2: x86_32 relocation regression?
  2008-11-24 21:19 v2.6.28-rc2: x86_32 relocation regression? Vegard Nossum
@ 2008-11-25  1:30 ` Huang Ying
  2008-11-25 10:07   ` Vegard Nossum
  0 siblings, 1 reply; 4+ messages in thread
From: Huang Ying @ 2008-11-25  1:30 UTC (permalink / raw)
  To: Vegard Nossum; +Cc: Linux Kernel Mailing List, H. Peter Anvin

[-- Attachment #1: Type: text/plain, Size: 737 bytes --]

Hi, Vegard,

On Tue, 2008-11-25 at 05:19 +0800, Vegard Nossum wrote:
[...]
> It looks like everything was offset by 0xe00000:
> 
>     $ addr2line -e vmlinux c119e613
>     arch/x86/lib/string_32.c:20

Because relocation is supported in recent Linux kernel, it is possible
that the run-time address is different with compile-time address. In
most cases, the kernel will be loaded into 0x100000 during boot, so the
kernel run-time address range from 0xc0100000 on. But it seems that your
kernel compile-time address range from 0xc0f00000 on. Please check
CONFIG_PHYSICAL_START in your .config. In most cases, it will be set to
0x100000, so that it is same as run-time address in most cases.

Best Regards,
Huang Ying


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: v2.6.28-rc2: x86_32 relocation regression?
  2008-11-25  1:30 ` Huang Ying
@ 2008-11-25 10:07   ` Vegard Nossum
  2008-11-25 17:31     ` H. Peter Anvin
  0 siblings, 1 reply; 4+ messages in thread
From: Vegard Nossum @ 2008-11-25 10:07 UTC (permalink / raw)
  To: Huang Ying, Ingo Molnar; +Cc: Linux Kernel Mailing List, H. Peter Anvin

On Tue, Nov 25, 2008 at 2:30 AM, Huang Ying <ying.huang@intel.com> wrote:
> Hi, Vegard,
>
> On Tue, 2008-11-25 at 05:19 +0800, Vegard Nossum wrote:
> [...]
>> It looks like everything was offset by 0xe00000:
>>
>>     $ addr2line -e vmlinux c119e613
>>     arch/x86/lib/string_32.c:20
>
> Because relocation is supported in recent Linux kernel, it is possible
> that the run-time address is different with compile-time address. In
> most cases, the kernel will be loaded into 0x100000 during boot, so the
> kernel run-time address range from 0xc0100000 on. But it seems that your
> kernel compile-time address range from 0xc0f00000 on. Please check
> CONFIG_PHYSICAL_START in your .config. In most cases, it will be set to
> 0x100000, so that it is same as run-time address in most cases.

Thanks!

It seems to be caused by this commit:

commit 5cb04df8d3f03e37a19f2502591a84156be71772
Author: Ingo Molnar <mingo@elte.hu>
Date:   Sun May 4 19:49:04 2008 +0200

    x86: defconfig updates

-CONFIG_PHYSICAL_START=0x100000
-# CONFIG_RELOCATABLE is not set
-CONFIG_PHYSICAL_ALIGN=0x100000
...
+CONFIG_PHYSICAL_START=0x1000000
+CONFIG_RELOCATABLE=y
+CONFIG_PHYSICAL_ALIGN=0x200000

Were all changes intentional?


Vegard

-- 
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
	-- E. W. Dijkstra, EWD1036

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

* Re: v2.6.28-rc2: x86_32 relocation regression?
  2008-11-25 10:07   ` Vegard Nossum
@ 2008-11-25 17:31     ` H. Peter Anvin
  0 siblings, 0 replies; 4+ messages in thread
From: H. Peter Anvin @ 2008-11-25 17:31 UTC (permalink / raw)
  To: Vegard Nossum; +Cc: Huang Ying, Ingo Molnar, Linux Kernel Mailing List

Vegard Nossum wrote:
> 
> Thanks!
> 
> It seems to be caused by this commit:
> 
> commit 5cb04df8d3f03e37a19f2502591a84156be71772
> Author: Ingo Molnar <mingo@elte.hu>
> Date:   Sun May 4 19:49:04 2008 +0200
> 
>     x86: defconfig updates
> 
> -CONFIG_PHYSICAL_START=0x100000
> -# CONFIG_RELOCATABLE is not set
> -CONFIG_PHYSICAL_ALIGN=0x100000
> ...
> +CONFIG_PHYSICAL_START=0x1000000
> +CONFIG_RELOCATABLE=y
> +CONFIG_PHYSICAL_ALIGN=0x200000
> 
> Were all changes intentional?
> 

Yes, but it's unacceptable that a relocatable kernel *NOT RELOCATED BY
THE BOOTLOADER* ends up with the debug information incorrect.  That is a
bug, plain and simple, and needs to be fixed.

	-hpa

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

end of thread, other threads:[~2008-11-25 17:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-24 21:19 v2.6.28-rc2: x86_32 relocation regression? Vegard Nossum
2008-11-25  1:30 ` Huang Ying
2008-11-25 10:07   ` Vegard Nossum
2008-11-25 17:31     ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox