diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2015-01-15 16:22:09 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2015-01-22 09:10:54 -0500 |
commit | 8d80696060eedf49c080c0f2cf39a20ae7e787f9 (patch) | |
tree | 1b6282a1fc1305aec1ccba89515078b32914eb24 /arch/x86/kernel | |
parent | e901176046e6729e002839d7296f27f17599ccb8 (diff) |
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 <tglx@linutronix.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Tony Luck <tony.luck@intel.com>
Link: http://lkml.kernel.org/r/20150115211702.285038186@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/apic/apic.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 35e6d09294ed..7ecfce13be05 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) | |||
1625 | int ret, ir_stat; | 1625 | int ret, ir_stat; |
1626 | 1626 | ||
1627 | if (!IS_ENABLED(CONFIG_X86_X2APIC)) { | 1627 | if (!IS_ENABLED(CONFIG_X86_X2APIC)) { |
1628 | u64 msr; | 1628 | if (apic_is_x2apic_enabled()) |
1629 | |||
1630 | rdmsrl(MSR_IA32_APICBASE, msr); | ||
1631 | if (msr & X2APIC_ENABLE) | ||
1632 | panic("BIOS has enabled x2apic but kernel doesn't support x2apic, please disable x2apic in BIOS.\n"); | 1629 | panic("BIOS has enabled x2apic but kernel doesn't support x2apic, please disable x2apic in BIOS.\n"); |
1633 | } | 1630 | } |
1634 | 1631 | ||