# git rev-parse -q --verify 60b7ed54a41b550d50caf7f2418db4a7e75b5bdc^{commit} 60b7ed54a41b550d50caf7f2418db4a7e75b5bdc already have revision, skipping fetch # git checkout -q -f -B kisskb 60b7ed54a41b550d50caf7f2418db4a7e75b5bdc # git clean -qxdf # < git log -1 # commit 60b7ed54a41b550d50caf7f2418db4a7e75b5bdc # Author: Athira Rajeev # Date: Thu Jun 17 13:55:06 2021 -0400 # # powerpc/perf: Fix crash in perf_instruction_pointer() when ppmu is not set # # On systems without any specific PMU driver support registered, running # perf record causes Oops. # # The relevant portion from call trace: # # BUG: Kernel NULL pointer dereference on read at 0x00000040 # Faulting instruction address: 0xc0021f0c # Oops: Kernel access of bad area, sig: 11 [#1] # BE PAGE_SIZE=4K PREEMPT CMPCPRO # SAF3000 DIE NOTIFICATION # CPU: 0 PID: 442 Comm: null_syscall Not tainted 5.13.0-rc6-s3k-dev-01645-g7649ee3d2957 #5164 # NIP: c0021f0c LR: c00e8ad8 CTR: c00d8a5c # NIP perf_instruction_pointer+0x10/0x60 # LR perf_prepare_sample+0x344/0x674 # Call Trace: # perf_prepare_sample+0x7c/0x674 (unreliable) # perf_event_output_forward+0x3c/0x94 # __perf_event_overflow+0x74/0x14c # perf_swevent_hrtimer+0xf8/0x170 # __hrtimer_run_queues.constprop.0+0x160/0x318 # hrtimer_interrupt+0x148/0x3b0 # timer_interrupt+0xc4/0x22c # Decrementer_virt+0xb8/0xbc # # During perf record session, perf_instruction_pointer() is called to # capture the sample IP. This function in core-book3s accesses # ppmu->flags. If a platform specific PMU driver is not registered, ppmu # is set to NULL and accessing its members results in a crash. Fix this # crash by checking if ppmu is set. # # Fixes: 2ca13a4cc56c ("powerpc/perf: Use regs->nip when SIAR is zero") # Cc: stable@vger.kernel.org # v5.11+ # Reported-by: Christophe Leroy # Signed-off-by: Athira Rajeev # Tested-by: Christophe Leroy # Signed-off-by: Michael Ellerman # Link: https://lore.kernel.org/r/1623952506-1431-1-git-send-email-atrajeev@linux.vnet.ibm.com # < /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux-gcc --version # < /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux-ld --version # < git log --format=%s --max-count=1 60b7ed54a41b550d50caf7f2418db4a7e75b5bdc # < make -s -j 32 ARCH=mips O=/kisskb/build/powerpc-fixes_mips-defconfig_mipsel CROSS_COMPILE=/opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux- defconfig # < make -s -j 32 ARCH=mips O=/kisskb/build/powerpc-fixes_mips-defconfig_mipsel CROSS_COMPILE=/opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux- help # make -s -j 32 ARCH=mips O=/kisskb/build/powerpc-fixes_mips-defconfig_mipsel CROSS_COMPILE=/opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux- olddefconfig # make -s -j 32 ARCH=mips O=/kisskb/build/powerpc-fixes_mips-defconfig_mipsel CROSS_COMPILE=/opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux- FIT description: Linux 5.13.0-rc2-g60b7ed54a41b Created: Sun Jun 20 12:51:41 2021 Image 0 (kernel) Description: Linux 5.13.0-rc2-g60b7ed54a41b Created: Sun Jun 20 12:51:41 2021 Type: Kernel Image Compression: gzip compressed Data Size: 5350422 Bytes = 5225.02 KiB = 5.10 MiB Architecture: MIPS OS: Linux Load Address: 0x80100000 Entry Point: 0x809d0ab8 Hash algo: sha1 Hash value: 3819653d5f869f32c8ffec628ee828cf311e027f Image 1 (fdt-boston) Description: img,boston Device Tree Created: Sun Jun 20 12:51:41 2021 Type: Flat Device Tree Compression: uncompressed Data Size: 3793 Bytes = 3.70 KiB = 0.00 MiB Architecture: MIPS Hash algo: sha1 Hash value: 4799f50d688573234da6e9d7701234d394759ef4 Image 2 (fdt-ni169445) Description: NI 169445 device tree Created: Sun Jun 20 12:51:41 2021 Type: Flat Device Tree Compression: uncompressed Data Size: 1871 Bytes = 1.83 KiB = 0.00 MiB Architecture: MIPS Hash algo: sha1 Hash value: 51b89b31605ee62038c8468c429af091dfc75ec7 Image 3 (fdt-ocelot_pcb123) Description: MSCC Ocelot PCB123 Device Tree Created: Sun Jun 20 12:51:41 2021 Type: Flat Device Tree Compression: uncompressed Data Size: 4659 Bytes = 4.55 KiB = 0.00 MiB Architecture: MIPS Hash algo: sha1 Hash value: 5bcb6e4f21e8e5372544aa130b3bd097355a9050 Image 4 (fdt-ocelot_pcb120) Description: MSCC Ocelot PCB120 Device Tree Created: Sun Jun 20 12:51:41 2021 Type: Flat Device Tree Compression: uncompressed Data Size: 5418 Bytes = 5.29 KiB = 0.01 MiB Architecture: MIPS Hash algo: sha1 Hash value: 93d882f2009a217e0fa9dab94788535ed2be8476 Image 5 (fdt-xilfpga) Description: MIPSfpga (xilfpga) Device Tree Created: Sun Jun 20 12:51:41 2021 Type: Flat Device Tree Compression: uncompressed Data Size: 2708 Bytes = 2.64 KiB = 0.00 MiB Architecture: MIPS Hash algo: sha1 Hash value: 63d058b780f65e22da30f0a183433765f1807f1d Default Configuration: 'conf-default' Configuration 0 (conf-default) Description: Generic Linux kernel Kernel: kernel Configuration 1 (conf-boston) Description: Boston Linux kernel Kernel: kernel FDT: fdt-boston Configuration 2 (conf-ni169445) Description: NI 169445 Linux Kernel Kernel: kernel FDT: fdt-ni169445 Configuration 3 (conf-ocelot_pcb123) Description: Ocelot Linux kernel Kernel: kernel FDT: fdt-ocelot_pcb123 Configuration 4 (conf-ocelot_pcb120) Description: Ocelot Linux kernel Kernel: kernel FDT: fdt-ocelot_pcb120 Configuration 5 (conf-xilfpga) Description: MIPSfpga Linux kernel Kernel: kernel FDT: fdt-xilfpga Completed OK # rm -rf /kisskb/build/powerpc-fixes_mips-defconfig_mipsel # Build took: 0:01:55.051046