# git rev-parse -q --verify 3fa6fc04815a70a110445368c8741c178970c87d^{commit} # git fetch -q -n -f git://gitlab.ozlabs.ibm.com/linuxppc/linux.git fixes-test warning: The last gc run reported the following. Please correct the root cause and remove .git/gc.log. Automatic cleanup will not be performed until the file is removed. warning: There are too many unreachable loose objects; run 'git prune' to remove them. # git rev-parse -q --verify 3fa6fc04815a70a110445368c8741c178970c87d^{commit} 3fa6fc04815a70a110445368c8741c178970c87d # 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/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux-gcc --version # < /opt/cross/kisskb/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux-ld --version # < git log --format=%s --max-count=1 3fa6fc04815a70a110445368c8741c178970c87d # < make -s -j 8 ARCH=sh O=/kisskb/build/powerpc-fixes_sh-defconfig_sh4-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux- defconfig # < make -s -j 8 ARCH=sh O=/kisskb/build/powerpc-fixes_sh-defconfig_sh4-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux- help # make -s -j 8 ARCH=sh O=/kisskb/build/powerpc-fixes_sh-defconfig_sh4-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux- olddefconfig # make -s -j 8 ARCH=sh O=/kisskb/build/powerpc-fixes_sh-defconfig_sh4-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux- Generating include/generated/machtypes.h :1511:2: warning: #warning syscall clone3 not implemented [-Wcpp] /kisskb/src/arch/sh/kernel/cpu/sh4/../sh3/../../entry-common.S: Assembler messages: /kisskb/src/arch/sh/kernel/cpu/sh4/../sh3/../../entry-common.S:385: Warning: overflow in branch to syscall_exit_work; converted into longer instruction sequence /kisskb/src/arch/sh/kernel/cpu/sh4/../sh3/../../entry-common.S:388: Warning: overflow in branch to syscall_exit_work; converted into longer instruction sequence /kisskb/src/arch/sh/mm/init.c: In function 'arch_add_memory': /kisskb/src/arch/sh/mm/init.c:416:3: error: expected ')' before 'return' /kisskb/src/arch/sh/mm/init.c:424:1: error: expected expression before '}' token /kisskb/src/arch/sh/mm/init.c:413:6: error: unused variable 'ret' [-Werror=unused-variable] /kisskb/src/arch/sh/mm/init.c:412:16: error: unused variable 'nr_pages' [-Werror=unused-variable] /kisskb/src/arch/sh/mm/init.c:411:16: error: unused variable 'start_pfn' [-Werror=unused-variable] /kisskb/src/arch/sh/mm/init.c:424:1: error: control reaches end of non-void function [-Werror=return-type] cc1: all warnings being treated as errors make[2]: *** [/kisskb/src/scripts/Makefile.build:267: arch/sh/mm/init.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [/kisskb/src/Makefile:1722: arch/sh/mm] Error 2 make[1]: *** Waiting for unfinished jobs.... /kisskb/src/kernel/printk/printk.c: In function 'devkmsg_sysctl_set_loglvl': /kisskb/src/kernel/printk/printk.c:204:16: warning: 'old' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/kernel/trace/trace_events.c: In function 'event_create_dir': /kisskb/src/kernel/trace/trace_events.c:2189:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/kernel/futex.c: In function 'do_futex': /kisskb/src/kernel/futex.c:1676:3: warning: 'oldval' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/kernel/futex.c:1652:6: note: 'oldval' was declared here make: *** [Makefile:180: sub-make] Error 2 Command 'make -s -j 8 ARCH=sh O=/kisskb/build/powerpc-fixes_sh-defconfig_sh4-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux- ' returned non-zero exit status 2 # rm -rf /kisskb/build/powerpc-fixes_sh-defconfig_sh4-gcc4.6 # Build took: 0:00:18.206643