xref: /openbmc/linux/fs/pstore/Kconfig (revision c900529f3d9161bfde5cca0754f83b4d3c3e0220)
1ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only
2ca01d6ddSTony Luckconfig PSTORE
3ee1d2674SGeliang Tang	tristate "Persistent store support"
4ca01d6ddSTony Luck	default n
5ca01d6ddSTony Luck	help
6ca01d6ddSTony Luck	   This option enables generic access to platform level
7ca01d6ddSTony Luck	   persistent storage via "pstore" filesystem that can
8ca01d6ddSTony Luck	   be mounted as /dev/pstore.  Only useful if you have
9ca01d6ddSTony Luck	   a platform level driver that registers with pstore to
10ca01d6ddSTony Luck	   provide the data, so you probably should just go say "Y"
11ca01d6ddSTony Luck	   (or "M") to a platform specific persistent store driver
12ca01d6ddSTony Luck	   (e.g. ACPI_APEI on X86) which will select this for you.
13ca01d6ddSTony Luck	   If you don't have a platform persistent store driver,
14ca01d6ddSTony Luck	   say N.
151894a253SAnton Vorontsov
1626fecbf7SVasile-Laurentiu Stanimirconfig PSTORE_DEFAULT_KMSG_BYTES
1726fecbf7SVasile-Laurentiu Stanimir	int "Default kernel log storage space" if EXPERT
1826fecbf7SVasile-Laurentiu Stanimir	depends on PSTORE
1926fecbf7SVasile-Laurentiu Stanimir	default "10240"
2026fecbf7SVasile-Laurentiu Stanimir	help
2126fecbf7SVasile-Laurentiu Stanimir	  Defines default size of pstore kernel log storage.
2226fecbf7SVasile-Laurentiu Stanimir	  Can be enlarged if needed, not recommended to shrink it.
2326fecbf7SVasile-Laurentiu Stanimir
24fe1d4758SKees Cookconfig PSTORE_COMPRESS
25*438b8050SArd Biesheuvel	bool "Pstore compression (deflate)"
26fe1d4758SKees Cook	depends on PSTORE
27*438b8050SArd Biesheuvel	select ZLIB_INFLATE
28*438b8050SArd Biesheuvel	select ZLIB_DEFLATE
29*438b8050SArd Biesheuvel	default y
30fe1d4758SKees Cook	help
31*438b8050SArd Biesheuvel	  Whether pstore records should be compressed before being written to
32*438b8050SArd Biesheuvel	  the backing store. This is implemented using the zlib 'deflate'
33*438b8050SArd Biesheuvel	  algorithm, using the library implementation instead of using the full
34*438b8050SArd Biesheuvel	  blown crypto API. This reduces the risk of secondary oopses or other
35*438b8050SArd Biesheuvel	  problems while pstore is recording panic metadata.
36fe1d4758SKees Cook
37f29e5956SAnton Vorontsovconfig PSTORE_CONSOLE
38f29e5956SAnton Vorontsov	bool "Log kernel console messages"
39f29e5956SAnton Vorontsov	depends on PSTORE
40f29e5956SAnton Vorontsov	help
41f29e5956SAnton Vorontsov	  When the option is enabled, pstore will log all kernel
42f29e5956SAnton Vorontsov	  messages, even if no oops or panic happened.
43f29e5956SAnton Vorontsov
449d5438f4SMark Salyzynconfig PSTORE_PMSG
459d5438f4SMark Salyzyn	bool "Log user space messages"
469d5438f4SMark Salyzyn	depends on PSTORE
472f4fec59SJohn Stultz	select RT_MUTEXES
489d5438f4SMark Salyzyn	help
499d5438f4SMark Salyzyn	  When the option is enabled, pstore will export a character
509d5438f4SMark Salyzyn	  interface /dev/pmsg0 to log user space messages. On reboot
519d5438f4SMark Salyzyn	  data can be retrieved from /sys/fs/pstore/pmsg-ramoops-[ID].
529d5438f4SMark Salyzyn
539d5438f4SMark Salyzyn	  If unsure, say N.
549d5438f4SMark Salyzyn
55060287b8SAnton Vorontsovconfig PSTORE_FTRACE
56060287b8SAnton Vorontsov	bool "Persistent function tracer"
57060287b8SAnton Vorontsov	depends on PSTORE
58060287b8SAnton Vorontsov	depends on FUNCTION_TRACER
5965f8c95eSAnton Vorontsov	depends on DEBUG_FS
60060287b8SAnton Vorontsov	help
61060287b8SAnton Vorontsov	  With this option kernel traces function calls into a persistent
62060287b8SAnton Vorontsov	  ram buffer that can be decoded and dumped after reboot through
63060287b8SAnton Vorontsov	  pstore filesystem. It can be used to determine what function
64060287b8SAnton Vorontsov	  was last called before a reset or panic.
65060287b8SAnton Vorontsov
66060287b8SAnton Vorontsov	  If unsure, say N.
67060287b8SAnton Vorontsov
681894a253SAnton Vorontsovconfig PSTORE_RAM
691894a253SAnton Vorontsov	tristate "Log panic/oops to a RAM buffer"
701894a253SAnton Vorontsov	depends on PSTORE
71cddb8751SAnton Vorontsov	depends on HAS_IOMEM
72cddb8751SAnton Vorontsov	select REED_SOLOMON
73cddb8751SAnton Vorontsov	select REED_SOLOMON_ENC8
74cddb8751SAnton Vorontsov	select REED_SOLOMON_DEC8
751894a253SAnton Vorontsov	help
761894a253SAnton Vorontsov	  This enables panic and oops messages to be logged to a circular
771894a253SAnton Vorontsov	  buffer in RAM where it can be read back at some later point.
781894a253SAnton Vorontsov
791894a253SAnton Vorontsov	  Note that for historical reasons, the module will be named
801894a253SAnton Vorontsov	  "ramoops.ko".
811894a253SAnton Vorontsov
828c27ceffSMauro Carvalho Chehab	  For more information, see Documentation/admin-guide/ramoops.rst.
83d26c3321SWeiXiong Liao
84d26c3321SWeiXiong Liaoconfig PSTORE_ZONE
85d26c3321SWeiXiong Liao	tristate
86d26c3321SWeiXiong Liao	depends on PSTORE
87d26c3321SWeiXiong Liao	help
88d26c3321SWeiXiong Liao	  The common layer for pstore/blk (and pstore/ram in the future)
89d26c3321SWeiXiong Liao	  to manage storage in zones.
9017639f67SWeiXiong Liao
9117639f67SWeiXiong Liaoconfig PSTORE_BLK
9217639f67SWeiXiong Liao	tristate "Log panic/oops to a block device"
9317639f67SWeiXiong Liao	depends on PSTORE
9417639f67SWeiXiong Liao	depends on BLOCK
9517639f67SWeiXiong Liao	select PSTORE_ZONE
9617639f67SWeiXiong Liao	default n
9717639f67SWeiXiong Liao	help
9817639f67SWeiXiong Liao	  This enables panic and oops message to be logged to a block dev
9917639f67SWeiXiong Liao	  where it can be read back at some later point.
10017639f67SWeiXiong Liao
101649304c9SWeiXiong Liao	  For more information, see Documentation/admin-guide/pstore-blk.rst
102649304c9SWeiXiong Liao
10317639f67SWeiXiong Liao	  If unsure, say N.
10417639f67SWeiXiong Liao
10517639f67SWeiXiong Liaoconfig PSTORE_BLK_BLKDEV
10617639f67SWeiXiong Liao	string "block device identifier"
10717639f67SWeiXiong Liao	depends on PSTORE_BLK
10817639f67SWeiXiong Liao	default ""
10917639f67SWeiXiong Liao	help
11017639f67SWeiXiong Liao	  Which block device should be used for pstore/blk.
11117639f67SWeiXiong Liao
112cc9c4d1bSWeiXiong Liao	  It accepts the following variants:
11317639f67SWeiXiong Liao	  1) <hex_major><hex_minor> device number in hexadecimal representation,
11417639f67SWeiXiong Liao	     with no leading 0x, for example b302.
115cc9c4d1bSWeiXiong Liao	  2) /dev/<disk_name> represents the device name of disk
116cc9c4d1bSWeiXiong Liao	  3) /dev/<disk_name><decimal> represents the device name and number
11717639f67SWeiXiong Liao	     of partition - device number of disk plus the partition number
11817639f67SWeiXiong Liao	  4) /dev/<disk_name>p<decimal> - same as the above, this form is
11917639f67SWeiXiong Liao	     used when disk name of partitioned disk ends with a digit.
12017639f67SWeiXiong Liao	  5) PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF representing the
12117639f67SWeiXiong Liao	     unique id of a partition if the partition table provides it.
12217639f67SWeiXiong Liao	     The UUID may be either an EFI/GPT UUID, or refer to an MSDOS
12317639f67SWeiXiong Liao	     partition using the format SSSSSSSS-PP, where SSSSSSSS is a zero-
12417639f67SWeiXiong Liao	     filled hex representation of the 32-bit "NT disk signature", and PP
12517639f67SWeiXiong Liao	     is a zero-filled hex representation of the 1-based partition number.
12617639f67SWeiXiong Liao	  6) PARTUUID=<UUID>/PARTNROFF=<int> to select a partition in relation
12717639f67SWeiXiong Liao	     to a partition with a known unique id.
12817639f67SWeiXiong Liao	  7) <major>:<minor> major and minor number of the device separated by
12917639f67SWeiXiong Liao	     a colon.
13017639f67SWeiXiong Liao
13117639f67SWeiXiong Liao	  NOTE that, both Kconfig and module parameters can configure
13217639f67SWeiXiong Liao	  pstore/blk, but module parameters have priority over Kconfig.
13317639f67SWeiXiong Liao
13417639f67SWeiXiong Liaoconfig PSTORE_BLK_KMSG_SIZE
13517639f67SWeiXiong Liao	int "Size in Kbytes of kmsg dump log to store"
13617639f67SWeiXiong Liao	depends on PSTORE_BLK
13717639f67SWeiXiong Liao	default 64
13817639f67SWeiXiong Liao	help
13917639f67SWeiXiong Liao	  This just sets size of kmsg dump (oops, panic, etc) log for
14017639f67SWeiXiong Liao	  pstore/blk. The size is in KB and must be a multiple of 4.
14117639f67SWeiXiong Liao
14217639f67SWeiXiong Liao	  NOTE that, both Kconfig and module parameters can configure
14317639f67SWeiXiong Liao	  pstore/blk, but module parameters have priority over Kconfig.
14417639f67SWeiXiong Liao
14517639f67SWeiXiong Liaoconfig PSTORE_BLK_MAX_REASON
14617639f67SWeiXiong Liao	int "Maximum kmsg dump reason to store"
14717639f67SWeiXiong Liao	depends on PSTORE_BLK
14817639f67SWeiXiong Liao	default 2
14917639f67SWeiXiong Liao	help
15017639f67SWeiXiong Liao	  The maximum reason for kmsg dumps to store. The default is
15117639f67SWeiXiong Liao	  2 (KMSG_DUMP_OOPS), see include/linux/kmsg_dump.h's
15217639f67SWeiXiong Liao	  enum kmsg_dump_reason for more details.
15317639f67SWeiXiong Liao
15417639f67SWeiXiong Liao	  NOTE that, both Kconfig and module parameters can configure
15517639f67SWeiXiong Liao	  pstore/blk, but module parameters have priority over Kconfig.
1560dc06826SWeiXiong Liao
1570dc06826SWeiXiong Liaoconfig PSTORE_BLK_PMSG_SIZE
1580dc06826SWeiXiong Liao	int "Size in Kbytes of pmsg to store"
1590dc06826SWeiXiong Liao	depends on PSTORE_BLK
1600dc06826SWeiXiong Liao	depends on PSTORE_PMSG
1610dc06826SWeiXiong Liao	default 64
1620dc06826SWeiXiong Liao	help
1630dc06826SWeiXiong Liao	  This just sets size of pmsg (pmsg_size) for pstore/blk. The size is
1640dc06826SWeiXiong Liao	  in KB and must be a multiple of 4.
1650dc06826SWeiXiong Liao
1660dc06826SWeiXiong Liao	  NOTE that, both Kconfig and module parameters can configure
1670dc06826SWeiXiong Liao	  pstore/blk, but module parameters have priority over Kconfig.
168cc9c4d1bSWeiXiong Liao
169cc9c4d1bSWeiXiong Liaoconfig PSTORE_BLK_CONSOLE_SIZE
170cc9c4d1bSWeiXiong Liao	int "Size in Kbytes of console log to store"
171cc9c4d1bSWeiXiong Liao	depends on PSTORE_BLK
172cc9c4d1bSWeiXiong Liao	depends on PSTORE_CONSOLE
173cc9c4d1bSWeiXiong Liao	default 64
174cc9c4d1bSWeiXiong Liao	help
175cc9c4d1bSWeiXiong Liao	  This just sets size of console log (console_size) to store via
176cc9c4d1bSWeiXiong Liao	  pstore/blk. The size is in KB and must be a multiple of 4.
177cc9c4d1bSWeiXiong Liao
178cc9c4d1bSWeiXiong Liao	  NOTE that, both Kconfig and module parameters can configure
179cc9c4d1bSWeiXiong Liao	  pstore/blk, but module parameters have priority over Kconfig.
18034327e9fSWeiXiong Liao
18134327e9fSWeiXiong Liaoconfig PSTORE_BLK_FTRACE_SIZE
18234327e9fSWeiXiong Liao	int "Size in Kbytes of ftrace log to store"
18334327e9fSWeiXiong Liao	depends on PSTORE_BLK
18434327e9fSWeiXiong Liao	depends on PSTORE_FTRACE
18534327e9fSWeiXiong Liao	default 64
18634327e9fSWeiXiong Liao	help
18734327e9fSWeiXiong Liao	  This just sets size of ftrace log (ftrace_size) for pstore/blk. The
18834327e9fSWeiXiong Liao	  size is in KB and must be a multiple of 4.
18934327e9fSWeiXiong Liao
19034327e9fSWeiXiong Liao	  NOTE that, both Kconfig and module parameters can configure
19134327e9fSWeiXiong Liao	  pstore/blk, but module parameters have priority over Kconfig.
192