# git rev-parse -q --verify e620d45065c7b5b8d6ae11217c09c09380103b83^{commit} e620d45065c7b5b8d6ae11217c09c09380103b83 already have revision, skipping fetch # git checkout -q -f -B kisskb e620d45065c7b5b8d6ae11217c09c09380103b83 # git clean -qxdf # < git log -1 # commit e620d45065c7b5b8d6ae11217c09c09380103b83 # Author: Breno Leitao # Date: Wed Jan 16 14:47:44 2019 -0200 # # powerpc/tm: Avoid machine crash on rt_sigreturn() # # There is a kernel crash that happens if rt_sigreturn() is called inside # a transactional block. # # This crash happens if the kernel hits an in-kernel page fault when # accessing userspace memory, usually through copy_ckvsx_to_user(). A # major page fault calls might_sleep() function, which can cause a task # reschedule. A task reschedule (switch_to()) reclaim and recheckpoint # the TM states, but, in the signal return path, the checkpointed memory # was already reclaimed, thus the exception stack has MSR that points to # MSR[TS]=0. # # When the code returns from might_sleep() and a task reschedule # happened, then this task is returned with the memory recheckpointed, # and CPU MSR[TS] = suspended. # # This means that there is a side effect at might_sleep() if it is # called with CPU MSR[TS] = 0 and the task has regs->msr[TS] != 0. # # This side effect can cause a TM bad thing, since at the exception # entrance, the stack saves MSR[TS]=0, and this is what will be used at # RFID, but, the processor has MSR[TS] = Suspended, and this transition # will be invalid and a TM Bad thing will be raised, causing the # following crash: # # Unexpected TM Bad Thing exception at c00000000000e9ec (msr 0x8000000302a03031) tm_scratch=800000010280b033 # cpu 0xc: Vector: 700 (Program Check) at [c00000003ff1fd70] # pc: c00000000000e9ec: fast_exception_return+0x100/0x1bc # lr: c000000000032948: handle_rt_signal64+0xb8/0xaf0 # sp: c0000004263ebc40 # msr: 8000000302a03031 # current = 0xc000000415050300 # paca = 0xc00000003ffc4080 irqmask: 0x03 irq_happened: 0x01 # pid = 25006, comm = sigfuz # Linux version 5.0.0-rc1-00001-g3bd6e94bec12 (breno@debian) (gcc version 8.2.0 (Debian 8.2.0-3)) #899 SMP Mon Jan 7 11:30:07 EST 2019 # WARNING: exception is not recoverable, can't continue # enter ? for help # [c0000004263ebc40] c000000000032948 handle_rt_signal64+0xb8/0xaf0 (unreliable) # [c0000004263ebd30] c000000000022780 do_notify_resume+0x2f0/0x430 # [c0000004263ebe20] c00000000000e844 ret_from_except_lite+0x70/0x74 # --- Exception: c00 (System Call) at 00007fffbaac400c # SP (7fffeca90f40) is in userspace # # The solution for this problem is running the sigreturn code with # regs->msr[TS] disabled, thus, avoiding hitting the side effect above. # This does not seem to be a problem since regs->msr will be replaced by # the ucontext value, so, it is being flushed already. In this case, it # is flushed earlier. # # Signed-off-by: Breno Leitao # Acked-by: Michael Neuling # Signed-off-by: Michael Ellerman # < /opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux-gcc --version # < /opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux-ld --version # < git log --format=%s --max-count=1 e620d45065c7b5b8d6ae11217c09c09380103b83 # < make -s -j 120 ARCH=powerpc O=/kisskb/build/powerpc-next_mpc85xx_smp_defconfig_powerpc-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- mpc85xx_smp_defconfig # make -s -j 120 ARCH=powerpc O=/kisskb/build/powerpc-next_mpc85xx_smp_defconfig_powerpc-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- :1478:2: warning: #warning syscall pidfd_send_signal not implemented [-Wcpp] :1481:2: warning: #warning syscall io_uring_setup not implemented [-Wcpp] :1484:2: warning: #warning syscall io_uring_enter not implemented [-Wcpp] :1487:2: warning: #warning syscall io_uring_register not implemented [-Wcpp] /kisskb/src/kernel/printk/printk.c: In function 'devkmsg_sysctl_set_loglvl': /kisskb/src/kernel/printk/printk.c:187:16: warning: 'old' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/base/regmap/regmap.c: In function 'regmap_raw_read': /kisskb/src/drivers/base/regmap/regmap.c:2594:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/base/regmap/regmap.c: In function '_regmap_raw_write': /kisskb/src/drivers/base/regmap/regmap.c:1855:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/sound/soc/codecs/wm8960.c: In function 'wm8960_configure_clocking': /kisskb/src/sound/soc/codecs/wm8960.c:803:70: warning: 'j' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/sound/soc/codecs/wm8960.c:800:68: warning: 'i' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/proc/inode.c: In function 'proc_reg_open': /kisskb/src/include/linux/list.h:65:12: warning: 'pdeo' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/proc/inode.c:337:21: note: 'pdeo' was declared here /kisskb/src/mm/hugetlb.c: In function 'alloc_pool_huge_page': /kisskb/src/mm/hugetlb.c:1435:5: warning: 'page' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/i2c/i2c-core-base.c: In function 'i2c_generic_scl_recovery': /kisskb/src/drivers/i2c/i2c-core-base.c:235:5: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/tty/serial/8250/8250_core.c: In function 'univ8250_release_irq': /kisskb/src/drivers/tty/serial/8250/8250_core.c:247:18: warning: 'i' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/tty/serial/8250/8250_core.c:227:19: note: 'i' was declared here /kisskb/src/drivers/net/ethernet/freescale/fs_enet/mac-scc.c: In function 'allocate_bd': /kisskb/src/drivers/net/ethernet/freescale/fs_enet/mac-scc.c:139:6: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] /kisskb/src/fs/udf/unicode.c: In function 'udf_name_conv_char': /kisskb/src/fs/udf/unicode.c:132:8: warning: 'c' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/arch/powerpc/boot/dts/fsl/mpc8555cds.dts:334.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/mpc8541cds.dts:334.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 0xc5d1c8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xc5d1c8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xc5d1c8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xc5d1c8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xc5d1c8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xc5d1c8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xc5d1c8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xc5d1c8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xc5d1c8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xc5d1c8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xc5d1c8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xc5d1c8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xc5d1c8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xc5d1c8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xc5d1c8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xc4c9c8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) Image Name: Linux-5.1.0-rc3-ge620d45065c7 Created: Thu May 2 00:30:38 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5975087 Bytes = 5835.05 KiB = 5.70 MiB Load Address: 00000000 Entry Point: 00000000 Image Name: Linux-5.1.0-rc3-ge620d45065c7 Created: Thu May 2 00:30:38 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6007111 Bytes = 5866.32 KiB = 5.73 MiB Load Address: 00d00000 Entry Point: 00d002a8 Image Name: Linux-5.1.0-rc3-ge620d45065c7 Created: Thu May 2 00:30:38 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6007709 Bytes = 5866.90 KiB = 5.73 MiB Load Address: 00d00000 Entry Point: 00d002a8 Image Name: Linux-5.1.0-rc3-ge620d45065c7 Created: Thu May 2 00:30:38 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6007351 Bytes = 5866.55 KiB = 5.73 MiB Load Address: 00d00000 Entry Point: 00d002a8 Image Name: Linux-5.1.0-rc3-ge620d45065c7 Created: Thu May 2 00:30:38 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6007109 Bytes = 5866.32 KiB = 5.73 MiB Load Address: 00d00000 Entry Point: 00d002e8 Image Name: Linux-5.1.0-rc3-ge620d45065c7 Created: Thu May 2 00:30:38 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6008099 Bytes = 5867.28 KiB = 5.73 MiB Load Address: 00d00000 Entry Point: 00d002a8 Image Name: Linux-5.1.0-rc3-ge620d45065c7 Created: Thu May 2 00:30:38 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6007153 Bytes = 5866.36 KiB = 5.73 MiB Load Address: 00d00000 Entry Point: 00d002e8 Image Name: Linux-5.1.0-rc3-ge620d45065c7 Created: Thu May 2 00:30:38 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6007160 Bytes = 5866.37 KiB = 5.73 MiB Load Address: 00d00000 Entry Point: 00d002a8 Image Name: Linux-5.1.0-rc3-ge620d45065c7 Created: Thu May 2 00:30:38 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6008183 Bytes = 5867.37 KiB = 5.73 MiB Load Address: 00d00000 Entry Point: 00d002a8 Image Name: Linux-5.1.0-rc3-ge620d45065c7 Created: Thu May 2 00:30:38 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6007274 Bytes = 5866.48 KiB = 5.73 MiB Load Address: 00d00000 Entry Point: 00d002a8 Image Name: Linux-5.1.0-rc3-ge620d45065c7 Created: Thu May 2 00:30:38 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6007385 Bytes = 5866.59 KiB = 5.73 MiB Load Address: 00d00000 Entry Point: 00d002e8 Image Name: Linux-5.1.0-rc3-ge620d45065c7 Created: Thu May 2 00:30:38 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6007352 Bytes = 5866.55 KiB = 5.73 MiB Load Address: 00d00000 Entry Point: 00d002a8 Image Name: Linux-5.1.0-rc3-ge620d45065c7 Created: Thu May 2 00:30:38 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6007935 Bytes = 5867.12 KiB = 5.73 MiB Load Address: 00d00000 Entry Point: 00d002a8 Image Name: Linux-5.1.0-rc3-ge620d45065c7 Created: Thu May 2 00:30:38 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6007395 Bytes = 5866.60 KiB = 5.73 MiB Load Address: 00d00000 Entry Point: 00d002a8 Image Name: Linux-5.1.0-rc3-ge620d45065c7 Created: Thu May 2 00:30:38 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6007111 Bytes = 5866.32 KiB = 5.73 MiB Load Address: 00d00000 Entry Point: 00d002e8 Image Name: Linux-5.1.0-rc3-ge620d45065c7 Created: Thu May 2 00:30:38 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6007443 Bytes = 5866.64 KiB = 5.73 MiB Load Address: 00d00000 Entry Point: 00d002e8 Completed OK # rm -rf /kisskb/build/powerpc-next_mpc85xx_smp_defconfig_powerpc-gcc4.6 # Build took: 0:01:07.565863