Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754683Ab1FOJ6H (ORCPT ); Wed, 15 Jun 2011 05:58:07 -0400 Received: from cantor.suse.de ([195.135.220.2]:56066 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754167Ab1FOJ6E (ORCPT ); Wed, 15 Jun 2011 05:58:04 -0400 Subject: Re: bug: kernel 3.0-rc3 not relocatable on i386? From: Petr Tesarik To: Maarten Lankhorst Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <4DF87D2B.7090201@gmail.com> References: <1308125533.4641.33.camel@nathan.suse.cz> <4DF87D2B.7090201@gmail.com> Content-Type: text/plain; charset="UTF-8" Organization: SUSE LINUX Date: Wed, 15 Jun 2011 11:58:02 +0200 Message-Id: <1308131882.4641.35.camel@nathan.suse.cz> Mime-Version: 1.0 X-Mailer: Evolution 2.24.1.1 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2508 Lines: 69 Maarten Lankhorst píše v St 15. 06. 2011 v 11:36 +0200: > Hi Petr, > > Op 15-06-11 10:12, Petr Tesarik schreef: > > 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. > > Can you try this patch? Hi Maarten, thanks for the quick replay, but no, I won't even try. It can't work, because jiffies is undefined in the final vmlinux link on 32-bit, so I believe the link will simply fail because of undefined symbols. ;) Petr > diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S > index 89aed99..49e666e 100644 > --- a/arch/x86/kernel/vmlinux.lds.S > +++ b/arch/x86/kernel/vmlinux.lds.S > @@ -34,12 +34,11 @@ OUTPUT_FORMAT(CONFIG_OUTPUT_FORMAT, CONFIG_OUTPUT_FORMAT, CONFIG_OUTPUT_FORMAT) > #ifdef CONFIG_X86_32 > OUTPUT_ARCH(i386) > ENTRY(phys_startup_32) > -jiffies = jiffies_64; > #else > OUTPUT_ARCH(i386:x86-64) > ENTRY(phys_startup_64) > -jiffies_64 = jiffies; > #endif > +jiffies_64 = jiffies; > > #if defined(CONFIG_X86_64) && defined(CONFIG_DEBUG_RODATA) > /* -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/