# git rev-parse -q --verify 4ff753feab021242144818b9a3ba011238218145^{commit} 4ff753feab021242144818b9a3ba011238218145 already have revision, skipping fetch # git checkout -q -f -B kisskb 4ff753feab021242144818b9a3ba011238218145 # git clean -qxdf # < git log -1 # commit 4ff753feab021242144818b9a3ba011238218145 # Author: Ganesh Goudar # Date: Fri Jul 24 12:09:46 2020 +0530 # # powerpc/pseries: Avoid using addr_to_pfn in real mode # # When an UE or memory error exception is encountered the MCE handler # tries to find the pfn using addr_to_pfn() which takes effective # address as an argument, later pfn is used to poison the page where # memory error occurred, recent rework in this area made addr_to_pfn # to run in real mode, which can be fatal as it may try to access # memory outside RMO region. # # Have two helper functions to separate things to be done in real mode # and virtual mode without changing any functionality. This also fixes # the following error as the use of addr_to_pfn is now moved to virtual # mode. # # Without this change following kernel crash is seen on hitting UE. # # [ 485.128036] Oops: Kernel access of bad area, sig: 11 [#1] # [ 485.128040] LE SMP NR_CPUS=2048 NUMA pSeries # [ 485.128047] Modules linked in: # [ 485.128067] CPU: 15 PID: 6536 Comm: insmod Kdump: loaded Tainted: G OE 5.7.0 #22 # [ 485.128074] NIP: c00000000009b24c LR: c0000000000398d8 CTR: c000000000cd57c0 # [ 485.128078] REGS: c000000003f1f970 TRAP: 0300 Tainted: G OE (5.7.0) # [ 485.128082] MSR: 8000000000001003 CR: 28008284 XER: 00000001 # [ 485.128088] CFAR: c00000000009b190 DAR: c0000001fab00000 DSISR: 40000000 IRQMASK: 1 # [ 485.128088] GPR00: 0000000000000001 c000000003f1fbf0 c000000001634300 0000b0fa01000000 # [ 485.128088] GPR04: d000000002220000 0000000000000000 00000000fab00000 0000000000000022 # [ 485.128088] GPR08: c0000001fab00000 0000000000000000 c0000001fab00000 c000000003f1fc14 # [ 485.128088] GPR12: 0000000000000008 c000000003ff5880 d000000002100008 0000000000000000 # [ 485.128088] GPR16: 000000000000ff20 000000000000fff1 000000000000fff2 d0000000021a1100 # [ 485.128088] GPR20: d000000002200000 c00000015c893c50 c000000000d49b28 c00000015c893c50 # [ 485.128088] GPR24: d0000000021a0d08 c0000000014e5da8 d0000000021a0818 000000000000000a # [ 485.128088] GPR28: 0000000000000008 000000000000000a c0000000017e2970 000000000000000a # [ 485.128125] NIP [c00000000009b24c] __find_linux_pte+0x11c/0x310 # [ 485.128130] LR [c0000000000398d8] addr_to_pfn+0x138/0x170 # [ 485.128133] Call Trace: # [ 485.128135] Instruction dump: # [ 485.128138] 3929ffff 7d4a3378 7c883c36 7d2907b4 794a1564 7d294038 794af082 3900ffff # [ 485.128144] 79291f24 790af00e 78e70020 7d095214 <7c69502a> 2fa30000 419e011c 70690040 # [ 485.128152] ---[ end trace d34b27e29ae0e340 ]--- # # Fixes: 9ca766f9891d ("powerpc/64s/pseries: machine check convert to use common event code") # Signed-off-by: Ganesh Goudar # Signed-off-by: Michael Ellerman # Link: https://lore.kernel.org/r/20200724063946.21378-1-ganeshgr@linux.ibm.com # < /opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux-ld --version # < git log --format=%s --max-count=1 4ff753feab021242144818b9a3ba011238218145 # < make -s -j 10 ARCH=powerpc O=/kisskb/build/powerpc-fixes_storcenter_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- storcenter_defconfig WARNING: unmet direct dependencies detected for PPC_INDIRECT_PCI Depends on [n]: PCI [=n] Selected by [y]: - MPC10X_BRIDGE [=y] WARNING: unmet direct dependencies detected for PPC_INDIRECT_PCI Depends on [n]: PCI [=n] Selected by [y]: - MPC10X_BRIDGE [=y] # < make -s -j 10 ARCH=powerpc O=/kisskb/build/powerpc-fixes_storcenter_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- help # make -s -j 10 ARCH=powerpc O=/kisskb/build/powerpc-fixes_storcenter_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- olddefconfig WARNING: unmet direct dependencies detected for PPC_INDIRECT_PCI Depends on [n]: PCI [=n] Selected by [y]: - MPC10X_BRIDGE [=y] WARNING: unmet direct dependencies detected for PPC_INDIRECT_PCI Depends on [n]: PCI [=n] Selected by [y]: - MPC10X_BRIDGE [=y] # make -s -j 10 ARCH=powerpc O=/kisskb/build/powerpc-fixes_storcenter_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- INFO: Uncompressed kernel (size 0x5c525c) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) Image Name: Linux-5.9.0-rc2-g4ff753feab02 Created: Fri Oct 23 18:24:57 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2686238 Bytes = 2623.28 KiB = 2.56 MiB Load Address: 00600000 Entry Point: 00600894 Completed OK # rm -rf /kisskb/build/powerpc-fixes_storcenter_defconfig_powerpc-gcc5 # Build took: 0:01:34.974303