# git rev-parse -q --verify 75b49620267c700f0a07fec7f27f69852db70e46^{commit} 75b49620267c700f0a07fec7f27f69852db70e46 already have revision, skipping fetch # git checkout -q -f -B kisskb 75b49620267c700f0a07fec7f27f69852db70e46 # git clean -qxdf # < git log -1 # commit 75b49620267c700f0a07fec7f27f69852db70e46 # Author: Cédric Le Goater # Date: Thu Nov 5 14:47:13 2020 +0100 # # KVM: PPC: Book3S HV: XIVE: Fix possible oops when accessing ESB page # # When accessing the ESB page of a source interrupt, the fault handler # will retrieve the page address from the XIVE interrupt 'xive_irq_data' # structure. If the associated KVM XIVE interrupt is not valid, that is # not allocated at the HW level for some reason, the fault handler will # dereference a NULL pointer leading to the oops below : # # WARNING: CPU: 40 PID: 59101 at arch/powerpc/kvm/book3s_xive_native.c:259 xive_native_esb_fault+0xe4/0x240 [kvm] # CPU: 40 PID: 59101 Comm: qemu-system-ppc Kdump: loaded Tainted: G W --------- - - 4.18.0-240.el8.ppc64le #1 # NIP: c00800000e949fac LR: c00000000044b164 CTR: c00800000e949ec8 # REGS: c000001f69617840 TRAP: 0700 Tainted: G W --------- - - (4.18.0-240.el8.ppc64le) # MSR: 9000000000029033 CR: 44044282 XER: 00000000 # CFAR: c00000000044b160 IRQMASK: 0 # GPR00: c00000000044b164 c000001f69617ac0 c00800000e96e000 c000001f69617c10 # GPR04: 05faa2b21e000080 0000000000000000 0000000000000005 ffffffffffffffff # GPR08: 0000000000000000 0000000000000001 0000000000000000 0000000000000001 # GPR12: c00800000e949ec8 c000001ffffd3400 0000000000000000 0000000000000000 # GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 # GPR20: 0000000000000000 0000000000000000 c000001f5c065160 c000000001c76f90 # GPR24: c000001f06f20000 c000001f5c065100 0000000000000008 c000001f0eb98c78 # GPR28: c000001dcab40000 c000001dcab403d8 c000001f69617c10 0000000000000011 # NIP [c00800000e949fac] xive_native_esb_fault+0xe4/0x240 [kvm] # LR [c00000000044b164] __do_fault+0x64/0x220 # Call Trace: # [c000001f69617ac0] [0000000137a5dc20] 0x137a5dc20 (unreliable) # [c000001f69617b50] [c00000000044b164] __do_fault+0x64/0x220 # [c000001f69617b90] [c000000000453838] do_fault+0x218/0x930 # [c000001f69617bf0] [c000000000456f50] __handle_mm_fault+0x350/0xdf0 # [c000001f69617cd0] [c000000000457b1c] handle_mm_fault+0x12c/0x310 # [c000001f69617d10] [c00000000007ef44] __do_page_fault+0x264/0xbb0 # [c000001f69617df0] [c00000000007f8c8] do_page_fault+0x38/0xd0 # [c000001f69617e30] [c00000000000a714] handle_page_fault+0x18/0x38 # Instruction dump: # 40c2fff0 7c2004ac 2fa90000 409e0118 73e90001 41820080 e8bd0008 7c2004ac # 7ca90074 39400000 915c0000 7929d182 <0b090000> 2fa50000 419e0080 e89e0018 # ---[ end trace 66c6ff034c53f64f ]--- # xive-kvm: xive_native_esb_fault: accessing invalid ESB page for source 8 ! # # Fix that by checking the validity of the KVM XIVE interrupt structure. # # Fixes: 6520ca64cde7 ("KVM: PPC: Book3S HV: XIVE: Add a mapping for the source ESB pages") # Cc: stable@vger.kernel.org # v5.2+ # Reported-by: Greg Kurz # Signed-off-by: Cédric Le Goater # Tested-by: Greg Kurz # Signed-off-by: Michael Ellerman # Link: https://lore.kernel.org/r/20201105134713.656160-1-clg@kaod.org # < /opt/cross/kisskb/korg/gcc-4.9.4-nolibc/mips-linux/bin/mips-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-4.9.4-nolibc/mips-linux/bin/mips-linux-ld --version # < git log --format=%s --max-count=1 75b49620267c700f0a07fec7f27f69852db70e46 # < make -s -j 48 ARCH=mips O=/kisskb/build/powerpc-fixes_mips-defconfig_mips-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/mips-linux/bin/mips-linux- defconfig # < make -s -j 48 ARCH=mips O=/kisskb/build/powerpc-fixes_mips-defconfig_mips-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/mips-linux/bin/mips-linux- help # make -s -j 48 ARCH=mips O=/kisskb/build/powerpc-fixes_mips-defconfig_mips-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/mips-linux/bin/mips-linux- olddefconfig # make -s -j 48 ARCH=mips O=/kisskb/build/powerpc-fixes_mips-defconfig_mips-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/mips-linux/bin/mips-linux- /kisskb/src/drivers/net/ethernet/mscc/ocelot_vcap.c: In function 'is1_entry_set': /kisskb/src/drivers/net/ethernet/mscc/ocelot_vcap.c:755:11: warning: missing braces around initializer [-Wmissing-braces] struct ocelot_vcap_u16 etype = {0}; ^ /kisskb/src/drivers/net/ethernet/mscc/ocelot_vcap.c:755:11: warning: (near initialization for 'etype.value') [-Wmissing-braces] FIT description: Linux 5.10.0-rc2-65309-g75b49620267 Created: Tue Nov 17 22:59:01 2020 Image 0 (kernel@0) Description: Linux 5.10.0-rc2-65309-g75b49620267 Created: Tue Nov 17 22:59:01 2020 Type: Kernel Image Compression: gzip compressed Data Size: 5178108 Bytes = 5056.75 KiB = 4.94 MiB Architecture: MIPS OS: Linux Load Address: 0x80100000 Entry Point: 0x8097c360 Hash algo: sha1 Hash value: e064d15ac8a1a64c545dc7ceae34f0ab8d9d706d Image 1 (fdt@boston) Description: img,boston Device Tree Created: Tue Nov 17 22:59:01 2020 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: Tue Nov 17 22:59:01 2020 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: Tue Nov 17 22:59:01 2020 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: Tue Nov 17 22:59:01 2020 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: Tue Nov 17 22:59:01 2020 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@0 Configuration 1 (conf@boston) Description: Boston Linux kernel Kernel: kernel@0 FDT: fdt@boston Configuration 2 (conf@ni169445) Description: NI 169445 Linux Kernel Kernel: kernel@0 FDT: fdt@ni169445 Configuration 3 (conf@ocelot_pcb123) Description: Ocelot Linux kernel Kernel: kernel@0 FDT: fdt@ocelot_pcb123 Configuration 4 (conf@ocelot_pcb120) Description: Ocelot Linux kernel Kernel: kernel@0 FDT: fdt@ocelot_pcb120 Configuration 5 (conf@xilfpga) Description: MIPSfpga Linux kernel Kernel: kernel@0 FDT: fdt@xilfpga Completed OK # rm -rf /kisskb/build/powerpc-fixes_mips-defconfig_mips-gcc4.9 # Build took: 0:01:39.993555