# git rev-parse -q --verify 3fa6fc04815a70a110445368c8741c178970c87d^{commit} 3fa6fc04815a70a110445368c8741c178970c87d already have revision, skipping fetch # git checkout -q -f -B kisskb 3fa6fc04815a70a110445368c8741c178970c87d # git clean -qxdf # < git log -1 # commit 3fa6fc04815a70a110445368c8741c178970c87d # Author: Michael Ellerman # Date: Sun May 3 00:33:16 2020 +1000 # # powerpc/64s: Fix unrecoverable SLB crashes due to preemption check # # Hugh reported that his trusty G5 crashed after a few hours under load # with an "Unrecoverable exception 380". # # The crash is in interrupt_return() where we check lazy_irq_pending(), # which calls get_paca() and with CONFIG_DEBUG_PREEMPT=y that goes to # check_preemption_disabled() via debug_smp_processor_id(). # # As Nick explained on the list: # # Problem is MSR[RI] is cleared here, ready to do the last few things # for interrupt return where we're not allowed to take any other # interrupts. # # SLB interrupts can happen just about anywhere aside from kernel # text, global variables, and stack. When that hits, it appears to be # unrecoverable due to RI=0. # # The problematic access is in preempt_count() which is: # # return READ_ONCE(current_thread_info()->preempt_count); # # Because of THREAD_INFO_IN_TASK, current_thread_info() just points to # current, so the access is to somewhere in kernel memory, but not on # the stack or in .data, which means it can cause an SLB miss. If we # take an SLB miss with RI=0 it is fatal. # # The easiest solution is to add a version of lazy_irq_pending() that # doesn't do the preemption check and call it from the interrupt return # path. # # Fixes: 68b34588e202 ("powerpc/64/sycall: Implement syscall entry/exit logic in C") # Reported-by: Hugh Dickins # Signed-off-by: Michael Ellerman # Signed-off-by: Michael Ellerman # Link: https://lore.kernel.org/r/20200502143316.929341-1-mpe@ellerman.id.au # < /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux-gcc --version # < /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux-ld --version # < git log --format=%s --max-count=1 3fa6fc04815a70a110445368c8741c178970c87d # < make -s -j 24 ARCH=mips O=/kisskb/build/powerpc-fixes_mips-defconfig_mipsel CROSS_COMPILE=/opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux- defconfig # < make -s -j 24 ARCH=mips O=/kisskb/build/powerpc-fixes_mips-defconfig_mipsel CROSS_COMPILE=/opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux- help # make -s -j 24 ARCH=mips O=/kisskb/build/powerpc-fixes_mips-defconfig_mipsel CROSS_COMPILE=/opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux- olddefconfig # make -s -j 24 ARCH=mips O=/kisskb/build/powerpc-fixes_mips-defconfig_mipsel CROSS_COMPILE=/opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux- /kisskb/src/kernel/futex.c: In function 'do_futex': /kisskb/src/kernel/futex.c:1676:17: warning: 'oldval' may be used uninitialized in this function [-Wmaybe-uninitialized] return oldval == cmparg; ^ /kisskb/src/kernel/futex.c:1652:6: note: 'oldval' was declared here int oldval, ret; ^ FIT description: Linux 5.7.0-rc2-g3fa6fc04815a Created: Mon May 4 13:14:47 2020 Image 0 (kernel@0) Description: Linux 5.7.0-rc2-g3fa6fc04815a Created: Mon May 4 13:14:47 2020 Type: Kernel Image Compression: gzip compressed Data Size: 4940677 Bytes = 4824.88 KiB = 4.71 MiB Architecture: MIPS OS: Linux Load Address: 0x80100000 Entry Point: 0x8091a200 Hash algo: sha1 Hash value: 9a4e113bfa0a6d206ee70a6d7d0b71355450d09a Image 1 (fdt@boston) Description: img,boston Device Tree Created: Mon May 4 13:14:47 2020 Type: Flat Device Tree Compression: uncompressed Data Size: 3793 Bytes = 3.70 KiB = 0.00 MiB Architecture: MIPS Hash algo: sha1 Hash value: 4799f50d688573234da6e9d7701234d394759ef4 Image 2 (fdt@ni169445) Description: NI 169445 device tree Created: Mon May 4 13:14:47 2020 Type: Flat Device Tree Compression: uncompressed Data Size: 1871 Bytes = 1.83 KiB = 0.00 MiB Architecture: MIPS Hash algo: sha1 Hash value: 51b89b31605ee62038c8468c429af091dfc75ec7 Image 3 (fdt@ocelot_pcb123) Description: MSCC Ocelot PCB123 Device Tree Created: Mon May 4 13:14:47 2020 Type: Flat Device Tree Compression: uncompressed Data Size: 4639 Bytes = 4.53 KiB = 0.00 MiB Architecture: MIPS Hash algo: sha1 Hash value: 018897896b42c41c943aca35a20e4300dba250c8 Image 4 (fdt@ocelot_pcb120) Description: MSCC Ocelot PCB120 Device Tree Created: Mon May 4 13:14:47 2020 Type: Flat Device Tree Compression: uncompressed Data Size: 5198 Bytes = 5.08 KiB = 0.00 MiB Architecture: MIPS Hash algo: sha1 Hash value: 36c7bd0bd79cfc2f7dd6acda6c7996294f4967e6 Image 5 (fdt@xilfpga) Description: MIPSfpga (xilfpga) Device Tree Created: Mon May 4 13:14:47 2020 Type: Flat Device Tree Compression: uncompressed Data Size: 2708 Bytes = 2.64 KiB = 0.00 MiB Architecture: MIPS Hash algo: sha1 Hash value: 63d058b780f65e22da30f0a183433765f1807f1d Default Configuration: 'conf@default' Configuration 0 (conf@default) Description: Generic Linux kernel Kernel: kernel@0 Configuration 1 (conf@boston) Description: Boston Linux kernel Kernel: kernel@0 FDT: fdt@boston Configuration 2 (conf@ni169445) Description: NI 169445 Linux Kernel Kernel: kernel@0 FDT: fdt@ni169445 Configuration 3 (conf@ocelot_pcb123) Description: Ocelot Linux kernel Kernel: kernel@0 FDT: fdt@ocelot_pcb123 Configuration 4 (conf@ocelot_pcb120) Description: Ocelot Linux kernel Kernel: kernel@0 FDT: fdt@ocelot_pcb120 Configuration 5 (conf@xilfpga) Description: MIPSfpga Linux kernel Kernel: kernel@0 FDT: fdt@xilfpga Completed OK # rm -rf /kisskb/build/powerpc-fixes_mips-defconfig_mipsel # Build took: 0:02:05.873665