# git rev-parse -q --verify 590ce02bd148cd35721560c140e3759e39a6e56a^{commit} 590ce02bd148cd35721560c140e3759e39a6e56a already have revision, skipping fetch # git checkout -q -f -B kisskb 590ce02bd148cd35721560c140e3759e39a6e56a # git clean -qxdf # < git log -1 # commit 590ce02bd148cd35721560c140e3759e39a6e56a # Author: Nicholas Piggin # Date: Wed Jul 22 17:34:37 2020 +1000 # # powerpc/64s: Fix irq tracing corruption in interrupt/syscall return caused by perf interrupts # # Alexey reports lockdep_assert_irqs_enabled() warnings when stress # testing perf, e.g., # # WARNING: CPU: 0 PID: 1556 at kernel/softirq.c:169 __local_bh_enable_ip+0x258/0x270 # CPU: 0 PID: 1556 Comm: syz-executor # NIP: c0000000001ec888 LR: c0000000001ec884 CTR: c000000000ef0610 # REGS: c000000022d4f8a0 TRAP: 0700 Not tainted (5.8.0-rc3-x) # MSR: 8000000000029033 CR: 28008844 XER: 20040000 # CFAR: c0000000001dc1d0 IRQMASK: 0 # # The interesting thing is MSR[EE] and IRQMASK shows interrupts are # enabled, suggesting the current->hardirqs_enabled irq tracing state is # going out of sync with the actual interrupt enable state. # # The cause is a window in interrupt/syscall return where irq tracing # state is being adjusted for an irqs-enabled return while MSR[EE] is # still enabled. A perf interrupt hits and ends up calling # trace_hardirqs_off() when restoring interrupt flags to a disable # state. # # Fix this by disabling perf interrupts as well while adjusting irq # tracing state. # # Add a debug check that catches the condition sooner. # # Fixes: 68b34588e202 ("powerpc/64/sycall: Implement syscall entry/exit logic in C") # Cc: stable@vger.kernel.org # v5.7+ # Reported-by: Alexey Kardashevskiy # Signed-off-by: Nicholas Piggin # Signed-off-by: Michael Ellerman # Link: https://lore.kernel.org/r/20200722073437.930521-1-npiggin@gmail.com # < /opt/cross/kisskb/korg/gcc-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux-ld --version # < git log --format=%s --max-count=1 590ce02bd148cd35721560c140e3759e39a6e56a # < make -s -j 48 ARCH=powerpc O=/kisskb/build/powerpc-fixes_ppc44x_defconfig_powerpc-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux- ppc44x_defconfig # < make -s -j 48 ARCH=powerpc O=/kisskb/build/powerpc-fixes_ppc44x_defconfig_powerpc-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux- help # make -s -j 48 ARCH=powerpc O=/kisskb/build/powerpc-fixes_ppc44x_defconfig_powerpc-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux- olddefconfig # make -s -j 48 ARCH=powerpc O=/kisskb/build/powerpc-fixes_ppc44x_defconfig_powerpc-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux- /kisskb/src/block/genhd.c: In function 'diskstats_show': /kisskb/src/block/genhd.c:1623:1: warning: the frame size of 1160 bytes is larger than 1024 bytes [-Wframe-larger-than=] } ^ /kisskb/src/lib/zstd/compress.c: In function 'ZSTD_compressBlock_doubleFast': /kisskb/src/lib/zstd/compress.c:1393:1: warning: the frame size of 1384 bytes is larger than 1024 bytes [-Wframe-larger-than=] } ^ /kisskb/src/arch/powerpc/boot/dts/katmai.dts:322.26-361.5: Warning (pci_bridge): /plb/pciex@d00000000: node name is not "pci" or "pcie" /kisskb/src/arch/powerpc/boot/dts/katmai.dts:363.26-402.5: Warning (pci_bridge): /plb/pciex@d20000000: node name is not "pci" or "pcie" /kisskb/src/arch/powerpc/boot/dts/katmai.dts:404.26-443.5: Warning (pci_bridge): /plb/pciex@d40000000: node name is not "pci" or "pcie" arch/powerpc/boot/dts/katmai.dtb: Warning (pci_device_bus_num): Failed prerequisite 'pci_bridge' INFO: Uncompressed kernel (size 0x5bf5e0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5bf5e0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5bf5e0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5bf5e0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5bf5e0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5bf5e0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5bf5e0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5bf5e0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5bf5e0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5bf5e0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5bf5e0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) Image Name: Linux-5.8.0-rc2-g590ce02bd148 Created: Fri Jul 24 02:13:21 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2968977 Bytes = 2899.39 KiB = 2.83 MiB Load Address: 00600000 Entry Point: 006014a8 Image Name: Linux-5.8.0-rc2-g590ce02bd148 Created: Fri Jul 24 02:13:21 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2968725 Bytes = 2899.15 KiB = 2.83 MiB Load Address: 00600000 Entry Point: 006014a0 Image Name: Linux-5.8.0-rc2-g590ce02bd148 Created: Fri Jul 24 02:13:21 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2968952 Bytes = 2899.37 KiB = 2.83 MiB Load Address: 00600000 Entry Point: 006000c4 Image Name: Linux-5.8.0-rc2-g590ce02bd148 Created: Fri Jul 24 02:13:21 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2968409 Bytes = 2898.84 KiB = 2.83 MiB Load Address: 00600000 Entry Point: 006014b8 Image Name: Linux-5.8.0-rc2-g590ce02bd148 Created: Fri Jul 24 02:13:21 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2968468 Bytes = 2898.89 KiB = 2.83 MiB Load Address: 00600000 Entry Point: 006014a8 Image Name: Linux-5.8.0-rc2-g590ce02bd148 Created: Fri Jul 24 02:13:21 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2968381 Bytes = 2898.81 KiB = 2.83 MiB Load Address: 00600000 Entry Point: 00601498 Image Name: Linux-5.8.0-rc2-g590ce02bd148 Created: Fri Jul 24 02:13:21 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2968117 Bytes = 2898.55 KiB = 2.83 MiB Load Address: 00600000 Entry Point: 006014a8 Image Name: Linux-5.8.0-rc2-g590ce02bd148 Created: Fri Jul 24 02:13:21 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2968325 Bytes = 2898.75 KiB = 2.83 MiB Load Address: 00600000 Entry Point: 006001b8 Image Name: Linux-5.8.0-rc2-g590ce02bd148 Created: Fri Jul 24 02:13:21 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2969006 Bytes = 2899.42 KiB = 2.83 MiB Load Address: 00600000 Entry Point: 00601488 Completed OK # rm -rf /kisskb/build/powerpc-fixes_ppc44x_defconfig_powerpc-gcc4.9 # Build took: 0:01:03.277405