162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0-only
262306a36Sopenharmony_ciconfig PSTORE
362306a36Sopenharmony_ci	tristate "Persistent store support"
462306a36Sopenharmony_ci	default n
562306a36Sopenharmony_ci	help
662306a36Sopenharmony_ci	   This option enables generic access to platform level
762306a36Sopenharmony_ci	   persistent storage via "pstore" filesystem that can
862306a36Sopenharmony_ci	   be mounted as /dev/pstore.  Only useful if you have
962306a36Sopenharmony_ci	   a platform level driver that registers with pstore to
1062306a36Sopenharmony_ci	   provide the data, so you probably should just go say "Y"
1162306a36Sopenharmony_ci	   (or "M") to a platform specific persistent store driver
1262306a36Sopenharmony_ci	   (e.g. ACPI_APEI on X86) which will select this for you.
1362306a36Sopenharmony_ci	   If you don't have a platform persistent store driver,
1462306a36Sopenharmony_ci	   say N.
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ciconfig PSTORE_DEFAULT_KMSG_BYTES
1762306a36Sopenharmony_ci	int "Default kernel log storage space" if EXPERT
1862306a36Sopenharmony_ci	depends on PSTORE
1962306a36Sopenharmony_ci	default "10240"
2062306a36Sopenharmony_ci	help
2162306a36Sopenharmony_ci	  Defines default size of pstore kernel log storage.
2262306a36Sopenharmony_ci	  Can be enlarged if needed, not recommended to shrink it.
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ciconfig PSTORE_COMPRESS
2562306a36Sopenharmony_ci	bool "Pstore compression (deflate)"
2662306a36Sopenharmony_ci	depends on PSTORE
2762306a36Sopenharmony_ci	select ZLIB_INFLATE
2862306a36Sopenharmony_ci	select ZLIB_DEFLATE
2962306a36Sopenharmony_ci	default y
3062306a36Sopenharmony_ci	help
3162306a36Sopenharmony_ci	  Whether pstore records should be compressed before being written to
3262306a36Sopenharmony_ci	  the backing store. This is implemented using the zlib 'deflate'
3362306a36Sopenharmony_ci	  algorithm, using the library implementation instead of using the full
3462306a36Sopenharmony_ci	  blown crypto API. This reduces the risk of secondary oopses or other
3562306a36Sopenharmony_ci	  problems while pstore is recording panic metadata.
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ciconfig PSTORE_CONSOLE
3862306a36Sopenharmony_ci	bool "Log kernel console messages"
3962306a36Sopenharmony_ci	depends on PSTORE
4062306a36Sopenharmony_ci	help
4162306a36Sopenharmony_ci	  When the option is enabled, pstore will log all kernel
4262306a36Sopenharmony_ci	  messages, even if no oops or panic happened.
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ciconfig PSTORE_PMSG
4562306a36Sopenharmony_ci	bool "Log user space messages"
4662306a36Sopenharmony_ci	depends on PSTORE
4762306a36Sopenharmony_ci	select RT_MUTEXES
4862306a36Sopenharmony_ci	help
4962306a36Sopenharmony_ci	  When the option is enabled, pstore will export a character
5062306a36Sopenharmony_ci	  interface /dev/pmsg0 to log user space messages. On reboot
5162306a36Sopenharmony_ci	  data can be retrieved from /sys/fs/pstore/pmsg-ramoops-[ID].
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ci	  If unsure, say N.
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ciconfig PSTORE_FTRACE
5662306a36Sopenharmony_ci	bool "Persistent function tracer"
5762306a36Sopenharmony_ci	depends on PSTORE
5862306a36Sopenharmony_ci	depends on FUNCTION_TRACER
5962306a36Sopenharmony_ci	depends on DEBUG_FS
6062306a36Sopenharmony_ci	help
6162306a36Sopenharmony_ci	  With this option kernel traces function calls into a persistent
6262306a36Sopenharmony_ci	  ram buffer that can be decoded and dumped after reboot through
6362306a36Sopenharmony_ci	  pstore filesystem. It can be used to determine what function
6462306a36Sopenharmony_ci	  was last called before a reset or panic.
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ci	  If unsure, say N.
6762306a36Sopenharmony_ci
6862306a36Sopenharmony_ciconfig PSTORE_RAM
6962306a36Sopenharmony_ci	tristate "Log panic/oops to a RAM buffer"
7062306a36Sopenharmony_ci	depends on PSTORE
7162306a36Sopenharmony_ci	depends on HAS_IOMEM
7262306a36Sopenharmony_ci	select REED_SOLOMON
7362306a36Sopenharmony_ci	select REED_SOLOMON_ENC8
7462306a36Sopenharmony_ci	select REED_SOLOMON_DEC8
7562306a36Sopenharmony_ci	help
7662306a36Sopenharmony_ci	  This enables panic and oops messages to be logged to a circular
7762306a36Sopenharmony_ci	  buffer in RAM where it can be read back at some later point.
7862306a36Sopenharmony_ci
7962306a36Sopenharmony_ci	  Note that for historical reasons, the module will be named
8062306a36Sopenharmony_ci	  "ramoops.ko".
8162306a36Sopenharmony_ci
8262306a36Sopenharmony_ci	  For more information, see Documentation/admin-guide/ramoops.rst.
8362306a36Sopenharmony_ci
8462306a36Sopenharmony_ciconfig PSTORE_ZONE
8562306a36Sopenharmony_ci	tristate
8662306a36Sopenharmony_ci	depends on PSTORE
8762306a36Sopenharmony_ci	help
8862306a36Sopenharmony_ci	  The common layer for pstore/blk (and pstore/ram in the future)
8962306a36Sopenharmony_ci	  to manage storage in zones.
9062306a36Sopenharmony_ci
9162306a36Sopenharmony_ciconfig PSTORE_BLK
9262306a36Sopenharmony_ci	tristate "Log panic/oops to a block device"
9362306a36Sopenharmony_ci	depends on PSTORE
9462306a36Sopenharmony_ci	depends on BLOCK
9562306a36Sopenharmony_ci	select PSTORE_ZONE
9662306a36Sopenharmony_ci	default n
9762306a36Sopenharmony_ci	help
9862306a36Sopenharmony_ci	  This enables panic and oops message to be logged to a block dev
9962306a36Sopenharmony_ci	  where it can be read back at some later point.
10062306a36Sopenharmony_ci
10162306a36Sopenharmony_ci	  For more information, see Documentation/admin-guide/pstore-blk.rst
10262306a36Sopenharmony_ci
10362306a36Sopenharmony_ci	  If unsure, say N.
10462306a36Sopenharmony_ci
10562306a36Sopenharmony_ciconfig PSTORE_BLK_BLKDEV
10662306a36Sopenharmony_ci	string "block device identifier"
10762306a36Sopenharmony_ci	depends on PSTORE_BLK
10862306a36Sopenharmony_ci	default ""
10962306a36Sopenharmony_ci	help
11062306a36Sopenharmony_ci	  Which block device should be used for pstore/blk.
11162306a36Sopenharmony_ci
11262306a36Sopenharmony_ci	  It accepts the following variants:
11362306a36Sopenharmony_ci	  1) <hex_major><hex_minor> device number in hexadecimal representation,
11462306a36Sopenharmony_ci	     with no leading 0x, for example b302.
11562306a36Sopenharmony_ci	  2) /dev/<disk_name> represents the device name of disk
11662306a36Sopenharmony_ci	  3) /dev/<disk_name><decimal> represents the device name and number
11762306a36Sopenharmony_ci	     of partition - device number of disk plus the partition number
11862306a36Sopenharmony_ci	  4) /dev/<disk_name>p<decimal> - same as the above, this form is
11962306a36Sopenharmony_ci	     used when disk name of partitioned disk ends with a digit.
12062306a36Sopenharmony_ci	  5) PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF representing the
12162306a36Sopenharmony_ci	     unique id of a partition if the partition table provides it.
12262306a36Sopenharmony_ci	     The UUID may be either an EFI/GPT UUID, or refer to an MSDOS
12362306a36Sopenharmony_ci	     partition using the format SSSSSSSS-PP, where SSSSSSSS is a zero-
12462306a36Sopenharmony_ci	     filled hex representation of the 32-bit "NT disk signature", and PP
12562306a36Sopenharmony_ci	     is a zero-filled hex representation of the 1-based partition number.
12662306a36Sopenharmony_ci	  6) PARTUUID=<UUID>/PARTNROFF=<int> to select a partition in relation
12762306a36Sopenharmony_ci	     to a partition with a known unique id.
12862306a36Sopenharmony_ci	  7) <major>:<minor> major and minor number of the device separated by
12962306a36Sopenharmony_ci	     a colon.
13062306a36Sopenharmony_ci
13162306a36Sopenharmony_ci	  NOTE that, both Kconfig and module parameters can configure
13262306a36Sopenharmony_ci	  pstore/blk, but module parameters have priority over Kconfig.
13362306a36Sopenharmony_ci
13462306a36Sopenharmony_ciconfig PSTORE_BLK_KMSG_SIZE
13562306a36Sopenharmony_ci	int "Size in Kbytes of kmsg dump log to store"
13662306a36Sopenharmony_ci	depends on PSTORE_BLK
13762306a36Sopenharmony_ci	default 64
13862306a36Sopenharmony_ci	help
13962306a36Sopenharmony_ci	  This just sets size of kmsg dump (oops, panic, etc) log for
14062306a36Sopenharmony_ci	  pstore/blk. The size is in KB and must be a multiple of 4.
14162306a36Sopenharmony_ci
14262306a36Sopenharmony_ci	  NOTE that, both Kconfig and module parameters can configure
14362306a36Sopenharmony_ci	  pstore/blk, but module parameters have priority over Kconfig.
14462306a36Sopenharmony_ci
14562306a36Sopenharmony_ciconfig PSTORE_BLK_MAX_REASON
14662306a36Sopenharmony_ci	int "Maximum kmsg dump reason to store"
14762306a36Sopenharmony_ci	depends on PSTORE_BLK
14862306a36Sopenharmony_ci	default 2
14962306a36Sopenharmony_ci	help
15062306a36Sopenharmony_ci	  The maximum reason for kmsg dumps to store. The default is
15162306a36Sopenharmony_ci	  2 (KMSG_DUMP_OOPS), see include/linux/kmsg_dump.h's
15262306a36Sopenharmony_ci	  enum kmsg_dump_reason for more details.
15362306a36Sopenharmony_ci
15462306a36Sopenharmony_ci	  NOTE that, both Kconfig and module parameters can configure
15562306a36Sopenharmony_ci	  pstore/blk, but module parameters have priority over Kconfig.
15662306a36Sopenharmony_ci
15762306a36Sopenharmony_ciconfig PSTORE_BLK_PMSG_SIZE
15862306a36Sopenharmony_ci	int "Size in Kbytes of pmsg to store"
15962306a36Sopenharmony_ci	depends on PSTORE_BLK
16062306a36Sopenharmony_ci	depends on PSTORE_PMSG
16162306a36Sopenharmony_ci	default 64
16262306a36Sopenharmony_ci	help
16362306a36Sopenharmony_ci	  This just sets size of pmsg (pmsg_size) for pstore/blk. The size is
16462306a36Sopenharmony_ci	  in KB and must be a multiple of 4.
16562306a36Sopenharmony_ci
16662306a36Sopenharmony_ci	  NOTE that, both Kconfig and module parameters can configure
16762306a36Sopenharmony_ci	  pstore/blk, but module parameters have priority over Kconfig.
16862306a36Sopenharmony_ci
16962306a36Sopenharmony_ciconfig PSTORE_BLK_CONSOLE_SIZE
17062306a36Sopenharmony_ci	int "Size in Kbytes of console log to store"
17162306a36Sopenharmony_ci	depends on PSTORE_BLK
17262306a36Sopenharmony_ci	depends on PSTORE_CONSOLE
17362306a36Sopenharmony_ci	default 64
17462306a36Sopenharmony_ci	help
17562306a36Sopenharmony_ci	  This just sets size of console log (console_size) to store via
17662306a36Sopenharmony_ci	  pstore/blk. The size is in KB and must be a multiple of 4.
17762306a36Sopenharmony_ci
17862306a36Sopenharmony_ci	  NOTE that, both Kconfig and module parameters can configure
17962306a36Sopenharmony_ci	  pstore/blk, but module parameters have priority over Kconfig.
18062306a36Sopenharmony_ci
18162306a36Sopenharmony_ciconfig PSTORE_BLK_FTRACE_SIZE
18262306a36Sopenharmony_ci	int "Size in Kbytes of ftrace log to store"
18362306a36Sopenharmony_ci	depends on PSTORE_BLK
18462306a36Sopenharmony_ci	depends on PSTORE_FTRACE
18562306a36Sopenharmony_ci	default 64
18662306a36Sopenharmony_ci	help
18762306a36Sopenharmony_ci	  This just sets size of ftrace log (ftrace_size) for pstore/blk. The
18862306a36Sopenharmony_ci	  size is in KB and must be a multiple of 4.
18962306a36Sopenharmony_ci
19062306a36Sopenharmony_ci	  NOTE that, both Kconfig and module parameters can configure
19162306a36Sopenharmony_ci	  pstore/blk, but module parameters have priority over Kconfig.
192