qemu-cr16/include/hw/ppc
Aditya Gupta 7e69675d7f
hw/ppc: Implement saving CPU state in Fadump
Kernel expects CPU states/register states in the format mentioned in
"Register Save Area" in PAPR.

The platform (in our case, QEMU) saves each CPU register in the form of
an array of "register entries", the start and end of this array is
signified by "CPUSTRT" and "CPUEND" register entries respectively.

The CPUSTRT and CPUEND register entry also has 4-byte logical CPU ID,
thus storing the CPU ID corresponding to the array of register entries.

Each register, and CPUSTRT, CPUEND has a predefined identifier.
Implement calculating identifier for a given register in
'fadump_str_to_u64', which has been taken from the linux kernel

Similarly GPRs also have predefined identifiers, and a corresponding
64-bit resiter value (split into two 32-bit cells). Implement
calculation of GPR identifiers with 'fadump_gpr_id_to_u64'

PAPR has restrictions on particular order of few registers, and is
free to be in any order for other registers.
Some registers mentioned in PAPR have not been exported as they are not
implemented in QEMU / don't make sense in QEMU.

Implement saving of CPU state according to the PAPR document

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-5-adityag@linux.ibm.com
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
2025-10-23 17:37:40 +05:30
..
fdt.h hw/ppc: Clean up local variable shadowing in _FDT helper routine 2023-09-29 10:07:17 +02:00
mac_dbdma.h include/system: Move exec/memory.h to system/memory.h 2025-04-23 14:08:21 -07:00
openpic.h ppc: spelling fixes 2023-09-20 07:54:34 +03:00
openpic_kvm.h
pnv.h ppc/pnv: Add XIVE2 controller to Power11 2025-09-28 23:22:06 +05:30
pnv_adu.h ppc/pnv: Implement ADU access to LPC space 2024-07-26 09:21:06 +10:00
pnv_chip.h ppc/pnv: Add PnvChipClass handler to get reference to interrupt controller 2025-09-28 23:22:06 +05:30
pnv_chiptod.h ppc/pnv: Add ChipTOD model for Power11 2025-09-28 23:22:06 +05:30
pnv_core.h ppc/pnv: Add an LPAR per core machine option 2024-07-26 09:21:06 +10:00
pnv_homer.h ppc/pnv: Make HOMER memory a RAM region 2025-03-11 22:43:30 +10:00
pnv_i2c.h ppc/pnv: Add an I2C controller model 2023-11-07 15:49:41 -03:00
pnv_lpc.h include/system: Move exec/memory.h to system/memory.h 2025-04-23 14:08:21 -07:00
pnv_n1_chiplet.h hw/ppc: Add N1 chiplet model 2024-02-23 23:24:42 +10:00
pnv_nest_pervasive.h hw/ppc: Add pnv nest pervasive common chiplet model 2024-02-23 23:24:42 +10:00
pnv_occ.h include/system: Move exec/memory.h to system/memory.h 2025-04-23 14:08:21 -07:00
pnv_pnor.h ppc/pnv: Move the PNOR LPC address into struct PnvPnor 2025-03-20 19:58:10 +10:00
pnv_psi.h hw/ppc: Avoid using Monitor in pnv_psi_pic_print_info() 2024-06-19 12:40:49 +02:00
pnv_sbe.h include/system: Move exec/memory.h to system/memory.h 2025-04-23 14:08:21 -07:00
pnv_xive.h hw/ppc: Avoid using Monitor in pnv_xive2_pic_print_info() 2024-06-19 12:40:49 +02:00
pnv_xscom.h ppc/pnv: Introduce Pnv11Chip 2025-09-28 23:21:58 +05:30
ppc.h hw/ppc: Support for an IBM PPE42 CPU decrementer 2025-09-28 23:39:19 +05:30
ppc4xx.h include/system: Move exec/memory.h to system/memory.h 2025-04-23 14:08:21 -07:00
ppc_e500.h
spapr.h hw/ppc: Implement fadump register command 2025-10-23 17:37:39 +05:30
spapr_cpu_core.h ppc/spapr: remove deprecated machine pseries-2.12 2024-11-04 09:10:32 +10:00
spapr_drc.h include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
spapr_fadump.h hw/ppc: Implement saving CPU state in Fadump 2025-10-23 17:37:40 +05:30
spapr_irq.h ppc/spapr: remove deprecated machine pseries-3.0 2025-10-23 17:37:16 +05:30
spapr_nested.h spapr: nested: Add support for reporting Hostwide state counter 2025-03-11 22:43:32 +10:00
spapr_numa.h spapr: move FORM1 verifications to post CAS 2021-09-30 12:26:06 +10:00
spapr_nvdimm.h spapr: nvdimm: Implement H_SCM_FLUSH hcall 2022-02-18 08:34:14 +01:00
spapr_ovec.h spapr_numa.c: FORM2 NUMA affinity support 2021-09-30 12:26:06 +10:00
spapr_tpm_proxy.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
spapr_vio.h include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
spapr_xive.h spapr/xive: Make spapr_xive_pic_print_info() static 2021-01-06 11:09:59 +11:00
vof.h include/system: Move exec/address-spaces.h to system/address-spaces.h 2025-04-23 14:08:21 -07:00
xics.h include/system: Move exec/memory.h to system/memory.h 2025-04-23 14:08:21 -07:00
xics_spapr.h spapr/xics: Drop unused argument to xics_kvm_has_broken_disconnect() 2020-12-14 15:50:55 +11:00
xive.h ppc/xive: Check TIMA operations validity 2025-07-21 08:03:53 +02:00
xive2.h ppc/xive2: Implement PHYS ring VP push TIMA op 2025-07-21 08:03:53 +02:00
xive2_regs.h ppc/xive2: implement NVP context save restore for POOL ring 2025-07-21 08:03:53 +02:00
xive_regs.h ppc/xive2: Add grouping level to notification 2025-03-11 22:43:31 +10:00