public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Alok Kataria <akataria@vmware.com>
Cc: Yinghai Lu <yinghai@kernel.org>,
	the arch/x86 maintainers <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [BUGFIX/x86] Fix initialization of wakeup_cpu.
Date: Wed, 11 Feb 2009 11:25:34 +0100	[thread overview]
Message-ID: <20090211102534.GA9976@elte.hu> (raw)
In-Reply-To: <20090211094858.GB20518@elte.hu>


* Ingo Molnar <mingo@elte.hu> wrote:

> 
> * Ingo Molnar <mingo@elte.hu> wrote:
> 
> > 
> > * Alok Kataria <akataria@vmware.com> wrote:
> > 
> > > On Tue, 2009-02-10 at 16:31 -0800, Yinghai Lu wrote:
> > > > > 
> > > > >> 2. also will break 64 bit....
> > > > > isn't the default_x86_quirks defined for 64 bit too ? 
> > > > > 
> > > > 64 bit doesn't have genapic_apic_probe()
> > > > 
> > > > need to change that to 
> > > > #ifdef CONFIG_X86_32
> > > > 	genapic_apic_probe();
> > > > #endif
> > > > 
> > > 
> > > Ok here it is. 
> > > --
> > > 
> > > With refactoring of wake_cpu macros the 32bit code in tip doesn't 
> > > execute generic_apic_probe if CONFIG_X86_32_NON_STANDARD is not set.
> > > 
> > > Even on a x86 STANDARD cpu we need to execute the generic_apic_probe
> > > function, as we rely on this function to execute the update_genapic
> > > quirk which initilizes apic->wakeup_cpu. 
> > > 
> > > Failing to do so results in we making a call to a null function in do_boot_cpu.
> > > 
> > > The stack trace without the patch goes like this.
> > > 
> > > Booting processor 1 APIC 0x1 ip 0x6000
> > > BUG: unable to handle kernel NULL pointer dereference at (null)
> > > IP: [<(null)>] (null)
> > > *pdpt = 0000000000839001 *pde = 0000000000c97067 *pte = 0000000000000163 
> > > Oops: 0000 [#1] SMP 
> > > last sysfs file: 
> > > Modules linked in:
> > > 
> > > Pid: 1, comm: swapper Not tainted (2.6.29-rc4-tip #18) VMware Virtual Platform
> > > EIP: 0062:[<00000000>] EFLAGS: 00010293 CPU: 0
> > > EIP is at 0x0
> > > EAX: 00000001 EBX: 00006000 ECX: c077ed00 EDX: 00006000
> > > ESI: 00000001 EDI: 00000001 EBP: ef04cf40 ESP: ef04cf1c
> > >  DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 006a
> > > Process swapper (pid: 1, ti=ef04c000 task=ef050000 task.ti=ef04c000)
> > > Stack:
> > >  c0644e52 00000000 ef04cf24 ef04cf24 c064468d c0886dc0 00000000 c0702aea
> > >  ef055480 00000001 00000101 dead4ead ffffffff ffffffff c08af530 00000000
> > >  c0709715 ef04cf60 ef04cf60 00000001 00000000 00000000 dead4ead ffffffff
> > > Call Trace:
> > >  [<c0644e52>] ? native_cpu_up+0x2de/0x45b
> > >  [<c064468d>] ? do_fork_idle+0x0/0x19
> > >  [<c0645c5e>] ? _cpu_up+0x88/0xe8
> > >  [<c0645d20>] ? cpu_up+0x42/0x4e
> > >  [<c07e7462>] ? kernel_init+0x99/0x14b
> > >  [<c07e73c9>] ? kernel_init+0x0/0x14b
> > >  [<c040375f>] ? kernel_thread_helper+0x7/0x10
> > > Code:  Bad EIP value.
> > > EIP: [<00000000>] 0x0 SS:ESP 006a:ef04cf1c
> > > 
> > > I think we should call generic_apic_probe unconditionally for 32 bit now.
> > > 
> > > Signed-off-by: Alok N Kataria <akataria@vmware.com>
> > > Cc: Yinghai Lu <yinghai@kernel.org>
> > > 
> > > Index: linux-tip-master/arch/x86/kernel/setup.c
> > > ===================================================================
> > > --- linux-tip-master.orig/arch/x86/kernel/setup.c	2009-02-10 12:05:18.000000000 -0800
> > > +++ linux-tip-master/arch/x86/kernel/setup.c	2009-02-10 16:37:59.000000000 -0800
> > > @@ -936,7 +936,7 @@
> > >  	map_vsyscall();
> > >  #endif
> > >  
> > > -#if defined(CONFIG_X86_32_NON_STANDARD) || defined(CONFIG_X86_BIGSMP)
> > > +#ifdef CONFIG_X86_32
> > >  	generic_apic_probe();
> > >  #endif
> > 
> > Please extend 64-bit with generic_apic_probe() instead. (and please also
> > make sure your patches build on a 64-bit defconfig)
> 
> I've applied your patch as an interim measure so far, to fix the crash,
> so please do the cleaner patch ontop of your first patch. Thanks,

I removed it again. generic_apic_probe() is not always available on 32-bit either.

	Ingo

  reply	other threads:[~2009-02-11 10:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-10 20:28 [BUGFIX/x86] Fix initialization of wakeup_cpu Alok Kataria
2009-02-10 21:03 ` Yinghai Lu
2009-02-10 22:00   ` Alok Kataria
2009-02-11  0:31     ` Yinghai Lu
2009-02-11  0:45       ` Alok Kataria
2009-02-11  9:46         ` Ingo Molnar
2009-02-11  9:48           ` Ingo Molnar
2009-02-11 10:25             ` Ingo Molnar [this message]
2009-02-11 10:29               ` [PATCH] x86, apic: make generic_apic_probe() generally available Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090211102534.GA9976@elte.hu \
    --to=mingo@elte.hu \
    --cc=akataria@vmware.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.org \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox