0001 # SPDX-License-Identifier: GPL-2.0-only
0002 config PSTORE
0003 tristate "Persistent store support"
0004 select CRYPTO if PSTORE_COMPRESS
0005 default n
0006 help
0007 This option enables generic access to platform level
0008 persistent storage via "pstore" filesystem that can
0009 be mounted as /dev/pstore. Only useful if you have
0010 a platform level driver that registers with pstore to
0011 provide the data, so you probably should just go say "Y"
0012 (or "M") to a platform specific persistent store driver
0013 (e.g. ACPI_APEI on X86) which will select this for you.
0014 If you don't have a platform persistent store driver,
0015 say N.
0016
0017 config PSTORE_DEFAULT_KMSG_BYTES
0018 int "Default kernel log storage space" if EXPERT
0019 depends on PSTORE
0020 default "10240"
0021 help
0022 Defines default size of pstore kernel log storage.
0023 Can be enlarged if needed, not recommended to shrink it.
0024
0025 config PSTORE_DEFLATE_COMPRESS
0026 tristate "DEFLATE (ZLIB) compression"
0027 default y
0028 depends on PSTORE
0029 select CRYPTO_DEFLATE
0030 help
0031 This option enables DEFLATE (also known as ZLIB) compression
0032 algorithm support.
0033
0034 config PSTORE_LZO_COMPRESS
0035 tristate "LZO compression"
0036 depends on PSTORE
0037 select CRYPTO_LZO
0038 help
0039 This option enables LZO compression algorithm support.
0040
0041 config PSTORE_LZ4_COMPRESS
0042 tristate "LZ4 compression"
0043 depends on PSTORE
0044 select CRYPTO_LZ4
0045 help
0046 This option enables LZ4 compression algorithm support.
0047
0048 config PSTORE_LZ4HC_COMPRESS
0049 tristate "LZ4HC compression"
0050 depends on PSTORE
0051 select CRYPTO_LZ4HC
0052 help
0053 This option enables LZ4HC (high compression) mode algorithm.
0054
0055 config PSTORE_842_COMPRESS
0056 bool "842 compression"
0057 depends on PSTORE
0058 select CRYPTO_842
0059 help
0060 This option enables 842 compression algorithm support.
0061
0062 config PSTORE_ZSTD_COMPRESS
0063 bool "zstd compression"
0064 depends on PSTORE
0065 select CRYPTO_ZSTD
0066 help
0067 This option enables zstd compression algorithm support.
0068
0069 config PSTORE_COMPRESS
0070 def_bool y
0071 depends on PSTORE
0072 depends on PSTORE_DEFLATE_COMPRESS || PSTORE_LZO_COMPRESS || \
0073 PSTORE_LZ4_COMPRESS || PSTORE_LZ4HC_COMPRESS || \
0074 PSTORE_842_COMPRESS || PSTORE_ZSTD_COMPRESS
0075
0076 choice
0077 prompt "Default pstore compression algorithm"
0078 depends on PSTORE_COMPRESS
0079 help
0080 This option chooses the default active compression algorithm.
0081 This change be changed at boot with "pstore.compress=..." on
0082 the kernel command line.
0083
0084 Currently, pstore has support for 6 compression algorithms:
0085 deflate, lzo, lz4, lz4hc, 842 and zstd.
0086
0087 The default compression algorithm is deflate.
0088
0089 config PSTORE_DEFLATE_COMPRESS_DEFAULT
0090 bool "deflate" if PSTORE_DEFLATE_COMPRESS
0091
0092 config PSTORE_LZO_COMPRESS_DEFAULT
0093 bool "lzo" if PSTORE_LZO_COMPRESS
0094
0095 config PSTORE_LZ4_COMPRESS_DEFAULT
0096 bool "lz4" if PSTORE_LZ4_COMPRESS
0097
0098 config PSTORE_LZ4HC_COMPRESS_DEFAULT
0099 bool "lz4hc" if PSTORE_LZ4HC_COMPRESS
0100
0101 config PSTORE_842_COMPRESS_DEFAULT
0102 bool "842" if PSTORE_842_COMPRESS
0103
0104 config PSTORE_ZSTD_COMPRESS_DEFAULT
0105 bool "zstd" if PSTORE_ZSTD_COMPRESS
0106
0107 endchoice
0108
0109 config PSTORE_COMPRESS_DEFAULT
0110 string
0111 depends on PSTORE_COMPRESS
0112 default "deflate" if PSTORE_DEFLATE_COMPRESS_DEFAULT
0113 default "lzo" if PSTORE_LZO_COMPRESS_DEFAULT
0114 default "lz4" if PSTORE_LZ4_COMPRESS_DEFAULT
0115 default "lz4hc" if PSTORE_LZ4HC_COMPRESS_DEFAULT
0116 default "842" if PSTORE_842_COMPRESS_DEFAULT
0117 default "zstd" if PSTORE_ZSTD_COMPRESS_DEFAULT
0118
0119 config PSTORE_CONSOLE
0120 bool "Log kernel console messages"
0121 depends on PSTORE
0122 help
0123 When the option is enabled, pstore will log all kernel
0124 messages, even if no oops or panic happened.
0125
0126 config PSTORE_PMSG
0127 bool "Log user space messages"
0128 depends on PSTORE
0129 help
0130 When the option is enabled, pstore will export a character
0131 interface /dev/pmsg0 to log user space messages. On reboot
0132 data can be retrieved from /sys/fs/pstore/pmsg-ramoops-[ID].
0133
0134 If unsure, say N.
0135
0136 config PSTORE_FTRACE
0137 bool "Persistent function tracer"
0138 depends on PSTORE
0139 depends on FUNCTION_TRACER
0140 depends on DEBUG_FS
0141 help
0142 With this option kernel traces function calls into a persistent
0143 ram buffer that can be decoded and dumped after reboot through
0144 pstore filesystem. It can be used to determine what function
0145 was last called before a reset or panic.
0146
0147 If unsure, say N.
0148
0149 config PSTORE_RAM
0150 tristate "Log panic/oops to a RAM buffer"
0151 depends on PSTORE
0152 depends on HAS_IOMEM
0153 select REED_SOLOMON
0154 select REED_SOLOMON_ENC8
0155 select REED_SOLOMON_DEC8
0156 help
0157 This enables panic and oops messages to be logged to a circular
0158 buffer in RAM where it can be read back at some later point.
0159
0160 Note that for historical reasons, the module will be named
0161 "ramoops.ko".
0162
0163 For more information, see Documentation/admin-guide/ramoops.rst.
0164
0165 config PSTORE_ZONE
0166 tristate
0167 depends on PSTORE
0168 help
0169 The common layer for pstore/blk (and pstore/ram in the future)
0170 to manage storage in zones.
0171
0172 config PSTORE_BLK
0173 tristate "Log panic/oops to a block device"
0174 depends on PSTORE
0175 depends on BLOCK
0176 select PSTORE_ZONE
0177 default n
0178 help
0179 This enables panic and oops message to be logged to a block dev
0180 where it can be read back at some later point.
0181
0182 For more information, see Documentation/admin-guide/pstore-blk.rst
0183
0184 If unsure, say N.
0185
0186 config PSTORE_BLK_BLKDEV
0187 string "block device identifier"
0188 depends on PSTORE_BLK
0189 default ""
0190 help
0191 Which block device should be used for pstore/blk.
0192
0193 It accepts the following variants:
0194 1) <hex_major><hex_minor> device number in hexadecimal representation,
0195 with no leading 0x, for example b302.
0196 2) /dev/<disk_name> represents the device name of disk
0197 3) /dev/<disk_name><decimal> represents the device name and number
0198 of partition - device number of disk plus the partition number
0199 4) /dev/<disk_name>p<decimal> - same as the above, this form is
0200 used when disk name of partitioned disk ends with a digit.
0201 5) PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF representing the
0202 unique id of a partition if the partition table provides it.
0203 The UUID may be either an EFI/GPT UUID, or refer to an MSDOS
0204 partition using the format SSSSSSSS-PP, where SSSSSSSS is a zero-
0205 filled hex representation of the 32-bit "NT disk signature", and PP
0206 is a zero-filled hex representation of the 1-based partition number.
0207 6) PARTUUID=<UUID>/PARTNROFF=<int> to select a partition in relation
0208 to a partition with a known unique id.
0209 7) <major>:<minor> major and minor number of the device separated by
0210 a colon.
0211
0212 NOTE that, both Kconfig and module parameters can configure
0213 pstore/blk, but module parameters have priority over Kconfig.
0214
0215 config PSTORE_BLK_KMSG_SIZE
0216 int "Size in Kbytes of kmsg dump log to store"
0217 depends on PSTORE_BLK
0218 default 64
0219 help
0220 This just sets size of kmsg dump (oops, panic, etc) log for
0221 pstore/blk. The size is in KB and must be a multiple of 4.
0222
0223 NOTE that, both Kconfig and module parameters can configure
0224 pstore/blk, but module parameters have priority over Kconfig.
0225
0226 config PSTORE_BLK_MAX_REASON
0227 int "Maximum kmsg dump reason to store"
0228 depends on PSTORE_BLK
0229 default 2
0230 help
0231 The maximum reason for kmsg dumps to store. The default is
0232 2 (KMSG_DUMP_OOPS), see include/linux/kmsg_dump.h's
0233 enum kmsg_dump_reason for more details.
0234
0235 NOTE that, both Kconfig and module parameters can configure
0236 pstore/blk, but module parameters have priority over Kconfig.
0237
0238 config PSTORE_BLK_PMSG_SIZE
0239 int "Size in Kbytes of pmsg to store"
0240 depends on PSTORE_BLK
0241 depends on PSTORE_PMSG
0242 default 64
0243 help
0244 This just sets size of pmsg (pmsg_size) for pstore/blk. The size is
0245 in KB and must be a multiple of 4.
0246
0247 NOTE that, both Kconfig and module parameters can configure
0248 pstore/blk, but module parameters have priority over Kconfig.
0249
0250 config PSTORE_BLK_CONSOLE_SIZE
0251 int "Size in Kbytes of console log to store"
0252 depends on PSTORE_BLK
0253 depends on PSTORE_CONSOLE
0254 default 64
0255 help
0256 This just sets size of console log (console_size) to store via
0257 pstore/blk. The size is in KB and must be a multiple of 4.
0258
0259 NOTE that, both Kconfig and module parameters can configure
0260 pstore/blk, but module parameters have priority over Kconfig.
0261
0262 config PSTORE_BLK_FTRACE_SIZE
0263 int "Size in Kbytes of ftrace log to store"
0264 depends on PSTORE_BLK
0265 depends on PSTORE_FTRACE
0266 default 64
0267 help
0268 This just sets size of ftrace log (ftrace_size) for pstore/blk. The
0269 size is in KB and must be a multiple of 4.
0270
0271 NOTE that, both Kconfig and module parameters can configure
0272 pstore/blk, but module parameters have priority over Kconfig.