linux_dsm_epyc7002/arch/powerpc
Aneesh Kumar K.V a6e2c226c3 powerpc: Fix kernel crash in show_instructions() w/DEBUG_VIRTUAL
With CONFIG_DEBUG_VIRTUAL=y, we can hit a BUG() if we take a hard
lockup watchdog interrupt when in OPAL mode.

This happens in show_instructions() if the kernel takes the watchdog
NMI IPI, or any other interrupt, with MSR_IR == 0. show_instructions()
updates the variable pc in the loop and the second iteration will
result in BUG().

We hit the BUG_ON due the below check in  __va()

  #define __va(x)
  ({
  	VIRTUAL_BUG_ON((unsigned long)(x) >= PAGE_OFFSET);
  	(void *)(unsigned long)((phys_addr_t)(x) | PAGE_OFFSET);
  })

Fix it by moving the check out of the loop. Also update nip so that
the nip == pc check still matches.

Fixes: 4dd7554a64 ("powerpc/64: Add VIRTUAL_BUG_ON checks for __va and __pa addresses")
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
[mpe: Use IS_ENABLED(), massage change log]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200524093822.423487-1-aneesh.kumar@linux.ibm.com
2020-06-15 22:37:03 +10:00
..
boot powerpc/40x: Remove EP405 2020-05-28 23:24:35 +10:00
configs powerpc/configs: Add LIBNVDIMM to ppc64_defconfig 2020-06-02 20:59:08 +10:00
crypto crypto: lib/sha1 - remove unnecessary includes of linux/cryptohash.h 2020-05-08 15:32:17 +10:00
include MIPS: 2020-06-12 11:05:52 -07:00
kernel powerpc: Fix kernel crash in show_instructions() w/DEBUG_VIRTUAL 2020-06-15 22:37:03 +10:00
kexec powerpc/crash: Use NMI context for printk when starting to crash 2020-06-02 20:59:07 +10:00
kvm Kbuild updates for v5.8 (2nd) 2020-06-13 13:29:16 -07:00
lib mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
math-emu treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
mm arch/powerpc/mm/pgtable.c: another missed conversion 2020-06-10 14:44:46 -07:00
net treewide: Use sizeof_field() macro 2019-12-09 10:36:44 -08:00
oprofile mmap locking API: use coccinelle to convert mmap_sem rwsem call sites 2020-06-09 09:39:14 -07:00
perf mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
platforms Kbuild updates for v5.8 (2nd) 2020-06-13 13:29:16 -07:00
purgatory .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
sysdev mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
tools powerpc/head_check: Avoid broken pipe 2020-05-19 00:10:35 +10:00
xmon mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
Kbuild powerpc/kexec: Move kexec files into a dedicated subdir. 2019-11-21 15:41:34 +11:00
Kconfig powerpc updates for 5.8 2020-06-05 12:39:30 -07:00
Kconfig.debug powerpc: Remove Xilinx PPC405/PPC440 support 2020-05-28 23:24:34 +10:00
Makefile powerpc: Suppress .eh_frame generation 2020-04-01 14:30:51 +11:00
Makefile.postlink powerpc: Do not consider weak unresolved symbol relocations as bad 2020-01-31 20:17:22 +11:00