18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0-only
28c2ecf20Sopenharmony_ciconfig PSTORE
38c2ecf20Sopenharmony_ci	tristate "Persistent store support"
48c2ecf20Sopenharmony_ci	select CRYPTO if PSTORE_COMPRESS
58c2ecf20Sopenharmony_ci	default n
68c2ecf20Sopenharmony_ci	help
78c2ecf20Sopenharmony_ci	   This option enables generic access to platform level
88c2ecf20Sopenharmony_ci	   persistent storage via "pstore" filesystem that can
98c2ecf20Sopenharmony_ci	   be mounted as /dev/pstore.  Only useful if you have
108c2ecf20Sopenharmony_ci	   a platform level driver that registers with pstore to
118c2ecf20Sopenharmony_ci	   provide the data, so you probably should just go say "Y"
128c2ecf20Sopenharmony_ci	   (or "M") to a platform specific persistent store driver
138c2ecf20Sopenharmony_ci	   (e.g. ACPI_APEI on X86) which will select this for you.
148c2ecf20Sopenharmony_ci	   If you don't have a platform persistent store driver,
158c2ecf20Sopenharmony_ci	   say N.
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ciconfig PSTORE_DEFLATE_COMPRESS
188c2ecf20Sopenharmony_ci	tristate "DEFLATE (ZLIB) compression"
198c2ecf20Sopenharmony_ci	default y
208c2ecf20Sopenharmony_ci	depends on PSTORE
218c2ecf20Sopenharmony_ci	select CRYPTO_DEFLATE
228c2ecf20Sopenharmony_ci	help
238c2ecf20Sopenharmony_ci	  This option enables DEFLATE (also known as ZLIB) compression
248c2ecf20Sopenharmony_ci	  algorithm support.
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ciconfig PSTORE_LZO_COMPRESS
278c2ecf20Sopenharmony_ci	tristate "LZO compression"
288c2ecf20Sopenharmony_ci	depends on PSTORE
298c2ecf20Sopenharmony_ci	select CRYPTO_LZO
308c2ecf20Sopenharmony_ci	help
318c2ecf20Sopenharmony_ci	  This option enables LZO compression algorithm support.
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ciconfig PSTORE_LZ4_COMPRESS
348c2ecf20Sopenharmony_ci	tristate "LZ4 compression"
358c2ecf20Sopenharmony_ci	depends on PSTORE
368c2ecf20Sopenharmony_ci	select CRYPTO_LZ4
378c2ecf20Sopenharmony_ci	help
388c2ecf20Sopenharmony_ci	  This option enables LZ4 compression algorithm support.
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ciconfig PSTORE_LZ4HC_COMPRESS
418c2ecf20Sopenharmony_ci	tristate "LZ4HC compression"
428c2ecf20Sopenharmony_ci	depends on PSTORE
438c2ecf20Sopenharmony_ci	select CRYPTO_LZ4HC
448c2ecf20Sopenharmony_ci	help
458c2ecf20Sopenharmony_ci	  This option enables LZ4HC (high compression) mode algorithm.
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ciconfig PSTORE_842_COMPRESS
488c2ecf20Sopenharmony_ci	bool "842 compression"
498c2ecf20Sopenharmony_ci	depends on PSTORE
508c2ecf20Sopenharmony_ci	select CRYPTO_842
518c2ecf20Sopenharmony_ci	help
528c2ecf20Sopenharmony_ci	  This option enables 842 compression algorithm support.
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ciconfig PSTORE_ZSTD_COMPRESS
558c2ecf20Sopenharmony_ci	bool "zstd compression"
568c2ecf20Sopenharmony_ci	depends on PSTORE
578c2ecf20Sopenharmony_ci	select CRYPTO_ZSTD
588c2ecf20Sopenharmony_ci	help
598c2ecf20Sopenharmony_ci	  This option enables zstd compression algorithm support.
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ciconfig PSTORE_COMPRESS
628c2ecf20Sopenharmony_ci	def_bool y
638c2ecf20Sopenharmony_ci	depends on PSTORE
648c2ecf20Sopenharmony_ci	depends on PSTORE_DEFLATE_COMPRESS || PSTORE_LZO_COMPRESS ||	\
658c2ecf20Sopenharmony_ci		   PSTORE_LZ4_COMPRESS || PSTORE_LZ4HC_COMPRESS ||	\
668c2ecf20Sopenharmony_ci		   PSTORE_842_COMPRESS || PSTORE_ZSTD_COMPRESS
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_cichoice
698c2ecf20Sopenharmony_ci	prompt "Default pstore compression algorithm"
708c2ecf20Sopenharmony_ci	depends on PSTORE_COMPRESS
718c2ecf20Sopenharmony_ci	help
728c2ecf20Sopenharmony_ci	  This option chooses the default active compression algorithm.
738c2ecf20Sopenharmony_ci	  This change be changed at boot with "pstore.compress=..." on
748c2ecf20Sopenharmony_ci	  the kernel command line.
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci	  Currently, pstore has support for 6 compression algorithms:
778c2ecf20Sopenharmony_ci	  deflate, lzo, lz4, lz4hc, 842 and zstd.
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ci	  The default compression algorithm is deflate.
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci	config PSTORE_DEFLATE_COMPRESS_DEFAULT
828c2ecf20Sopenharmony_ci		bool "deflate" if PSTORE_DEFLATE_COMPRESS
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ci	config PSTORE_LZO_COMPRESS_DEFAULT
858c2ecf20Sopenharmony_ci		bool "lzo" if PSTORE_LZO_COMPRESS
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_ci	config PSTORE_LZ4_COMPRESS_DEFAULT
888c2ecf20Sopenharmony_ci		bool "lz4" if PSTORE_LZ4_COMPRESS
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci	config PSTORE_LZ4HC_COMPRESS_DEFAULT
918c2ecf20Sopenharmony_ci		bool "lz4hc" if PSTORE_LZ4HC_COMPRESS
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_ci	config PSTORE_842_COMPRESS_DEFAULT
948c2ecf20Sopenharmony_ci		bool "842" if PSTORE_842_COMPRESS
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci	config PSTORE_ZSTD_COMPRESS_DEFAULT
978c2ecf20Sopenharmony_ci		bool "zstd" if PSTORE_ZSTD_COMPRESS
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ciendchoice
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ciconfig PSTORE_COMPRESS_DEFAULT
1028c2ecf20Sopenharmony_ci	string
1038c2ecf20Sopenharmony_ci	depends on PSTORE_COMPRESS
1048c2ecf20Sopenharmony_ci	default "deflate" if PSTORE_DEFLATE_COMPRESS_DEFAULT
1058c2ecf20Sopenharmony_ci	default "lzo" if PSTORE_LZO_COMPRESS_DEFAULT
1068c2ecf20Sopenharmony_ci	default "lz4" if PSTORE_LZ4_COMPRESS_DEFAULT
1078c2ecf20Sopenharmony_ci	default "lz4hc" if PSTORE_LZ4HC_COMPRESS_DEFAULT
1088c2ecf20Sopenharmony_ci	default "842" if PSTORE_842_COMPRESS_DEFAULT
1098c2ecf20Sopenharmony_ci	default "zstd" if PSTORE_ZSTD_COMPRESS_DEFAULT
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ciconfig PSTORE_CONSOLE
1128c2ecf20Sopenharmony_ci	bool "Log kernel console messages"
1138c2ecf20Sopenharmony_ci	depends on PSTORE
1148c2ecf20Sopenharmony_ci	help
1158c2ecf20Sopenharmony_ci	  When the option is enabled, pstore will log all kernel
1168c2ecf20Sopenharmony_ci	  messages, even if no oops or panic happened.
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ciconfig PSTORE_PMSG
1198c2ecf20Sopenharmony_ci	bool "Log user space messages"
1208c2ecf20Sopenharmony_ci	depends on PSTORE
1218c2ecf20Sopenharmony_ci	select RT_MUTEXES
1228c2ecf20Sopenharmony_ci	help
1238c2ecf20Sopenharmony_ci	  When the option is enabled, pstore will export a character
1248c2ecf20Sopenharmony_ci	  interface /dev/pmsg0 to log user space messages. On reboot
1258c2ecf20Sopenharmony_ci	  data can be retrieved from /sys/fs/pstore/pmsg-ramoops-[ID].
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_ci	  If unsure, say N.
1288c2ecf20Sopenharmony_ci
1298c2ecf20Sopenharmony_ciconfig PSTORE_FTRACE
1308c2ecf20Sopenharmony_ci	bool "Persistent function tracer"
1318c2ecf20Sopenharmony_ci	depends on PSTORE
1328c2ecf20Sopenharmony_ci	depends on FUNCTION_TRACER
1338c2ecf20Sopenharmony_ci	depends on DEBUG_FS
1348c2ecf20Sopenharmony_ci	help
1358c2ecf20Sopenharmony_ci	  With this option kernel traces function calls into a persistent
1368c2ecf20Sopenharmony_ci	  ram buffer that can be decoded and dumped after reboot through
1378c2ecf20Sopenharmony_ci	  pstore filesystem. It can be used to determine what function
1388c2ecf20Sopenharmony_ci	  was last called before a reset or panic.
1398c2ecf20Sopenharmony_ci
1408c2ecf20Sopenharmony_ci	  If unsure, say N.
1418c2ecf20Sopenharmony_ci
1428c2ecf20Sopenharmony_ciconfig PSTORE_BLACKBOX
1438c2ecf20Sopenharmony_ci	bool "Store customised fault log"
1448c2ecf20Sopenharmony_ci	depends on PSTORE
1458c2ecf20Sopenharmony_ci	depends on BLACKBOX
1468c2ecf20Sopenharmony_ci	help
1478c2ecf20Sopenharmony_ci	  Enable storing the customised fault log for BlackBox.
1488c2ecf20Sopenharmony_ci
1498c2ecf20Sopenharmony_ci	  With the option enabled, pstore will store the customised kernel
1508c2ecf20Sopenharmony_ci	  fault log for BlackBox when oops or panic happened.
1518c2ecf20Sopenharmony_ci
1528c2ecf20Sopenharmony_ci	  If unsure, say N.
1538c2ecf20Sopenharmony_ci
1548c2ecf20Sopenharmony_ciconfig PSTORE_RAM
1558c2ecf20Sopenharmony_ci	tristate "Log panic/oops to a RAM buffer"
1568c2ecf20Sopenharmony_ci	depends on PSTORE
1578c2ecf20Sopenharmony_ci	depends on HAS_IOMEM
1588c2ecf20Sopenharmony_ci	select REED_SOLOMON
1598c2ecf20Sopenharmony_ci	select REED_SOLOMON_ENC8
1608c2ecf20Sopenharmony_ci	select REED_SOLOMON_DEC8
1618c2ecf20Sopenharmony_ci	help
1628c2ecf20Sopenharmony_ci	  This enables panic and oops messages to be logged to a circular
1638c2ecf20Sopenharmony_ci	  buffer in RAM where it can be read back at some later point.
1648c2ecf20Sopenharmony_ci
1658c2ecf20Sopenharmony_ci	  Note that for historical reasons, the module will be named
1668c2ecf20Sopenharmony_ci	  "ramoops.ko".
1678c2ecf20Sopenharmony_ci
1688c2ecf20Sopenharmony_ci	  For more information, see Documentation/admin-guide/ramoops.rst.
1698c2ecf20Sopenharmony_ci
1708c2ecf20Sopenharmony_ciconfig PSTORE_ZONE
1718c2ecf20Sopenharmony_ci	tristate
1728c2ecf20Sopenharmony_ci	depends on PSTORE
1738c2ecf20Sopenharmony_ci	help
1748c2ecf20Sopenharmony_ci	  The common layer for pstore/blk (and pstore/ram in the future)
1758c2ecf20Sopenharmony_ci	  to manage storage in zones.
1768c2ecf20Sopenharmony_ci
1778c2ecf20Sopenharmony_ciconfig PSTORE_BLK
1788c2ecf20Sopenharmony_ci	tristate "Log panic/oops to a block device"
1798c2ecf20Sopenharmony_ci	depends on PSTORE
1808c2ecf20Sopenharmony_ci	depends on BLOCK
1818c2ecf20Sopenharmony_ci	depends on BLACKBOX_USE_PSTORE_BLK_DEBUG || BROKEN
1828c2ecf20Sopenharmony_ci	select PSTORE_ZONE
1838c2ecf20Sopenharmony_ci	default n
1848c2ecf20Sopenharmony_ci	help
1858c2ecf20Sopenharmony_ci	  This enables panic and oops message to be logged to a block dev
1868c2ecf20Sopenharmony_ci	  where it can be read back at some later point.
1878c2ecf20Sopenharmony_ci
1888c2ecf20Sopenharmony_ci	  For more information, see Documentation/admin-guide/pstore-blk.rst
1898c2ecf20Sopenharmony_ci
1908c2ecf20Sopenharmony_ci	  If unsure, say N.
1918c2ecf20Sopenharmony_ci
1928c2ecf20Sopenharmony_ciconfig PSTORE_BLK_BLKDEV
1938c2ecf20Sopenharmony_ci	string "block device identifier"
1948c2ecf20Sopenharmony_ci	depends on PSTORE_BLK
1958c2ecf20Sopenharmony_ci	default ""
1968c2ecf20Sopenharmony_ci	help
1978c2ecf20Sopenharmony_ci	  Which block device should be used for pstore/blk.
1988c2ecf20Sopenharmony_ci
1998c2ecf20Sopenharmony_ci	  It accepts the following variants:
2008c2ecf20Sopenharmony_ci	  1) <hex_major><hex_minor> device number in hexadecimal representation,
2018c2ecf20Sopenharmony_ci	     with no leading 0x, for example b302.
2028c2ecf20Sopenharmony_ci	  2) /dev/<disk_name> represents the device name of disk
2038c2ecf20Sopenharmony_ci	  3) /dev/<disk_name><decimal> represents the device name and number
2048c2ecf20Sopenharmony_ci	     of partition - device number of disk plus the partition number
2058c2ecf20Sopenharmony_ci	  4) /dev/<disk_name>p<decimal> - same as the above, this form is
2068c2ecf20Sopenharmony_ci	     used when disk name of partitioned disk ends with a digit.
2078c2ecf20Sopenharmony_ci	  5) PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF representing the
2088c2ecf20Sopenharmony_ci	     unique id of a partition if the partition table provides it.
2098c2ecf20Sopenharmony_ci	     The UUID may be either an EFI/GPT UUID, or refer to an MSDOS
2108c2ecf20Sopenharmony_ci	     partition using the format SSSSSSSS-PP, where SSSSSSSS is a zero-
2118c2ecf20Sopenharmony_ci	     filled hex representation of the 32-bit "NT disk signature", and PP
2128c2ecf20Sopenharmony_ci	     is a zero-filled hex representation of the 1-based partition number.
2138c2ecf20Sopenharmony_ci	  6) PARTUUID=<UUID>/PARTNROFF=<int> to select a partition in relation
2148c2ecf20Sopenharmony_ci	     to a partition with a known unique id.
2158c2ecf20Sopenharmony_ci	  7) <major>:<minor> major and minor number of the device separated by
2168c2ecf20Sopenharmony_ci	     a colon.
2178c2ecf20Sopenharmony_ci
2188c2ecf20Sopenharmony_ci	  NOTE that, both Kconfig and module parameters can configure
2198c2ecf20Sopenharmony_ci	  pstore/blk, but module parameters have priority over Kconfig.
2208c2ecf20Sopenharmony_ci
2218c2ecf20Sopenharmony_ciconfig PSTORE_BLK_KMSG_SIZE
2228c2ecf20Sopenharmony_ci	int "Size in Kbytes of kmsg dump log to store"
2238c2ecf20Sopenharmony_ci	depends on PSTORE_BLK
2248c2ecf20Sopenharmony_ci	default 64
2258c2ecf20Sopenharmony_ci	help
2268c2ecf20Sopenharmony_ci	  This just sets size of kmsg dump (oops, panic, etc) log for
2278c2ecf20Sopenharmony_ci	  pstore/blk. The size is in KB and must be a multiple of 4.
2288c2ecf20Sopenharmony_ci
2298c2ecf20Sopenharmony_ci	  NOTE that, both Kconfig and module parameters can configure
2308c2ecf20Sopenharmony_ci	  pstore/blk, but module parameters have priority over Kconfig.
2318c2ecf20Sopenharmony_ci
2328c2ecf20Sopenharmony_ciconfig PSTORE_BLK_MAX_REASON
2338c2ecf20Sopenharmony_ci	int "Maximum kmsg dump reason to store"
2348c2ecf20Sopenharmony_ci	depends on PSTORE_BLK
2358c2ecf20Sopenharmony_ci	default 2
2368c2ecf20Sopenharmony_ci	help
2378c2ecf20Sopenharmony_ci	  The maximum reason for kmsg dumps to store. The default is
2388c2ecf20Sopenharmony_ci	  2 (KMSG_DUMP_OOPS), see include/linux/kmsg_dump.h's
2398c2ecf20Sopenharmony_ci	  enum kmsg_dump_reason for more details.
2408c2ecf20Sopenharmony_ci
2418c2ecf20Sopenharmony_ci	  NOTE that, both Kconfig and module parameters can configure
2428c2ecf20Sopenharmony_ci	  pstore/blk, but module parameters have priority over Kconfig.
2438c2ecf20Sopenharmony_ci
2448c2ecf20Sopenharmony_ciconfig PSTORE_BLK_PMSG_SIZE
2458c2ecf20Sopenharmony_ci	int "Size in Kbytes of pmsg to store"
2468c2ecf20Sopenharmony_ci	depends on PSTORE_BLK
2478c2ecf20Sopenharmony_ci	depends on PSTORE_PMSG
2488c2ecf20Sopenharmony_ci	default 64
2498c2ecf20Sopenharmony_ci	help
2508c2ecf20Sopenharmony_ci	  This just sets size of pmsg (pmsg_size) for pstore/blk. The size is
2518c2ecf20Sopenharmony_ci	  in KB and must be a multiple of 4.
2528c2ecf20Sopenharmony_ci
2538c2ecf20Sopenharmony_ci	  NOTE that, both Kconfig and module parameters can configure
2548c2ecf20Sopenharmony_ci	  pstore/blk, but module parameters have priority over Kconfig.
2558c2ecf20Sopenharmony_ci
2568c2ecf20Sopenharmony_ciconfig PSTORE_BLK_CONSOLE_SIZE
2578c2ecf20Sopenharmony_ci	int "Size in Kbytes of console log to store"
2588c2ecf20Sopenharmony_ci	depends on PSTORE_BLK
2598c2ecf20Sopenharmony_ci	depends on PSTORE_CONSOLE
2608c2ecf20Sopenharmony_ci	default 64
2618c2ecf20Sopenharmony_ci	help
2628c2ecf20Sopenharmony_ci	  This just sets size of console log (console_size) to store via
2638c2ecf20Sopenharmony_ci	  pstore/blk. The size is in KB and must be a multiple of 4.
2648c2ecf20Sopenharmony_ci
2658c2ecf20Sopenharmony_ci	  NOTE that, both Kconfig and module parameters can configure
2668c2ecf20Sopenharmony_ci	  pstore/blk, but module parameters have priority over Kconfig.
2678c2ecf20Sopenharmony_ci
2688c2ecf20Sopenharmony_ciconfig PSTORE_BLK_FTRACE_SIZE
2698c2ecf20Sopenharmony_ci	int "Size in Kbytes of ftrace log to store"
2708c2ecf20Sopenharmony_ci	depends on PSTORE_BLK
2718c2ecf20Sopenharmony_ci	depends on PSTORE_FTRACE
2728c2ecf20Sopenharmony_ci	default 64
2738c2ecf20Sopenharmony_ci	help
2748c2ecf20Sopenharmony_ci	  This just sets size of ftrace log (ftrace_size) for pstore/blk. The
2758c2ecf20Sopenharmony_ci	  size is in KB and must be a multiple of 4.
2768c2ecf20Sopenharmony_ci
2778c2ecf20Sopenharmony_ci	  NOTE that, both Kconfig and module parameters can configure
2788c2ecf20Sopenharmony_ci	  pstore/blk, but module parameters have priority over Kconfig.
2798c2ecf20Sopenharmony_ci
2808c2ecf20Sopenharmony_ciconfig PSTORE_BLK_BLACKBOX_SIZE
2818c2ecf20Sopenharmony_ci	int "Size in Kbytes of fault log for BlackBox to store"
2828c2ecf20Sopenharmony_ci	depends on PSTORE_BLK
2838c2ecf20Sopenharmony_ci	depends on PSTORE_BLACKBOX
2848c2ecf20Sopenharmony_ci	default 64
2858c2ecf20Sopenharmony_ci	help
2868c2ecf20Sopenharmony_ci	  This just sets size of fault log (blackbox_size) for pstore/blk.
2878c2ecf20Sopenharmony_ci	  The size is in KB and must be a multiple of 4.
2888c2ecf20Sopenharmony_ci
2898c2ecf20Sopenharmony_ci	  NOTE that, both Kconfig and module parameters can configure
2908c2ecf20Sopenharmony_ci	  pstore/blk, but module parameters have priority over Kconfig.
2918c2ecf20Sopenharmony_ci
2928c2ecf20Sopenharmony_ciconfig PSTORE_BLACKBOX_STACK_SIZE
2938c2ecf20Sopenharmony_ci	int "Default stack size for BlackBox" if EXPERT
2948c2ecf20Sopenharmony_ci	depends on PSTORE
2958c2ecf20Sopenharmony_ci	depends on PSTORE_BLACKBOX
2968c2ecf20Sopenharmony_ci	default 1024
2978c2ecf20Sopenharmony_ci	help
2988c2ecf20Sopenharmony_ci	  Defines default size of pstore stack size for blackbox.
2998c2ecf20Sopenharmony_ci	  Can be enlarged if needed. not recommended to shrink it.
300