# git rev-parse -q --verify 7c6986ade69e3c81bac831645bc72109cd798a80^{commit} 7c6986ade69e3c81bac831645bc72109cd798a80 already have revision, skipping fetch # git checkout -q -f -B kisskb 7c6986ade69e3c81bac831645bc72109cd798a80 # git clean -qxdf # < git log -1 # commit 7c6986ade69e3c81bac831645bc72109cd798a80 # Author: Michael Ellerman # Date: Fri Jun 25 16:28:41 2021 +1000 # # powerpc/stacktrace: Fix spurious "stale" traces in raise_backtrace_ipi() # # In raise_backtrace_ipi() we iterate through the cpumask of CPUs, sending # each an IPI asking them to do a backtrace, but we don't wait for the # backtrace to happen. # # We then iterate through the CPU mask again, and if any CPU hasn't done # the backtrace and cleared itself from the mask, we print a trace on its # behalf, noting that the trace may be "stale". # # This works well enough when a CPU is not responding, because in that # case it doesn't receive the IPI and the sending CPU is left to print the # trace. But when all CPUs are responding we are left with a race between # the sending and receiving CPUs, if the sending CPU wins the race then it # will erroneously print a trace. # # This leads to spurious "stale" traces from the sending CPU, which can # then be interleaved messily with the receiving CPU, note the CPU # numbers, eg: # # [ 1658.929157][ C7] rcu: Stack dump where RCU GP kthread last ran: # [ 1658.929223][ C7] Sending NMI from CPU 7 to CPUs 1: # [ 1658.929303][ C1] NMI backtrace for cpu 1 # [ 1658.929303][ C7] CPU 1 didn't respond to backtrace IPI, inspecting paca. # [ 1658.929362][ C1] CPU: 1 PID: 325 Comm: kworker/1:1H Tainted: G W E 5.13.0-rc2+ #46 # [ 1658.929405][ C7] irq_soft_mask: 0x01 in_mce: 0 in_nmi: 0 current: 325 (kworker/1:1H) # [ 1658.929465][ C1] Workqueue: events_highpri test_work_fn [test_lockup] # [ 1658.929549][ C7] Back trace of paca->saved_r1 (0xc0000000057fb400) (possibly stale): # [ 1658.929592][ C1] NIP: c00000000002cf50 LR: c008000000820178 CTR: c00000000002cfa0 # # To fix it, change the logic so that the sending CPU waits 5s for the # receiving CPU to print its trace. If the receiving CPU prints its trace # successfully then the sending CPU just continues, avoiding any spurious # "stale" trace. # # This has the added benefit of allowing all CPUs to print their traces in # order and avoids any interleaving of their output. # # Fixes: 5cc05910f26e ("powerpc/64s: Wire up arch_trigger_cpumask_backtrace()") # Cc: stable@vger.kernel.org # v4.18+ # Reported-by: Nathan Lynch # Signed-off-by: Michael Ellerman # Link: https://lore.kernel.org/r/20210625140408.3351173-1-mpe@ellerman.id.au # < /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/m68k-linux/bin/m68k-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/m68k-linux/bin/m68k-linux-ld --version # < git log --format=%s --max-count=1 7c6986ade69e3c81bac831645bc72109cd798a80 # < make -s -j 120 ARCH=m68k O=/kisskb/build/powerpc-next_m68k-defconfig_m68k-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/m68k-linux/bin/m68k-linux- defconfig # < make -s -j 120 ARCH=m68k O=/kisskb/build/powerpc-next_m68k-defconfig_m68k-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/m68k-linux/bin/m68k-linux- help # make -s -j 120 ARCH=m68k O=/kisskb/build/powerpc-next_m68k-defconfig_m68k-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/m68k-linux/bin/m68k-linux- olddefconfig # make -s -j 120 ARCH=m68k O=/kisskb/build/powerpc-next_m68k-defconfig_m68k-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/m68k-linux/bin/m68k-linux- /kisskb/src/arch/m68k/mvme16x/config.c: In function 'mvme16x_hwclk': /kisskb/src/arch/m68k/mvme16x/config.c:439:2: warning: #warning check me! [-Wcpp] #warning check me! ^~~~~~~ /kisskb/src/arch/m68k/mvme147/config.c: In function 'mvme147_hwclk': /kisskb/src/arch/m68k/mvme147/config.c:174:2: warning: #warning check me! [-Wcpp] #warning check me! ^~~~~~~ In file included from /kisskb/src/drivers/net/ethernet/8390/xsurf100.c:48: /kisskb/src/drivers/net/ethernet/8390/lib8390.c:995:27: warning: '____alloc_ei_netdev' defined but not used [-Wunused-function] static struct net_device *____alloc_ei_netdev(int size) ^~~~~~~~~~~~~~~~~~~ /kisskb/src/drivers/net/ethernet/8390/lib8390.c:957:13: warning: '__ei_set_multicast_list' defined but not used [-Wunused-function] static void __ei_set_multicast_list(struct net_device *dev) ^~~~~~~~~~~~~~~~~~~~~~~ /kisskb/src/drivers/net/ethernet/8390/lib8390.c:857:33: warning: '__ei_get_stats' defined but not used [-Wunused-function] static struct net_device_stats *__ei_get_stats(struct net_device *dev) ^~~~~~~~~~~~~~ /kisskb/src/drivers/net/ethernet/8390/lib8390.c:512:13: warning: '__ei_poll' defined but not used [-Wunused-function] static void __ei_poll(struct net_device *dev) ^~~~~~~~~ /kisskb/src/drivers/net/ethernet/8390/lib8390.c:303:20: warning: '__ei_start_xmit' defined but not used [-Wunused-function] static netdev_tx_t __ei_start_xmit(struct sk_buff *skb, ^~~~~~~~~~~~~~~ /kisskb/src/drivers/net/ethernet/8390/lib8390.c:257:13: warning: '__ei_tx_timeout' defined but not used [-Wunused-function] static void __ei_tx_timeout(struct net_device *dev, unsigned int txqueue) ^~~~~~~~~~~~~~~ /kisskb/src/drivers/net/ethernet/8390/lib8390.c:233:12: warning: '__ei_close' defined but not used [-Wunused-function] static int __ei_close(struct net_device *dev) ^~~~~~~~~~ /kisskb/src/drivers/net/ethernet/8390/lib8390.c:204:12: warning: '__ei_open' defined but not used [-Wunused-function] static int __ei_open(struct net_device *dev) ^~~~~~~~~ /kisskb/src/drivers/i2c/busses/i2c-icy.c: In function 'icy_probe': /kisskb/src/drivers/i2c/busses/i2c-icy.c:126:24: warning: unused variable 'new_fwnode' [-Wunused-variable] struct fwnode_handle *new_fwnode; ^~~~~~~~~~ Completed OK # rm -rf /kisskb/build/powerpc-next_m68k-defconfig_m68k-gcc8 # Build took: 0:01:10.470571