linux-stable/arch/powerpc
Aditya Gupta 965a977369 powerpc/vmcore: Add MMU information to vmcoreinfo
[ Upstream commit 36e826b568 ]

Since below commit, address mapping for vmemmap has changed for Radix
MMU, where address mapping is stored in kernel page table itself,
instead of earlier used 'vmemmap_list'.

    commit 368a0590d9 ("powerpc/book3s64/vmemmap: switch radix to use
    a different vmemmap handling function")

Hence with upstream kernel, in case of Radix MMU, makedumpfile fails
to do address translation for vmemmap addresses, as it depended on
vmemmap_list, which can now be empty.

While fixing the address translation in makedumpfile, it was identified
that currently makedumpfile cannot distinguish between Hash MMU and
Radix MMU, unless VMLINUX is passed with -x flag to makedumpfile. And
hence fails to assign offsets and shifts correctly (such as in L4 to
PGDIR offset calculation in makedumpfile).

For getting the MMU, makedumpfile uses `cur_cpu_spec.mmu_features`.

Add `cur_cpu_spec` symbol and offset of `mmu_features` in the `cpu_spec`
struct, to VMCOREINFO, so that makedumpfile can assign the offsets
correctly, without needing a VMLINUX.

Also, even along with `cur_cpu_spec->mmu_features` makedumpfile has to
depend on the 'MMU_FTR_TYPE_RADIX' flag in mmu_features, implying kernel
developers need to be cautious of changes to 'MMU_FTR_*' defines.

A more stable approach was suggested in the below thread by contributors:
 https://lore.kernel.org/linuxppc-dev/20230920105706.853626-1-adityag@linux.ibm.com/

The suggestion was to add whether 'RADIX_MMU' is enabled in vmcoreinfo

This patch also implements the suggestion, by adding 'RADIX_MMU' in
vmcoreinfo, which makedumpfile can use to get whether the crashed system
had RADIX MMU (in which case 'NUMBER(RADIX_MMU)=1') or not (in which
case 'NUMBER(RADIX_MMU)=0')

Fixes: 368a0590d9 ("powerpc/book3s64/vmemmap: switch radix to use a different vmemmap handling function")
Reported-by: Sachin Sant <sachinp@linux.ibm.com>
Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231023072612.50874-1-adityag@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-20 11:59:29 +01:00
..
boot powerpc: dts: add missing space before { 2023-08-25 08:39:30 +10:00
configs Kbuild updates for v6.6 2023-09-05 11:01:47 -07:00
crypto This push fixes a random config build failure on powerpc. 2023-09-01 15:39:25 -07:00
include powerpc/40x: Remove stale PTE_ATOMIC_UPDATES macro 2023-11-20 11:59:28 +01:00
kernel powerpc: Hide empty pt_regs at base of the stack 2023-11-20 11:59:28 +01:00
kexec powerpc/vmcore: Add MMU information to vmcoreinfo 2023-11-20 11:59:29 +01:00
kvm powerpc updates for 6.6 2023-08-31 12:43:10 -07:00
lib powerpc/qspinlock: Fix stale propagated yield_cpu 2023-10-18 21:07:21 +11:00
math-emu
mm powerpc fixes for 6.6 #6 2023-10-27 05:40:42 -10:00
net powerpc/bpf: populate extable entries only during the last pass 2023-05-15 15:40:31 +10:00
perf powerpc/imc-pmu: Use the correct spinlock initializer. 2023-11-20 11:59:28 +01:00
platforms powerpc/pseries: fix potential memory leak in init_cpu_associativity() 2023-11-20 11:59:29 +01:00
purgatory powerpc/purgatory: remove PGO flags 2023-06-12 11:31:50 -07:00
sysdev powerpc/xive: Fix endian conversion size 2023-11-20 11:59:28 +01:00
tools powerpc/ftrace: Add support for -fpatchable-function-entry 2023-08-22 00:09:06 +10:00
xmon TTY/Serial driver changes for 6.6-rc1 2023-09-01 09:38:00 -07:00
Kbuild
Kconfig powerpc/mm: Allow ARCH_FORCE_MAX_ORDER up to 12 2023-10-15 20:55:03 +11:00
Kconfig.debug powerpc: allow PPC_EARLY_DEBUG_CPM only when SERIAL_CPM=y 2023-07-03 16:07:55 +10:00
Makefile powerpc/64s: Move CPU -mtune options into Kconfig 2023-08-25 08:39:29 +10:00
Makefile.postlink