diff options
author | Yinghai Lu <yinghai@kernel.org> | 2011-12-21 20:45:17 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2011-12-23 14:01:01 -0500 |
commit | fb209bd891645bb87b9618b724f0b4928e0df3de (patch) | |
tree | 3b59766238dfedbe9f2164048008f4bb2c18a54e /arch/x86/include/asm | |
parent | a35fd28256e7736cc84af8931a16224f0bfaaf6c (diff) |
x86, x2apic: Fallback to xapic when BIOS doesn't setup interrupt-remapping
On some of the recent Intel SNB platforms, by default bios is pre-enabling
x2apic mode in the cpu with out setting up interrupt-remapping.
This case was resulting in the kernel to panic as the cpu is already in
x2apic mode but the OS was not able to enable interrupt-remapping (which
is a pre-req for using x2apic capability).
On these platforms all the apic-ids are < 255 and the kernel can fallback to
xapic mode if the bios has not enabled interrupt-remapping (which is
mostly the case if the bios has not exported interrupt-remapping tables to the
OS).
Reported-by: Berck E. Nash <flyboy@gmail.com>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Link: http://lkml.kernel.org/r/20111222014632.600418637@sbsiddha-desk.sc.intel.com
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/include/asm')
-rw-r--r-- | arch/x86/include/asm/apic.h | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/apicdef.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index a0f541a30944..a12d57193fef 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h | |||
@@ -176,6 +176,7 @@ static inline u64 native_x2apic_icr_read(void) | |||
176 | } | 176 | } |
177 | 177 | ||
178 | extern int x2apic_phys; | 178 | extern int x2apic_phys; |
179 | extern int x2apic_preenabled; | ||
179 | extern void check_x2apic(void); | 180 | extern void check_x2apic(void); |
180 | extern void enable_x2apic(void); | 181 | extern void enable_x2apic(void); |
181 | extern void x2apic_icr_write(u32 low, u32 id); | 182 | extern void x2apic_icr_write(u32 low, u32 id); |
@@ -198,6 +199,9 @@ static inline void x2apic_force_phys(void) | |||
198 | x2apic_phys = 1; | 199 | x2apic_phys = 1; |
199 | } | 200 | } |
200 | #else | 201 | #else |
202 | static inline void disable_x2apic(void) | ||
203 | { | ||
204 | } | ||
201 | static inline void check_x2apic(void) | 205 | static inline void check_x2apic(void) |
202 | { | 206 | { |
203 | } | 207 | } |
diff --git a/arch/x86/include/asm/apicdef.h b/arch/x86/include/asm/apicdef.h index 3925d8007864..134bba00df09 100644 --- a/arch/x86/include/asm/apicdef.h +++ b/arch/x86/include/asm/apicdef.h | |||
@@ -144,6 +144,7 @@ | |||
144 | 144 | ||
145 | #define APIC_BASE (fix_to_virt(FIX_APIC_BASE)) | 145 | #define APIC_BASE (fix_to_virt(FIX_APIC_BASE)) |
146 | #define APIC_BASE_MSR 0x800 | 146 | #define APIC_BASE_MSR 0x800 |
147 | #define XAPIC_ENABLE (1UL << 11) | ||
147 | #define X2APIC_ENABLE (1UL << 10) | 148 | #define X2APIC_ENABLE (1UL << 10) |
148 | 149 | ||
149 | #ifdef CONFIG_X86_32 | 150 | #ifdef CONFIG_X86_32 |