Skip to content

Commit 950b07c

Browse files
committed
Revert "x86/apic: Include the LDR when clearing out APIC registers"
This reverts commit 558682b. Chris Wilson reports that it breaks his CPU hotplug test scripts. In particular, it breaks offlining and then re-onlining the boot CPU, which we treat specially (and the BIOS does too). The symptoms are that we can offline the CPU, but it then does not come back online again: smpboot: CPU 0 is now offline smpboot: Booting Node 0 Processor 0 APIC 0x0 smpboot: do_boot_cpu failed(-1) to wakeup CPU#0 Thomas says he knows why it's broken (my personal suspicion: our magic handling of the "cpu0_logical_apicid" thing), but for 5.3 the right fix is to just revert it, since we've never touched the LDR bits before, and it's not worth the risk to do anything else at this stage. [ Hotpluging of the boot CPU is special anyway, and should be off by default. See the "BOOTPARAM_HOTPLUG_CPU0" config option and the cpu0_hotplug kernel parameter. In general you should not do it, and it has various known limitations (hibernate and suspend require the boot CPU, for example). But it should work, even if the boot CPU is special and needs careful treatment - Linus ] Link: https://lore.kernel.org/lkml/156785100521.13300.14461504732265570003@skylake-alporthouse-com/ Reported-by: Chris Wilson <[email protected]> Acked-by: Thomas Gleixner <[email protected]> Cc: Bandan Das <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent b3a9964 commit 950b07c

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

arch/x86/kernel/apic/apic.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,10 +1179,6 @@ void clear_local_APIC(void)
11791179
apic_write(APIC_LVT0, v | APIC_LVT_MASKED);
11801180
v = apic_read(APIC_LVT1);
11811181
apic_write(APIC_LVT1, v | APIC_LVT_MASKED);
1182-
if (!x2apic_enabled()) {
1183-
v = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
1184-
apic_write(APIC_LDR, v);
1185-
}
11861182
if (maxlvt >= 4) {
11871183
v = apic_read(APIC_LVTPC);
11881184
apic_write(APIC_LVTPC, v | APIC_LVT_MASKED);

0 commit comments

Comments
 (0)