x86: avoid early crash in disable_local_APIC()
PATCH 1/1 x86: avoid early crash in disable_local_APIC()
E.g. when called due to an early panic.
--- arch/x86/kernel/apic.c | 4 ++++ 1 file changed, 4 insertions(+)
arch/x86/kernel/apic.c +4 -0
@@ -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 ();/*
Ingo Molnar
AppliedQuoted 7 lines · Jan Beulich
E.g. when called due to an early panic.
Signed-off-by Jan Beulich <[email protected]>--- arch/x86/kernel/apic.c | 4 ++++ 1 file changed, 4 insertions(+)
applied to tip/x86/urgent, thanks!
Ingo
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
Quoted 4 lines · Ingo Molnar
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 <[email protected]> Date: Wed Jan 14 12:27:35 2009 +0000
x86: fully honor "nolapic"
Ingo
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Ingo Molnar <[email protected]> 15.01.09 23:47 >>>
Quoted 4 lines · Ingo Molnar
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
Quoted 4 lines · Jan Beulich
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Ingo Molnar <[email protected]> 15.01.09 23:47 >>>
* Ingo Molnar <[email protected]> wrote:
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
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_APICoff (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
Quoted 3 lines · Jan Beulich
Is this with a config that has
X86_IO_APICoff (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