~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/powerpc/platforms/pseries/rtas-fadump.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /*
  3  * Firmware-Assisted Dump support on POWERVM platform.
  4  *
  5  * Copyright 2011, Mahesh Salgaonkar, IBM Corporation.
  6  * Copyright 2019, Hari Bathini, IBM Corporation.
  7  */
  8 
  9 #ifndef _PSERIES_RTAS_FADUMP_H
 10 #define _PSERIES_RTAS_FADUMP_H
 11 
 12 /*
 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.
 18  */
 19 #define RTAS_FADUMP_MIN_BOOT_MEM        ((0x1UL << 28) + (0x1UL << 26))
 20 
 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
 25 
 26 /* OS defined sections */
 27 #define RTAS_FADUMP_PARAM_AREA          0x0100
 28 
 29 /* Dump request flag */
 30 #define RTAS_FADUMP_REQUEST_FLAG        0x00000001
 31 
 32 /* Dump status flag */
 33 #define RTAS_FADUMP_ERROR_FLAG          0x2000
 34 
 35 /*
 36  * The Firmware Assisted Dump Memory structure supports a maximum of 10 sections
 37  * in the dump memory structure. Presently, three sections are used for
 38  * CPU state data, HPTE & Parameters area, while the remaining seven sections
 39  * can be used for boot memory regions.
 40  */
 41 #define MAX_SECTIONS                            10
 42 #define RTAS_FADUMP_MAX_BOOT_MEM_REGS           7
 43 
 44 /* Kernel Dump section info */
 45 struct rtas_fadump_section {
 46         __be32  request_flag;
 47         __be16  source_data_type;
 48         __be16  error_flags;
 49         __be64  source_address;
 50         __be64  source_len;
 51         __be64  bytes_dumped;
 52         __be64  destination_address;
 53 };
 54 
 55 /* ibm,configure-kernel-dump header. */
 56 struct rtas_fadump_section_header {
 57         __be32  dump_format_version;
 58         __be16  dump_num_sections;
 59         __be16  dump_status_flag;
 60         __be32  offset_first_dump_section;
 61 
 62         /* Fields for disk dump option. */
 63         __be32  dd_block_size;
 64         __be64  dd_block_offset;
 65         __be64  dd_num_blocks;
 66         __be32  dd_offset_disk_path;
 67 
 68         /* Maximum time allowed to prevent an automatic dump-reboot. */
 69         __be32  max_time_auto;
 70 };
 71 
 72 /*
 73  * Firmware Assisted dump memory structure. This structure is required for
 74  * registering future kernel dump with power firmware through rtas call.
 75  *
 76  * In version 1, the platform permits one section header, dump-disk path
 77  * and ten sections.
 78  *
 79  * Note: No disk dump option. Hence disk dump path string section is not
 80  * included.
 81  */
 82 struct rtas_fadump_mem_struct {
 83         struct rtas_fadump_section_header       header;
 84         struct rtas_fadump_section              rgn[MAX_SECTIONS];
 85 };
 86 
 87 /*
 88  * The firmware-assisted dump format.
 89  *
 90  * The register save area is an area in the partition's memory used to preserve
 91  * the register contents (CPU state data) for the active CPUs during a firmware
 92  * assisted dump. The dump format contains register save area header followed
 93  * by register entries. Each list of registers for a CPU starts with "CPUSTRT"
 94  * and ends with "CPUEND".
 95  */
 96 
 97 /* Register save area header. */
 98 struct rtas_fadump_reg_save_area_header {
 99         __be64          magic_number;
100         __be32          version;
101         __be32          num_cpu_offset;
102 };
103 
104 /* Register entry. */
105 struct rtas_fadump_reg_entry {
106         __be64          reg_id;
107         __be64          reg_value;
108 };
109 
110 /* Utility macros */
111 #define RTAS_FADUMP_SKIP_TO_NEXT_CPU(reg_entry)                         \
112 ({                                                                      \
113         while (be64_to_cpu(reg_entry->reg_id) !=                        \
114                fadump_str_to_u64("CPUEND"))                             \
115                 reg_entry++;                                            \
116         reg_entry++;                                                    \
117 })
118 
119 #define RTAS_FADUMP_CPU_ID_MASK                 ((1UL << 32) - 1)
120 
121 #endif /* _PSERIES_RTAS_FADUMP_H */
122 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php