From f8ac916f813f5a8e478d54b2d5fbdec960bb2589 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Sat, 7 Sep 2019 18:07:15 -0400 Subject: [PATCH] fixes for 4.19 Signed-off-by: Sasha Levin --- ...include-the-ldr-when-clearing-out-ap.patch | 63 +++++++++++++++++++ queue-4.19/series | 1 + 2 files changed, 64 insertions(+) create mode 100644 queue-4.19/revert-x86-apic-include-the-ldr-when-clearing-out-ap.patch diff --git a/queue-4.19/revert-x86-apic-include-the-ldr-when-clearing-out-ap.patch b/queue-4.19/revert-x86-apic-include-the-ldr-when-clearing-out-ap.patch new file mode 100644 index 00000000000..be852793b14 --- /dev/null +++ b/queue-4.19/revert-x86-apic-include-the-ldr-when-clearing-out-ap.patch @@ -0,0 +1,63 @@ +From d0e72458d1ef225b2a4e501b15fb0f25a0617cc1 Mon Sep 17 00:00:00 2001 +From: Linus Torvalds +Date: Sat, 7 Sep 2019 14:25:54 -0700 +Subject: Revert "x86/apic: Include the LDR when clearing out APIC registers" + +[ Upstream commit 950b07c14e8c59444e2359f15fd70ed5112e11a0 ] + +This reverts commit 558682b5291937a70748d36fd9ba757fb25b99ae. + +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 +Acked-by: Thomas Gleixner +Cc: Bandan Das +Signed-off-by: Linus Torvalds +Signed-off-by: Sasha Levin +--- + arch/x86/kernel/apic/apic.c | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c +index 90be3a1506d3f..b316bd61a6ace 100644 +--- a/arch/x86/kernel/apic/apic.c ++++ b/arch/x86/kernel/apic/apic.c +@@ -1140,10 +1140,6 @@ void clear_local_APIC(void) + apic_write(APIC_LVT0, v | APIC_LVT_MASKED); + v = apic_read(APIC_LVT1); + apic_write(APIC_LVT1, v | APIC_LVT_MASKED); +- if (!x2apic_enabled()) { +- v = apic_read(APIC_LDR) & ~APIC_LDR_MASK; +- apic_write(APIC_LDR, v); +- } + if (maxlvt >= 4) { + v = apic_read(APIC_LVTPC); + apic_write(APIC_LVTPC, v | APIC_LVT_MASKED); +-- +2.20.1 + diff --git a/queue-4.19/series b/queue-4.19/series index d638a565ead..791ee6c238c 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -45,3 +45,4 @@ afs-fix-leak-in-afs_lookup_cell_rcu.patch kvm-arm-arm64-vgic-properly-initialise-private-irq-a.patch x86-boot-compressed-64-fix-missing-initialization-in.patch libceph-allow-ceph_buffer_put-to-receive-a-null-ceph.patch +revert-x86-apic-include-the-ldr-when-clearing-out-ap.patch -- 2.47.3