public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: avoid early crash in disable_local_APIC()
@ 2009-01-14 12:28 Jan Beulich
  2009-01-15 11:05 ` Ingo Molnar
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Beulich @ 2009-01-14 12:28 UTC (permalink / raw)
  To: mingo, tglx, hpa; +Cc: linux-kernel

E.g. when called due to an early panic.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

---
 arch/x86/kernel/apic.c |    4 ++++
 1 file changed, 4 insertions(+)

--- linux-2.6.29-rc1/arch/x86/kernel/apic.c	2009-01-14 11:36:05.000000000 +0100
+++ 2.6.29-rc1-x86-early-disable-lapic/arch/x86/kernel/apic.c	2009-01-06 16:51:35.000000000 +0100
@@ -894,6 +894,10 @@ void disable_local_APIC(void)
 {
 	unsigned int value;
 
+	/* APIC hasn't been mapped yet */
+	if (!apic_phys)
+		return;
+
 	clear_local_APIC();
 
 	/*




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

* Re: [PATCH] x86: avoid early crash in disable_local_APIC()
  2009-01-14 12:28 [PATCH] x86: avoid early crash in disable_local_APIC() Jan Beulich
@ 2009-01-15 11:05 ` Ingo Molnar
  2009-01-15 22:47   ` Ingo Molnar
  0 siblings, 1 reply; 7+ messages in thread
From: Ingo Molnar @ 2009-01-15 11:05 UTC (permalink / raw)
  To: Jan Beulich; +Cc: tglx, hpa, linux-kernel


* Jan Beulich <jbeulich@novell.com> wrote:

> E.g. when called due to an early panic.
> 
> Signed-off-by: Jan Beulich <jbeulich@novell.com>
> 
> ---
>  arch/x86/kernel/apic.c |    4 ++++
>  1 file changed, 4 insertions(+)

applied to tip/x86/urgent, thanks!

	Ingo

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

* Re: [PATCH] x86: avoid early crash in disable_local_APIC()
  2009-01-15 11:05 ` Ingo Molnar
@ 2009-01-15 22:47   ` Ingo Molnar
  2009-01-15 22:47     ` Ingo Molnar
  0 siblings, 1 reply; 7+ messages in thread
From: Ingo Molnar @ 2009-01-15 22:47 UTC (permalink / raw)
  To: Jan Beulich; +Cc: tglx, hpa, linux-kernel


hm, this gives a build failure on latest -tip:

arch/x86/kernel/apic.c: In function 'setup_local_APIC':
arch/x86/kernel/apic.c:1135: error: implicit declaration of function 'disable_ioapic_setup'

	Ingo

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

* Re: [PATCH] x86: avoid early crash in disable_local_APIC()
  2009-01-15 22:47   ` Ingo Molnar
@ 2009-01-15 22:47     ` Ingo Molnar
  2009-01-16  8:22       ` Jan Beulich
  0 siblings, 1 reply; 7+ messages in thread
From: Ingo Molnar @ 2009-01-15 22:47 UTC (permalink / raw)
  To: Jan Beulich; +Cc: tglx, hpa, linux-kernel


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

> hm, this gives a build failure on latest -tip:
> 
> arch/x86/kernel/apic.c: In function 'setup_local_APIC':
> arch/x86/kernel/apic.c:1135: error: implicit declaration of function 'disable_ioapic_setup'

i mean this one caused it:

commit f11826385b63566d98c02d35f592232ee77cd791
Author: Jan Beulich <jbeulich@novell.com>
Date:   Wed Jan 14 12:27:35 2009 +0000

    x86: fully honor "nolapic"

	Ingo

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

* Re: [PATCH] x86: avoid early crash in disable_local_APIC()
  2009-01-15 22:47     ` Ingo Molnar
@ 2009-01-16  8:22       ` Jan Beulich
  2009-01-16 13:09         ` Ingo Molnar
  2009-01-16 21:26         ` Maciej W. Rozycki
  0 siblings, 2 replies; 7+ messages in thread
From: Jan Beulich @ 2009-01-16  8:22 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: tglx, linux-kernel, hpa

>>> Ingo Molnar <mingo@elte.hu> 15.01.09 23:47 >>>
>
>* Ingo Molnar <mingo@elte.hu> wrote:
>
>> hm, this gives a build failure on latest -tip:
>> 
>> arch/x86/kernel/apic.c: In function 'setup_local_APIC':
>> arch/x86/kernel/apic.c:1135: error: implicit declaration of function 'disable_ioapic_setup'

Is this with a config that has X86_IO_APIC off (i.e. one the practical use of
which I never understood, and hence easily forget to consider)? Otherwise
I can't see how that could happen.

Jan


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

* Re: [PATCH] x86: avoid early crash in disable_local_APIC()
  2009-01-16  8:22       ` Jan Beulich
@ 2009-01-16 13:09         ` Ingo Molnar
  2009-01-16 21:26         ` Maciej W. Rozycki
  1 sibling, 0 replies; 7+ messages in thread
From: Ingo Molnar @ 2009-01-16 13:09 UTC (permalink / raw)
  To: Jan Beulich; +Cc: tglx, linux-kernel, hpa


* Jan Beulich <jbeulich@novell.com> wrote:

> >>> Ingo Molnar <mingo@elte.hu> 15.01.09 23:47 >>>
> >
> >* Ingo Molnar <mingo@elte.hu> wrote:
> >
> >> hm, this gives a build failure on latest -tip:
> >> 
> >> arch/x86/kernel/apic.c: In function 'setup_local_APIC':
> >> arch/x86/kernel/apic.c:1135: error: implicit declaration of function 'disable_ioapic_setup'
> 
> Is this with a config that has X86_IO_APIC off (i.e. one the practical 
> use of which I never understood, and hence easily forget to consider)? 
> Otherwise I can't see how that could happen.

yeah. Such build failures are reminders to define such functions in a 
.config-invariant way: i.e. an extern prototype plus an inline NOP-wrapper 
for the !IO_APIC case.

	Ingo

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

* Re: [PATCH] x86: avoid early crash in disable_local_APIC()
  2009-01-16  8:22       ` Jan Beulich
  2009-01-16 13:09         ` Ingo Molnar
@ 2009-01-16 21:26         ` Maciej W. Rozycki
  1 sibling, 0 replies; 7+ messages in thread
From: Maciej W. Rozycki @ 2009-01-16 21:26 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Ingo Molnar, tglx, linux-kernel, hpa

On Fri, 16 Jan 2009, Jan Beulich wrote:

> Is this with a config that has X86_IO_APIC off (i.e. one the practical use of
> which I never understood, and hence easily forget to consider)? Otherwise
> I can't see how that could happen.

 A lot of systems have a P6-class CPU which has a local APIC and no I/O 
APIC in the chipset.  My old laptop was an example of one.  It saves some 
memory to have X86_IO_APIC disabled on such systems, while still being 
able to use the local APIC for the NMI watchdog and PeMo.

  Maciej

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

end of thread, other threads:[~2009-01-16 21:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-14 12:28 [PATCH] x86: avoid early crash in disable_local_APIC() Jan Beulich
2009-01-15 11:05 ` Ingo Molnar
2009-01-15 22:47   ` Ingo Molnar
2009-01-15 22:47     ` Ingo Molnar
2009-01-16  8:22       ` Jan Beulich
2009-01-16 13:09         ` Ingo Molnar
2009-01-16 21:26         ` Maciej W. Rozycki

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