From 8d80696060eedf49c080c0f2cf39a20ae7e787f9 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 15 Jan 2015 21:22:09 +0000 Subject: x86/apic: Avoid open coded x2apic detection enable_IR_x2apic() grew a open coded x2apic detection. Implement a proper helper function which shares the code with the already existing x2apic_enabled(). Made it use rdmsrl_safe as suggested by Boris. Signed-off-by: Thomas Gleixner Cc: Borislav Petkov Cc: Jiang Liu Cc: Joerg Roedel Cc: Tony Luck Link: http://lkml.kernel.org/r/20150115211702.285038186@linutronix.de Signed-off-by: Thomas Gleixner --- arch/x86/kernel/apic/apic.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (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 35e6d09..7ecfce1 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -1625,10 +1625,7 @@ void __init enable_IR_x2apic(void) int ret, ir_stat; if (!IS_ENABLED(CONFIG_X86_X2APIC)) { - u64 msr; - - rdmsrl(MSR_IA32_APICBASE, msr); - if (msr & X2APIC_ENABLE) + if (apic_is_x2apic_enabled()) panic("BIOS has enabled x2apic but kernel doesn't support x2apic, please disable x2apic in BIOS.\n"); } -- cgit v1.1