diff options
author | Andi Kleen <ak@suse.de> | 2008-01-30 07:33:17 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:33:17 -0500 |
commit | d3432896dae72ee97deb850ad7bbc30329d32c0d (patch) | |
tree | 73cc99efc6ca0ef5f8caabd6eed1e2a50196ca5e /arch/x86/kernel/apic_64.c | |
parent | ca74a6f84e68b44867022f4a4f3ec17c087c864e (diff) |
x86: don't disable the APIC if it hasn't been mapped yet
When the kernel panics early for some unrelated reason
there would be eventually an early exception inside panic because
clear_local_APIC tried to disable the not yet mapped APIC.
Check for that explicitely.
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/apic_64.c')
-rw-r--r-- | arch/x86/kernel/apic_64.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c index 85bd3d463cdf..a7a38c9da136 100644 --- a/arch/x86/kernel/apic_64.c +++ b/arch/x86/kernel/apic_64.c | |||
@@ -81,6 +81,8 @@ static struct clock_event_device lapic_clockevent = { | |||
81 | }; | 81 | }; |
82 | static DEFINE_PER_CPU(struct clock_event_device, lapic_events); | 82 | static DEFINE_PER_CPU(struct clock_event_device, lapic_events); |
83 | 83 | ||
84 | static unsigned long apic_phys; | ||
85 | |||
84 | /* | 86 | /* |
85 | * Get the LAPIC version | 87 | * Get the LAPIC version |
86 | */ | 88 | */ |
@@ -525,6 +527,11 @@ void clear_local_APIC(void) | |||
525 | int maxlvt = lapic_get_maxlvt(); | 527 | int maxlvt = lapic_get_maxlvt(); |
526 | u32 v; | 528 | u32 v; |
527 | 529 | ||
530 | /* APIC hasn't been mapped yet */ | ||
531 | if (!apic_phys) | ||
532 | return; | ||
533 | |||
534 | maxlvt = lapic_get_maxlvt(); | ||
528 | /* | 535 | /* |
529 | * Masking an LVT entry can trigger a local APIC error | 536 | * Masking an LVT entry can trigger a local APIC error |
530 | * if the vector is zero. Mask LVTERR first to prevent this. | 537 | * if the vector is zero. Mask LVTERR first to prevent this. |
@@ -859,8 +866,6 @@ static int __init detect_init_APIC(void) | |||
859 | */ | 866 | */ |
860 | void __init init_apic_mappings(void) | 867 | void __init init_apic_mappings(void) |
861 | { | 868 | { |
862 | unsigned long apic_phys; | ||
863 | |||
864 | /* | 869 | /* |
865 | * If no local APIC can be found then set up a fake all | 870 | * If no local APIC can be found then set up a fake all |
866 | * zeroes page to simulate the local APIC and another | 871 | * zeroes page to simulate the local APIC and another |