Skip to content

Commit

Permalink
x86/ioapic: Check x2apic really
Browse files Browse the repository at this point in the history
The x2apic_preenabled flag is just a horrible hack and if X2APIC
support is disabled it does not reflect the actual hardware
state. Check the hardware instead.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Link: http://lkml.kernel.org/r/20150115211702.541280622@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Thomas Gleixner committed Jan 22, 2015
1 parent bfb0507 commit 2ca5b40
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 0 additions & 2 deletions arch/x86/include/asm/apic.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ static inline u64 native_x2apic_icr_read(void)

extern int x2apic_mode;
extern int x2apic_phys;
extern int x2apic_preenabled;
extern void check_x2apic(void);
extern void enable_x2apic(void);
static inline int x2apic_enabled(void)
Expand Down Expand Up @@ -210,7 +209,6 @@ static inline void x2apic_force_phys(void)
}

#define x2apic_mode (0)
#define x2apic_preenabled (0)
#define x2apic_supported() (0)
#endif

Expand Down
4 changes: 3 additions & 1 deletion arch/x86/kernel/apic/apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1480,7 +1480,7 @@ static bool nox2apic __initdata;
#ifdef CONFIG_X86_X2APIC
int x2apic_mode;
/* x2apic enabled before OS handover */
int x2apic_preenabled;
static int x2apic_preenabled;
static int x2apic_disabled;
static int __init setup_nox2apic(char *str)
{
Expand Down Expand Up @@ -1569,6 +1569,8 @@ void enable_x2apic(void)
wrmsrl(MSR_IA32_APICBASE, msr | X2APIC_ENABLE);
}
}
#else
#define x2apic_preenabled (0)
#endif /* CONFIG_X86_X2APIC */

static int __init try_to_enable_IR(void)
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kernel/apic/io_apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -2295,7 +2295,7 @@ static inline void __init check_timer(void)
}
local_irq_disable();
apic_printk(APIC_QUIET, KERN_INFO "..... failed :(.\n");
if (x2apic_preenabled)
if (apic_is_x2apic_enabled())
apic_printk(APIC_QUIET, KERN_INFO
"Perhaps problem with the pre-enabled x2apic mode\n"
"Try booting with x2apic and interrupt-remapping disabled in the bios.\n");
Expand Down

0 comments on commit 2ca5b40

Please sign in to comment.