# 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-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux-ld --version # < git log --format=%s --max-count=1 590ce02bd148cd35721560c140e3759e39a6e56a # < make -s -j 80 ARCH=powerpc O=/kisskb/build/powerpc-fixes_mpc85xx_defconfig+KVM_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- mpc85xx_defconfig # Added to kconfig CONFIG_PPC_E500MC=y # Added to kconfig CONFIG_VIRTUALIZATION=y # Added to kconfig CONFIG_KVM_E500MC=y # Added to kconfig # < make -s -j 80 ARCH=powerpc O=/kisskb/build/powerpc-fixes_mpc85xx_defconfig+KVM_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- help # make -s -j 80 ARCH=powerpc O=/kisskb/build/powerpc-fixes_mpc85xx_defconfig+KVM_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- olddefconfig .config:4107:warning: override: reassigning to symbol PPC_E500MC .config:4108:warning: override: reassigning to symbol VIRTUALIZATION # make -s -j 80 ARCH=powerpc O=/kisskb/build/powerpc-fixes_mpc85xx_defconfig+KVM_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- In file included from /kisskb/src/include/linux/kernel.h:11, 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] 22 | #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' 78 | # 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' 139 | if (IS_ERR_VALUE(fep->ring_mem_addr)) | ^~~~~~~~~~~~ /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) /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) INFO: Uncompressed kernel (size 0xe95790) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xf00000) INFO: Uncompressed kernel (size 0xe95790) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xf00000) INFO: Uncompressed kernel (size 0xe95790) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xf00000) INFO: Uncompressed kernel (size 0xe95790) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xf00000) INFO: Uncompressed kernel (size 0xe95790) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xf00000) INFO: Uncompressed kernel (size 0xe95790) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xf00000) INFO: Uncompressed kernel (size 0xe95790) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xf00000) INFO: Uncompressed kernel (size 0xe95790) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xf00000) INFO: Uncompressed kernel (size 0xe95790) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xf00000) INFO: Uncompressed kernel (size 0xe95790) overlaps the address of the wrapper(0x400000) INFO: Uncompressed kernel (size 0xe95790) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xf00000) INFO: Fixing the link_address of wrapper to (0xf00000) INFO: Uncompressed kernel (size 0xe95790) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xf00000) INFO: Uncompressed kernel (size 0xe95790) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xf00000) INFO: Uncompressed kernel (size 0xe95790) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xf00000) INFO: Uncompressed kernel (size 0xe95790) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xf00000) INFO: Uncompressed kernel (size 0xe84f8c) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xf00000) Image Name: Linux-5.8.0-rc2-g590ce02bd148 Created: Fri Jul 24 01:05:35 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6782853 Bytes = 6623.88 KiB = 6.47 MiB Load Address: 00000000 Entry Point: 00000000 Image Name: Linux-5.8.0-rc2-g590ce02bd148 Created: Fri Jul 24 01:05:36 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6817598 Bytes = 6657.81 KiB = 6.50 MiB Load Address: 00f00000 Entry Point: 00f0031c Image Name: Linux-5.8.0-rc2-g590ce02bd148 Created: Fri Jul 24 01:05:36 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6817451 Bytes = 6657.67 KiB = 6.50 MiB Load Address: 00f00000 Entry Point: 00f002cc Image Name: Linux-5.8.0-rc2-g590ce02bd148 Created: Fri Jul 24 01:05:36 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6817658 Bytes = 6657.87 KiB = 6.50 MiB Load Address: 00f00000 Entry Point: 00f0031c Image Name: Linux-5.8.0-rc2-g590ce02bd148 Created: Fri Jul 24 01:05:36 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6818220 Bytes = 6658.42 KiB = 6.50 MiB Load Address: 00f00000 Entry Point: 00f002cc Image Name: Linux-5.8.0-rc2-g590ce02bd148 Created: Fri Jul 24 01:05:36 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6817458 Bytes = 6657.67 KiB = 6.50 MiB Load Address: 00f00000 Entry Point: 00f0031c Image Name: Linux-5.8.0-rc2-g590ce02bd148 Created: Fri Jul 24 01:05:36 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6817590 Bytes = 6657.80 KiB = 6.50 MiB Load Address: 00f00000 Entry Point: 00f002cc Image Name: Linux-5.8.0-rc2-g590ce02bd148 Created: Fri Jul 24 01:05:36 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6817402 Bytes = 6657.62 KiB = 6.50 MiB Load Address: 00f00000 Entry Point: 00f002cc Image Name: Linux-5.8.0-rc2-g590ce02bd148 Created: Fri Jul 24 01:05:36 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6817716 Bytes = 6657.93 KiB = 6.50 MiB Load Address: 00f00000 Entry Point: 00f002cc Image Name: Linux-5.8.0-rc2-g590ce02bd148 Created: Fri Jul 24 01:05:36 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6817567 Bytes = 6657.78 KiB = 6.50 MiB Load Address: 00f00000 Entry Point: 00f0031c Image Name: Linux-5.8.0-rc2-g590ce02bd148 Created: Fri Jul 24 01:05:36 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6817450 Bytes = 6657.67 KiB = 6.50 MiB Load Address: 00f00000 Entry Point: 00f002cc Image Name: Linux-5.8.0-rc2-g590ce02bd148 Created: Fri Jul 24 01:05:36 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6818286 Bytes = 6658.48 KiB = 6.50 MiB Load Address: 00f00000 Entry Point: 00f002cc Image Name: Linux-5.8.0-rc2-g590ce02bd148 Created: Fri Jul 24 01:05:36 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6817509 Bytes = 6657.72 KiB = 6.50 MiB Load Address: 00f00000 Entry Point: 00f002cc Image Name: Linux-5.8.0-rc2-g590ce02bd148 Created: Fri Jul 24 01:05:36 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6818175 Bytes = 6658.37 KiB = 6.50 MiB Load Address: 00f00000 Entry Point: 00f002cc Image Name: Linux-5.8.0-rc2-g590ce02bd148 Created: Fri Jul 24 01:05:36 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6817460 Bytes = 6657.68 KiB = 6.50 MiB Load Address: 00f00000 Entry Point: 00f0031c Image Name: Linux-5.8.0-rc2-g590ce02bd148 Created: Fri Jul 24 01:05:36 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6818110 Bytes = 6658.31 KiB = 6.50 MiB Load Address: 00f00000 Entry Point: 00f002cc Completed OK # rm -rf /kisskb/build/powerpc-fixes_mpc85xx_defconfig+KVM_powerpc-gcc9 # Build took: 0:02:47.278518