diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2015-01-15 16:22:27 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2015-01-22 09:10:55 -0500 |
commit | 6d2d49d2cd0199ce298d111ee7fd405af3344a70 (patch) | |
tree | af046d12b29257c249ed86b7a90a2be7ae831bd6 /arch/x86/kernel/apic/apic.c | |
parent | 659006bf3ae37a08706907ce1a36ddf57c9131d2 (diff) |
x86/x2apic: Use state information for disable
Use the state information to simplify the disable logic further.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: 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/20150115211703.209387598@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/apic/apic.c')
-rw-r--r-- | arch/x86/kernel/apic/apic.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 0ee96b9fe4e6..0c554f5d03a6 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c | |||
@@ -1547,26 +1547,20 @@ void x2apic_setup(void) | |||
1547 | 1547 | ||
1548 | static __init void x2apic_disable(void) | 1548 | static __init void x2apic_disable(void) |
1549 | { | 1549 | { |
1550 | u64 msr; | 1550 | u32 x2apic_id; |
1551 | |||
1552 | if (!cpu_has_x2apic) | ||
1553 | return; | ||
1554 | |||
1555 | rdmsrl(MSR_IA32_APICBASE, msr); | ||
1556 | if (msr & X2APIC_ENABLE) { | ||
1557 | u32 x2apic_id = read_apic_id(); | ||
1558 | 1551 | ||
1559 | if (x2apic_id >= 255) | 1552 | if (x2apic_state != X2APIC_ON) |
1560 | panic("Cannot disable x2apic, id: %08x\n", x2apic_id); | 1553 | goto out; |
1561 | 1554 | ||
1562 | __x2apic_disable(); | 1555 | x2apic_id = read_apic_id(); |
1563 | 1556 | if (x2apic_id >= 255) | |
1564 | x2apic_mode = 0; | 1557 | panic("Cannot disable x2apic, id: %08x\n", x2apic_id); |
1565 | |||
1566 | register_lapic_address(mp_lapic_addr); | ||
1567 | } | ||
1568 | 1558 | ||
1559 | __x2apic_disable(); | ||
1560 | register_lapic_address(mp_lapic_addr); | ||
1561 | out: | ||
1569 | x2apic_state = X2APIC_DISABLED; | 1562 | x2apic_state = X2APIC_DISABLED; |
1563 | x2apic_mode = 0; | ||
1570 | } | 1564 | } |
1571 | 1565 | ||
1572 | static __init void x2apic_enable(void) | 1566 | static __init void x2apic_enable(void) |