All of lore.kernel.org
 help / color / mirror / Atom feed
* bug: kernel 3.0-rc3 not relocatable on i386?
@ 2011-06-15  8:12 Petr Tesarik
  2011-06-15  9:21 ` Maarten Lankhorst
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Petr Tesarik @ 2011-06-15  8:12 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86; +Cc: linux-kernel

Hi all,

it seems that the 3.0-rc3 kernel is not relocatable on i386. I get
warnings about jiffies being an absolute symbol, and indeed, when GRUB
loads the kernel at a non-default address, jiffies is not relocated.

In my example the kernel is configured with
CONFIG_PHYSICAL_START=0x1000000
CONFIG_PHYSICAL_ALIGN=0x200000
CONFIG_RELOCATABLE=y
and loaded at 0x200000 by GRUB.

Booting fails when checking whether the timer works, because do_timer()
increments jiffies_64, but timer_irq_works() checks jiffies. The code
looks like this:

c13daab7:       8b 3d 40 7a 39 c1       mov    0xc1397a40,%edi

but arch/x86/boot/compressed/vmlinux.relocs does not contain c13daaba.
Consequently, timer_irq_works() reads the wrong memory location and
fails, causing a panic:

kernel panic: IO-APIC + timer doesn't work! Boot with apic=debug and
send a report.  Then try booting with the 'noapic' option.

Needless to say, the kernel freezes a few initcalls later when booted
with noapic, because IO-APIC worked fine, in fact. I verified that by
inserting a debugging printk() in do_timer(), and I also verified with
that printk() that the address of jiffies_64 and the address of jiffies
differ at run time.

Any idea how to fix this?

Petr Tesarik


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

end of thread, other threads:[~2011-06-15 12:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-15  8:12 bug: kernel 3.0-rc3 not relocatable on i386? Petr Tesarik
2011-06-15  9:21 ` Maarten Lankhorst
2011-06-15 10:01   ` Petr Tesarik
2011-06-15 10:07     ` Petr Tesarik
2011-06-15 10:28       ` Maarten Lankhorst
2011-06-15 12:26       ` Petr Tesarik
2011-06-15  9:36 ` Maarten Lankhorst
2011-06-15  9:58   ` Petr Tesarik
2011-06-15 11:17 ` Andrew Lutomirski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.