From 2ca5b40479246087695d9e6343075b47ee6887ea Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 15 Jan 2015 21:22:14 +0000 Subject: x86/ioapic: Check x2apic really 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 Cc: Jiang Liu Cc: Joerg Roedel Cc: Tony Luck Cc: Borislav Petkov Link: http://lkml.kernel.org/r/20150115211702.541280622@linutronix.de Signed-off-by: Thomas Gleixner --- arch/x86/kernel/apic/apic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'arch/x86/kernel/apic/apic.c') diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index ff2a8b8..08144f5 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -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) { @@ -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) -- cgit v1.1