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