1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Firmware-Assisted Dump support on POWERVM platform.
5 * Copyright 2011, Mahesh Salgaonkar, IBM Corporation.
6 * Copyright 2019, Hari Bathini, IBM Corporation.
9 #ifndef _PSERIES_RTAS_FADUMP_H
10 #define _PSERIES_RTAS_FADUMP_H
13 * On some Power systems where RMO is 128MB, it still requires minimum of
14 * 256MB for kernel to boot successfully. When kdump infrastructure is
15 * configured to save vmcore over network, we run into OOM issue while
16 * loading modules related to network setup. Hence we need additional 64M
17 * of memory to avoid OOM issue.
19 #define RTAS_FADUMP_MIN_BOOT_MEM ((0x1UL << 28) + (0x1UL << 26))
21 /* Firmware provided dump sections */
22 #define RTAS_FADUMP_CPU_STATE_DATA 0x0001
23 #define RTAS_FADUMP_HPTE_REGION 0x0002
24 #define RTAS_FADUMP_REAL_MODE_REGION 0x0011
26 /* Dump request flag */
27 #define RTAS_FADUMP_REQUEST_FLAG 0x00000001
29 /* Dump status flag */
30 #define RTAS_FADUMP_ERROR_FLAG 0x2000
32 /* Kernel Dump section info */
33 struct rtas_fadump_section
{
35 __be16 source_data_type
;
37 __be64 source_address
;
40 __be64 destination_address
;
43 /* ibm,configure-kernel-dump header. */
44 struct rtas_fadump_section_header
{
45 __be32 dump_format_version
;
46 __be16 dump_num_sections
;
47 __be16 dump_status_flag
;
48 __be32 offset_first_dump_section
;
50 /* Fields for disk dump option. */
52 __be64 dd_block_offset
;
54 __be32 dd_offset_disk_path
;
56 /* Maximum time allowed to prevent an automatic dump-reboot. */
61 * Firmware Assisted dump memory structure. This structure is required for
62 * registering future kernel dump with power firmware through rtas call.
64 * No disk dump option. Hence disk dump path string section is not included.
66 struct rtas_fadump_mem_struct
{
67 struct rtas_fadump_section_header header
;
69 /* Kernel dump sections */
70 struct rtas_fadump_section cpu_state_data
;
71 struct rtas_fadump_section hpte_region
;
74 * TODO: Extend multiple boot memory regions support in the kernel
77 struct rtas_fadump_section rmr_region
;
81 * The firmware-assisted dump format.
83 * The register save area is an area in the partition's memory used to preserve
84 * the register contents (CPU state data) for the active CPUs during a firmware
85 * assisted dump. The dump format contains register save area header followed
86 * by register entries. Each list of registers for a CPU starts with "CPUSTRT"
87 * and ends with "CPUEND".
90 /* Register save area header. */
91 struct rtas_fadump_reg_save_area_header
{
94 __be32 num_cpu_offset
;
98 struct rtas_fadump_reg_entry
{
104 #define RTAS_FADUMP_SKIP_TO_NEXT_CPU(reg_entry) \
106 while (be64_to_cpu(reg_entry->reg_id) != \
107 fadump_str_to_u64("CPUEND")) \
112 #define RTAS_FADUMP_CPU_ID_MASK ((1UL << 32) - 1)
114 #endif /* _PSERIES_RTAS_FADUMP_H */