Skip to content

Commit

Permalink
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/l…
Browse files Browse the repository at this point in the history
…inux/kernel/git/tip/tip

Pull x86 fix from Thomas Gleixner:
 "A single fix for a APIC regression introduced in 4.0 which went
  undetected until now.

  I screwed up the x2apic cleanup in a subtle way.  The screwup is only
  visible on systems which have x2apic preenabled in the BIOS and need
  to disable it during boot"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/apic: Fix fallout from x2apic cleanup
  • Loading branch information
Linus Torvalds committed Aug 25, 2015
2 parents 883985f + a57e456 commit b1713b1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions arch/x86/kernel/apic/apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1424,7 +1424,7 @@ static inline void __x2apic_disable(void)
{
u64 msr;

if (cpu_has_apic)
if (!cpu_has_apic)
return;

rdmsrl(MSR_IA32_APICBASE, msr);
Expand Down Expand Up @@ -1483,20 +1483,20 @@ void x2apic_setup(void)

static __init void x2apic_disable(void)
{
u32 x2apic_id;
u32 x2apic_id, state = x2apic_state;

if (x2apic_state != X2APIC_ON)
goto out;
x2apic_mode = 0;
x2apic_state = X2APIC_DISABLED;

if (state != X2APIC_ON)
return;

x2apic_id = read_apic_id();
if (x2apic_id >= 255)
panic("Cannot disable x2apic, id: %08x\n", x2apic_id);

__x2apic_disable();
register_lapic_address(mp_lapic_addr);
out:
x2apic_state = X2APIC_DISABLED;
x2apic_mode = 0;
}

static __init void x2apic_enable(void)
Expand Down

0 comments on commit b1713b1

Please sign in to comment.