1# SPDX-License-Identifier: GPL-2.0-only 2config PSTORE 3 tristate "Persistent store support" 4 default n 5 help 6 This option enables generic access to platform level 7 persistent storage via "pstore" filesystem that can 8 be mounted as /dev/pstore. Only useful if you have 9 a platform level driver that registers with pstore to 10 provide the data, so you probably should just go say "Y" 11 (or "M") to a platform specific persistent store driver 12 (e.g. ACPI_APEI on X86) which will select this for you. 13 If you don't have a platform persistent store driver, 14 say N. 15 16config PSTORE_DEFLATE_COMPRESS 17 tristate "DEFLATE (ZLIB) compression" 18 default y 19 depends on PSTORE 20 select CRYPTO_DEFLATE 21 help 22 This option enables DEFLATE (also known as ZLIB) compression 23 algorithm support. 24 25 26config PSTORE_DEFAULT_KMSG_BYTES 27 int "Default kernel log storage space" if EXPERT 28 depends on PSTORE 29 default "10240" 30 help 31 Defines default size of pstore kernel log storage. 32 Can be enlarged if needed, not recommended to shrink it. 33 34config PSTORE_COMPRESS 35 bool "Pstore compression (deflate)" 36 depends on PSTORE 37 select ZLIB_INFLATE 38 select ZLIB_DEFLATE 39 default y 40 help 41 Whether pstore records should be compressed before being written to 42 the backing store. This is implemented using the zlib 'deflate' 43 algorithm, using the library implementation instead of using the full 44 blown crypto API. This reduces the risk of secondary oopses or other 45 problems while pstore is recording panic metadata. 46 47choice 48 prompt "Default pstore compression algorithm" 49 depends on PSTORE_COMPRESS 50 help 51 This option chooses the default active compression algorithm. 52 This change be changed at boot with "pstore.compress=..." on 53 the kernel command line. 54 55 Currently, pstore has support for 6 compression algorithms: 56 deflate, lzo, lz4, lz4hc, 842 and zstd. 57 58 The default compression algorithm is deflate. 59 config PSTORE_DEFLATE_COMPRESS_DEFAULT 60 bool "deflate" if PSTORE_DEFLATE_COMPRESS 61endchoice 62config PSTORE_COMPRESS_DEFAULT 63 string 64 depends on PSTORE_COMPRESS 65 default "deflate" if PSTORE_DEFLATE_COMPRESS_DEFAULT 66 67config PSTORE_CONSOLE 68 bool "Log kernel console messages" 69 depends on PSTORE 70 help 71 When the option is enabled, pstore will log all kernel 72 messages, even if no oops or panic happened. 73 74config PSTORE_PMSG 75 bool "Log user space messages" 76 depends on PSTORE 77 select RT_MUTEXES 78 help 79 When the option is enabled, pstore will export a character 80 interface /dev/pmsg0 to log user space messages. On reboot 81 data can be retrieved from /sys/fs/pstore/pmsg-ramoops-[ID]. 82 83 If unsure, say N. 84 85config PSTORE_FTRACE 86 bool "Persistent function tracer" 87 depends on PSTORE 88 depends on FUNCTION_TRACER 89 depends on DEBUG_FS 90 help 91 With this option kernel traces function calls into a persistent 92 ram buffer that can be decoded and dumped after reboot through 93 pstore filesystem. It can be used to determine what function 94 was last called before a reset or panic. 95 96 If unsure, say N. 97 98config PSTORE_BLACKBOX 99 bool "Store customised fault log" 100 depends on PSTORE 101 depends on BLACKBOX 102 help 103 Enable storing the customised fault log for BlackBox. 104 105 With the option enabled, pstore will store the customised kernel 106 fault log for BlackBox when oops or panic happened. 107 108 If unsure, say N. 109 110config PSTORE_RAM 111 tristate "Log panic/oops to a RAM buffer" 112 depends on PSTORE 113 depends on HAS_IOMEM 114 select REED_SOLOMON 115 select REED_SOLOMON_ENC8 116 select REED_SOLOMON_DEC8 117 help 118 This enables panic and oops messages to be logged to a circular 119 buffer in RAM where it can be read back at some later point. 120 121 Note that for historical reasons, the module will be named 122 "ramoops.ko". 123 124 For more information, see Documentation/admin-guide/ramoops.rst. 125 126config PSTORE_ZONE 127 tristate 128 depends on PSTORE 129 help 130 The common layer for pstore/blk (and pstore/ram in the future) 131 to manage storage in zones. 132 133config PSTORE_BLK 134 tristate "Log panic/oops to a block device" 135 depends on PSTORE 136 depends on BLOCK 137 select PSTORE_ZONE 138 default n 139 help 140 This enables panic and oops message to be logged to a block dev 141 where it can be read back at some later point. 142 143 For more information, see Documentation/admin-guide/pstore-blk.rst 144 145 If unsure, say N. 146 147config PSTORE_BLK_BLKDEV 148 string "block device identifier" 149 depends on PSTORE_BLK 150 default "" 151 help 152 Which block device should be used for pstore/blk. 153 154 It accepts the following variants: 155 1) <hex_major><hex_minor> device number in hexadecimal representation, 156 with no leading 0x, for example b302. 157 2) /dev/<disk_name> represents the device name of disk 158 3) /dev/<disk_name><decimal> represents the device name and number 159 of partition - device number of disk plus the partition number 160 4) /dev/<disk_name>p<decimal> - same as the above, this form is 161 used when disk name of partitioned disk ends with a digit. 162 5) PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF representing the 163 unique id of a partition if the partition table provides it. 164 The UUID may be either an EFI/GPT UUID, or refer to an MSDOS 165 partition using the format SSSSSSSS-PP, where SSSSSSSS is a zero- 166 filled hex representation of the 32-bit "NT disk signature", and PP 167 is a zero-filled hex representation of the 1-based partition number. 168 6) PARTUUID=<UUID>/PARTNROFF=<int> to select a partition in relation 169 to a partition with a known unique id. 170 7) <major>:<minor> major and minor number of the device separated by 171 a colon. 172 173 NOTE that, both Kconfig and module parameters can configure 174 pstore/blk, but module parameters have priority over Kconfig. 175 176config PSTORE_BLK_KMSG_SIZE 177 int "Size in Kbytes of kmsg dump log to store" 178 depends on PSTORE_BLK 179 default 64 180 help 181 This just sets size of kmsg dump (oops, panic, etc) log for 182 pstore/blk. The size is in KB and must be a multiple of 4. 183 184 NOTE that, both Kconfig and module parameters can configure 185 pstore/blk, but module parameters have priority over Kconfig. 186 187config PSTORE_BLK_MAX_REASON 188 int "Maximum kmsg dump reason to store" 189 depends on PSTORE_BLK 190 default 2 191 help 192 The maximum reason for kmsg dumps to store. The default is 193 2 (KMSG_DUMP_OOPS), see include/linux/kmsg_dump.h's 194 enum kmsg_dump_reason for more details. 195 196 NOTE that, both Kconfig and module parameters can configure 197 pstore/blk, but module parameters have priority over Kconfig. 198 199config PSTORE_BLK_PMSG_SIZE 200 int "Size in Kbytes of pmsg to store" 201 depends on PSTORE_BLK 202 depends on PSTORE_PMSG 203 default 64 204 help 205 This just sets size of pmsg (pmsg_size) for pstore/blk. The size is 206 in KB and must be a multiple of 4. 207 208 NOTE that, both Kconfig and module parameters can configure 209 pstore/blk, but module parameters have priority over Kconfig. 210 211config PSTORE_BLK_CONSOLE_SIZE 212 int "Size in Kbytes of console log to store" 213 depends on PSTORE_BLK 214 depends on PSTORE_CONSOLE 215 default 64 216 help 217 This just sets size of console log (console_size) to store via 218 pstore/blk. The size is in KB and must be a multiple of 4. 219 220 NOTE that, both Kconfig and module parameters can configure 221 pstore/blk, but module parameters have priority over Kconfig. 222 223config PSTORE_BLK_FTRACE_SIZE 224 int "Size in Kbytes of ftrace log to store" 225 depends on PSTORE_BLK 226 depends on PSTORE_FTRACE 227 default 64 228 help 229 This just sets size of ftrace log (ftrace_size) for pstore/blk. The 230 size is in KB and must be a multiple of 4. 231 232 NOTE that, both Kconfig and module parameters can configure 233 pstore/blk, but module parameters have priority over Kconfig. 234 235config PSTORE_BLK_BLACKBOX_SIZE 236 int "Size in Kbytes of fault log for BlackBox to store" 237 depends on PSTORE_BLK 238 depends on PSTORE_BLACKBOX 239 default 64 240 help 241 This just sets size of fault log (blackbox_size) for pstore/blk. 242 The size is in KB and must be a multiple of 4. 243 244 NOTE that, both Kconfig and module parameters can configure 245 pstore/blk, but module parameters have priority over Kconfig. 246 247config PSTORE_BLACKBOX_STACK_SIZE 248 int "Default stack size for BlackBox" if EXPERT 249 depends on PSTORE 250 depends on PSTORE_BLACKBOX 251 default 1024 252 help 253 Defines default size of pstore stack size for blackbox. 254 Can be enlarged if needed. not recommended to shrink it. 255