# 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/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux-ld --version # < git log --format=%s --max-count=1 3fa6fc04815a70a110445368c8741c178970c87d # < make -s -j 8 ARCH=powerpc O=/kisskb/build/powerpc-fixes_mpc85xx_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- mpc85xx_defconfig # < make -s -j 8 ARCH=powerpc O=/kisskb/build/powerpc-fixes_mpc85xx_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- help # make -s -j 8 ARCH=powerpc O=/kisskb/build/powerpc-fixes_mpc85xx_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- olddefconfig # make -s -j 8 ARCH=powerpc O=/kisskb/build/powerpc-fixes_mpc85xx_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- In file included from /kisskb/src/include/linux/kernel.h:11:0, from /kisskb/src/include/linux/list.h:9, from /kisskb/src/include/linux/module.h:12, from /kisskb/src/drivers/net/ethernet/freescale/fs_enet/mac-scc.c:15: /kisskb/src/drivers/net/ethernet/freescale/fs_enet/mac-scc.c: In function 'allocate_bd': /kisskb/src/include/linux/err.h:22:49: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO) ^ /kisskb/src/include/linux/compiler.h:78:42: note: in definition of macro 'unlikely' # define unlikely(x) __builtin_expect(!!(x), 0) ^ /kisskb/src/drivers/net/ethernet/freescale/fs_enet/mac-scc.c:139:6: note: in expansion of macro 'IS_ERR_VALUE' if (IS_ERR_VALUE(fep->ring_mem_addr)) ^ /kisskb/src/arch/powerpc/boot/dts/fsl/mpc8541cds.dts:330.3-21: Warning (pci_device_bus_num): /pci@e0008000/i8259@19000:bus-range: PCI bus number 1 out of range, expected (0 - 0) /kisskb/src/arch/powerpc/boot/dts/fsl/mpc8555cds.dts:330.3-21: Warning (pci_device_bus_num): /pci@e0008000/i8259@19000:bus-range: PCI bus number 1 out of range, expected (0 - 0) INFO: Uncompressed kernel (size 0xca6604) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xca6604) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xca6604) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xca6604) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xca6604) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xca6604) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xca6604) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) Image Name: Linux-5.7.0-rc2-14553-g3fa6fc048 Created: Mon May 4 14:29:25 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6206177 Bytes = 6060.72 KiB = 5.92 MiB Load Address: 00d00000 Entry Point: 00d002a4 INFO: Uncompressed kernel (size 0xca6604) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) Image Name: Linux-5.7.0-rc2-14553-g3fa6fc048 Created: Mon May 4 14:29:25 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6205007 Bytes = 6059.58 KiB = 5.92 MiB Load Address: 00d00000 Entry Point: 00d00314 Image Name: Linux-5.7.0-rc2-14553-g3fa6fc048 Created: Mon May 4 14:29:25 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6206229 Bytes = 6060.77 KiB = 5.92 MiB Load Address: 00d00000 Entry Point: 00d00314 Image Name: Linux-5.7.0-rc2-14553-g3fa6fc048 Created: Mon May 4 14:29:25 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6205137 Bytes = 6059.70 KiB = 5.92 MiB Load Address: 00d00000 Entry Point: 00d002a4 Image Name: Linux-5.7.0-rc2-14553-g3fa6fc048 Created: Mon May 4 14:29:25 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6206227 Bytes = 6060.77 KiB = 5.92 MiB Load Address: 00d00000 Entry Point: 00d00314 INFO: Uncompressed kernel (size 0xca6604) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xca6604) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) Image Name: Linux-5.7.0-rc2-14553-g3fa6fc048 Created: Mon May 4 14:29:26 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6206123 Bytes = 6060.67 KiB = 5.92 MiB Load Address: 00d00000 Entry Point: 00d00314 Image Name: Linux-5.7.0-rc2-14553-g3fa6fc048 Created: Mon May 4 14:29:25 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6204973 Bytes = 6059.54 KiB = 5.92 MiB Load Address: 00d00000 Entry Point: 00d002a4 INFO: Uncompressed kernel (size 0xca6604) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xca6604) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xca6604) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xca6604) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xc95e00) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) Image Name: Linux-5.7.0-rc2-14553-g3fa6fc048 Created: Mon May 4 14:29:28 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6206165 Bytes = 6060.71 KiB = 5.92 MiB Load Address: 00d00000 Entry Point: 00d002a4 Image Name: Linux-5.7.0-rc2-14553-g3fa6fc048 Created: Mon May 4 14:29:28 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6174813 Bytes = 6030.09 KiB = 5.89 MiB Load Address: 00000000 Entry Point: 00000000 Image Name: Linux-5.7.0-rc2-14553-g3fa6fc048 Created: Mon May 4 14:29:29 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6204937 Bytes = 6059.51 KiB = 5.92 MiB Load Address: 00d00000 Entry Point: 00d00314 INFO: Uncompressed kernel (size 0xca6604) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) Image Name: Linux-5.7.0-rc2-14553-g3fa6fc048 Created: Mon May 4 14:29:30 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6203271 Bytes = 6057.88 KiB = 5.92 MiB Load Address: 00d00000 Entry Point: 00d002a4 Image Name: Linux-5.7.0-rc2-14553-g3fa6fc048 Created: Mon May 4 14:29:30 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6204631 Bytes = 6059.21 KiB = 5.92 MiB Load Address: 00d00000 Entry Point: 00d002a4 Image Name: Linux-5.7.0-rc2-14553-g3fa6fc048 Created: Mon May 4 14:29:30 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6203973 Bytes = 6058.57 KiB = 5.92 MiB Load Address: 00d00000 Entry Point: 00d002a4 Image Name: Linux-5.7.0-rc2-14553-g3fa6fc048 Created: Mon May 4 14:29:30 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6204871 Bytes = 6059.44 KiB = 5.92 MiB Load Address: 00d00000 Entry Point: 00d002a4 Image Name: Linux-5.7.0-rc2-14553-g3fa6fc048 Created: Mon May 4 14:29:30 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6204872 Bytes = 6059.45 KiB = 5.92 MiB Load Address: 00d00000 Entry Point: 00d002a4 Image Name: Linux-5.7.0-rc2-14553-g3fa6fc048 Created: Mon May 4 14:29:32 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6204708 Bytes = 6059.29 KiB = 5.92 MiB Load Address: 00d00000 Entry Point: 00d002a4 Completed OK # rm -rf /kisskb/build/powerpc-fixes_mpc85xx_defconfig_powerpc-gcc5 # Build took: 0:03:04.388795