qemu-cr16/hw/ppc
Aditya Gupta 041ed0e9ba
hw/ppc: Enable fadump for PSeries
With all support in place for preserving memory regions, enable fadump by
exporting the "ibm,kernel-dump" property in the device tree, representing
the fadump dump information, in case of a crash.

Currently "ibm,configure-kernel-dump" RTAS call is already registered,
which tells the kernel that the platform (QEMU) supports fadump.

Now, in case of a crash, if fadump was registered, we also pass
"ibm,kernel-dump" in device tree, which tells the kernel that the fadump
dump is active.

Pass "fadump=on" to enable Linux to use firmware assisted dump.

Logs of a linux boot with firmware assisted dump:

    $ ./build/qemu-system-ppc64 -M pseries,x-vof=on --cpu power10 --smp 4 -m 4G -kernel some-vmlinux -initrd some-initrd -append "debug fadump=on crashkernel=1G" -nographic

    [    0.000000] fadump: Reserved 1024MB of memory at 0x00000040000000 (System RAM: 4096MB)
    [    0.000000] fadump: Initialized 0x40000000 bytes cma area at 1024MB from 0x400102a8 bytes of memory reserved for firmware-assisted dump
    ...
    [    1.084686] rtas fadump: Registration is successful!
    ...
    # cat /sys/kernel/debug/powerpc/fadump_region
    CPU :[0x00000040000000-0x000000400013df] 0x13e0 bytes, Dumped: 0x0
    HPTE:[0x000000400013e0-0x000000400013df] 0x0 bytes, Dumped: 0x0
    DUMP: Src: 0x00000000000000, Dest: 0x00000040010000, Size: 0x40000000, Dumped: 0x0 bytes

    [0x0000000921a000-0x0000000921a7ff]: cmdline append: ''
    # echo c > /proc/sysrq-trigger

The fadump boot after crash:

    [    0.000000] rtas fadump: Firmware-assisted dump is active.
    [    0.000000] fadump: Updated cmdline: debug fadump=on crashkernel=1G
    [    0.000000] fadump: Firmware-assisted dump is active.
    [    0.000000] fadump: Reserving 3072MB of memory at 0x00000040000000 for preserving crash data
    ....
    # file /proc/vmcore
    /proc/vmcore: ELF 64-bit LSB core file, 64-bit PowerPC or cisco 7500, OpenPOWER ELF V2 ABI, version 1 (SYSV), SVR4-style

Analysing the vmcore with crash-utility:

          KERNEL: vmlinux-6.14-rc2
        DUMPFILE: vmcore-fc92fb373aa0
            CPUS: 4
            DATE: Wed Mar 12 23:39:23 CDT 2025
          UPTIME: 00:00:22
    LOAD AVERAGE: 0.13, 0.03, 0.01
           TASKS: 95
        NODENAME: buildroot
         RELEASE: 6.12.0-rc4+
         VERSION: #1 SMP Fri Jan  3 00:15:17 IST 2025
         MACHINE: ppc64le  (1000 Mhz)
          MEMORY: 4 GB
           PANIC: "Kernel panic - not syncing: sysrq triggered crash"
             PID: 269
         COMMAND: "sh"
            TASK: c00000000a050b00  [THREAD_INFO: c00000000a050b00]
             CPU: 0
           STATE: TASK_RUNNING (PANIC)

Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
Reviewed-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Tested-by: Shivang Upadhyay <shivangu@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20251021134823.1861675-7-adityag@linux.ibm.com
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
2025-10-23 17:37:41 +05:30
..
amigaone.c ppc/amigaone: Free allocated struct 2025-10-23 17:37:34 +05:30
e500-ccsr.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
e500.c hw/ppc/e500: Check for compatible CPU type instead of aborting ungracefully 2025-10-21 20:09:57 +02:00
e500.h hw/ppc/e500: Move clock and TB frequency to machine class 2025-06-10 12:59:09 +02:00
e500plat.c hw/ppc/e500: Move clock and TB frequency to machine class 2025-06-10 12:59:09 +02:00
fdt.c
fw_cfg.c
Kconfig hw/ppc: Add a test machine for the IBM PPE42 CPU 2025-09-28 23:39:52 +05:30
mac_newworld.c qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
mac_oldworld.c qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
meson.build hw/ppc: Implement fadump register command 2025-10-23 17:37:39 +05:30
mpc8544_guts.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
mpc8544ds.c hw/ppc/e500: Move clock and TB frequency to machine class 2025-06-10 12:59:09 +02:00
pef.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
pegasos2.c hw/ppc/pegasos2: Add VOF support for pegasos1 2025-10-23 17:37:39 +05:30
pnv.c ppc/pnv: Add ChipTOD model for Power11 2025-09-28 23:22:06 +05:30
pnv_adu.c qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
pnv_bmc.c ppc/pnv: Move the PNOR LPC address into struct PnvPnor 2025-03-20 19:58:10 +10:00
pnv_chiptod.c ppc/pnv: Add ChipTOD model for Power11 2025-09-28 23:22:06 +05:30
pnv_core.c ppc/pnv: Introduce Pnv11Chip 2025-09-28 23:21:58 +05:30
pnv_homer.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
pnv_i2c.c qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
pnv_lpc.c qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
pnv_n1_chiplet.c qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
pnv_nest_pervasive.c qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
pnv_occ.c hw/ppc/pnv_occ: skip automatic zero-init of large struct 2025-06-12 13:40:16 -04:00
pnv_pnor.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
pnv_psi.c qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
pnv_sbe.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
pnv_xscom.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
ppc.c cpus: properly kick CPUs out of inner execution loop 2025-09-17 19:00:55 +02:00
ppc4xx_devs.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
ppc4xx_sdram.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
ppc440.h ppc440: Remove ppc460ex_pcie_init legacy init function 2023-07-07 04:47:49 -03:00
ppc440_bamboo.c system/datadir: Add new type constant for DTB files 2025-04-25 17:09:58 +02:00
ppc440_uc.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
ppc_booke.c hw/ppc: Support for an IBM PPE42 CPU decrementer 2025-09-28 23:39:19 +05:30
ppce500_spin.c hw/ppc: Do not open-code cpu_resume() in spin_kick() 2025-10-13 21:00:09 +02:00
ppe42_machine.c hw/ppc: Add a test machine for the IBM PPE42 CPU 2025-09-28 23:39:52 +05:30
prep.c hw/ppc/prep: Always create prep-systemio 2025-10-21 20:16:47 +02:00
prep_systemio.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
rs6000_mc.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
sam460ex.c system/datadir: Add new type constant for DTB files 2025-04-25 17:09:58 +02:00
spapr.c hw/ppc: Enable fadump for PSeries 2025-10-23 17:37:41 +05:30
spapr_caps.c ppc/spapr: remove deprecated machine pseries-4.0 2025-10-23 17:37:33 +05:30
spapr_cpu_core.c qom: Constify TypeInfo::class_data 2025-04-25 17:00:41 +02:00
spapr_drc.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
spapr_events.c hw/ppc/spapr: Inline few SPAPR_IRQ_* uses 2025-10-23 17:37:31 +05:30
spapr_fadump.c hw/ppc: Pass dump-sizes property for fadump in device tree 2025-10-23 17:37:41 +05:30
spapr_hcall.c ppc/spapr: remove deprecated machine pseries-3.1 2025-10-23 17:37:31 +05:30
spapr_iommu.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
spapr_irq.c hw/ppc/spapr: Remove SpaprMachineClass::nr_xirqs field 2025-10-23 17:37:30 +05:30
spapr_nested.c include: Remove 'exec/exec-all.h' 2025-04-30 12:45:05 -07:00
spapr_numa.c spapr: Remove support for NVIDIA V100 GPU with NVLink2 2023-09-18 07:25:28 -03:00
spapr_nvdimm.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
spapr_ovec.c exec/cpu-all: remove system/memory include 2025-04-23 15:04:57 -07:00
spapr_pci.c ppc/spapr: remove deprecated machine pseries-3.0 2025-10-23 17:37:16 +05:30
spapr_pci_vfio.c include/hw/vfio/vfio-container.h: rename file to vfio-container-legacy.h 2025-09-25 17:55:19 +02:00
spapr_rng.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
spapr_rtas.c hw/ppc: Trigger Fadump boot if fadump is registered 2025-10-23 17:37:40 +05:30
spapr_rtas_ddw.c spapr/ddw: Implement 64bit query extension 2022-07-06 10:22:37 -03:00
spapr_rtc.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
spapr_tpm_proxy.c hw/ppc/spapr_tpm_proxy: skip automatic zero-init of large arrays 2025-06-12 13:40:16 -04:00
spapr_vhyp_mmu.c target/ppc: Unexport some functions from mmu-book3s-v3.h 2024-07-26 09:51:34 +10:00
spapr_vio.c ppc/spapr: remove deprecated machine pseries-3.0 2025-10-23 17:37:16 +05:30
spapr_vof.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
trace-events ppc/pnv: Begin a more complete ADU LPC model for POWER9/10 2024-07-26 09:21:06 +10:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
virtex_ml507.c system/datadir: Add new type constant for DTB files 2025-04-25 17:09:58 +02:00
vof.c ppc/vof: Make nextprop behave more like Open Firmware 2025-10-23 17:37:35 +05:30