xref: /openbmc/linux/arch/x86/Kconfig.debug (revision b181f7029bd71238ac2754ce7052dffd69432085)
1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
2d013a27cSRandy Dunlap
3aeb9dd1dSLu Baoluconfig EARLY_PRINTK_USB
4aeb9dd1dSLu Baolu	bool
5aeb9dd1dSLu Baolu
66bcb13b3SBen Collinsconfig X86_VERBOSE_BOOTUP
76bcb13b3SBen Collins	bool "Enable verbose x86 bootup info messages"
86bcb13b3SBen Collins	default y
9a7f7f624SMasahiro Yamada	help
106bcb13b3SBen Collins	  Enables the informational output from the decompression stage
116bcb13b3SBen Collins	  (e.g. bzImage) of the boot. If you disable this you will still
126bcb13b3SBen Collins	  see errors. Disable this if you want silent bootup.
136bcb13b3SBen Collins
14d013a27cSRandy Dunlapconfig EARLY_PRINTK
156a108a14SDavid Rientjes	bool "Early printk" if EXPERT
16d013a27cSRandy Dunlap	default y
17a7f7f624SMasahiro Yamada	help
18d013a27cSRandy Dunlap	  Write kernel log output directly into the VGA buffer or to a serial
19d013a27cSRandy Dunlap	  port.
20d013a27cSRandy Dunlap
21d013a27cSRandy Dunlap	  This is useful for kernel debugging when your machine crashes very
22d013a27cSRandy Dunlap	  early before the console code is initialized. For normal operation
23d013a27cSRandy Dunlap	  it is not recommended because it looks ugly and doesn't cooperate
24aeb9dd1dSLu Baolu	  with klogd/syslogd or the X server. You should normally say N here,
25d013a27cSRandy Dunlap	  unless you want to debug such a crash.
26d013a27cSRandy Dunlap
275c05917eSYinghai Luconfig EARLY_PRINTK_DBGP
285c05917eSYinghai Lu	bool "Early printk via EHCI debug port"
299749986aSIngo Molnar	depends on EARLY_PRINTK && PCI
30aeb9dd1dSLu Baolu	select EARLY_PRINTK_USB
31a7f7f624SMasahiro Yamada	help
325c05917eSYinghai Lu	  Write kernel log output directly into the EHCI debug port.
335c05917eSYinghai Lu
345c05917eSYinghai Lu	  This is useful for kernel debugging when your machine crashes very
355c05917eSYinghai Lu	  early before the console code is initialized. For normal operation
365c05917eSYinghai Lu	  it is not recommended because it looks ugly and doesn't cooperate
37aeb9dd1dSLu Baolu	  with klogd/syslogd or the X server. You should normally say N here,
385c05917eSYinghai Lu	  unless you want to debug such a crash. You need usb debug device.
395c05917eSYinghai Lu
40aeb9dd1dSLu Baoluconfig EARLY_PRINTK_USB_XDBC
41aeb9dd1dSLu Baolu	bool "Early printk via the xHCI debug port"
42aeb9dd1dSLu Baolu	depends on EARLY_PRINTK && PCI
43aeb9dd1dSLu Baolu	select EARLY_PRINTK_USB
44a7f7f624SMasahiro Yamada	help
45aeb9dd1dSLu Baolu	  Write kernel log output directly into the xHCI debug port.
46aeb9dd1dSLu Baolu
47aeb9dd1dSLu Baolu	  One use for this feature is kernel debugging, for example when your
48aeb9dd1dSLu Baolu	  machine crashes very early before the regular console code is
49aeb9dd1dSLu Baolu	  initialized. Other uses include simpler, lockless logging instead of
50aeb9dd1dSLu Baolu	  a full-blown printk console driver + klogd.
51aeb9dd1dSLu Baolu
52aeb9dd1dSLu Baolu	  For normal production environments this is normally not recommended,
53aeb9dd1dSLu Baolu	  because it doesn't feed events into klogd/syslogd and doesn't try to
54aeb9dd1dSLu Baolu	  print anything on the screen.
55aeb9dd1dSLu Baolu
56aeb9dd1dSLu Baolu	  You should normally say N here, unless you want to debug early
57aeb9dd1dSLu Baolu	  crashes or need a very simple printk logging facility.
58aeb9dd1dSLu Baolu
5911cc8512SBorislav Petkovconfig EFI_PGT_DUMP
6011cc8512SBorislav Petkov	bool "Dump the EFI pagetable"
61e1a58320SStephen Smalley	depends on EFI
622ae27137SSteven Price	select PTDUMP_CORE
63a7f7f624SMasahiro Yamada	help
6411cc8512SBorislav Petkov	  Enable this if you want to dump the EFI page table before
6511cc8512SBorislav Petkov	  enabling virtual mode. This can be used to debug miscellaneous
6611cc8512SBorislav Petkov	  issues with the mapping of the EFI runtime regions into that
6711cc8512SBorislav Petkov	  table.
6811cc8512SBorislav Petkov
693df3212fSAlex Shiconfig DEBUG_TLBFLUSH
703df3212fSAlex Shi	bool "Set upper limit of TLB entries to flush one-by-one"
71cd69aa6bSPaul Bolle	depends on DEBUG_KERNEL
72a7f7f624SMasahiro Yamada	help
733df3212fSAlex Shi	  X86-only for now.
743df3212fSAlex Shi
753df3212fSAlex Shi	  This option allows the user to tune the amount of TLB entries the
763df3212fSAlex Shi	  kernel flushes one-by-one instead of doing a full TLB flush. In
773df3212fSAlex Shi	  certain situations, the former is cheaper. This is controlled by the
783df3212fSAlex Shi	  tlb_flushall_shift knob under /sys/kernel/debug/x86. If you set it
793df3212fSAlex Shi	  to -1, the code flushes the whole TLB unconditionally. Otherwise,
803df3212fSAlex Shi	  for positive values of it, the kernel will use single TLB entry
813df3212fSAlex Shi	  invalidating instructions according to the following formula:
823df3212fSAlex Shi
833df3212fSAlex Shi	  flush_entries <= active_tlb_entries / 2^tlb_flushall_shift
843df3212fSAlex Shi
853df3212fSAlex Shi	  If in doubt, say "N".
863df3212fSAlex Shi
87d013a27cSRandy Dunlapconfig IOMMU_DEBUG
88d013a27cSRandy Dunlap	bool "Enable IOMMU debugging"
89966396d3SJoerg Roedel	depends on GART_IOMMU && DEBUG_KERNEL
90d013a27cSRandy Dunlap	depends on X86_64
91a7f7f624SMasahiro Yamada	help
92d013a27cSRandy Dunlap	  Force the IOMMU to on even when you have less than 4GB of
93d013a27cSRandy Dunlap	  memory and add debugging code. On overflow always panic. And
94d013a27cSRandy Dunlap	  allow to enable IOMMU leak tracing. Can be disabled at boot
95d013a27cSRandy Dunlap	  time with iommu=noforce. This will also enable scatter gather
96d013a27cSRandy Dunlap	  list merging.  Currently not recommended for production
97d013a27cSRandy Dunlap	  code. When you use it make sure you have a big enough
98d013a27cSRandy Dunlap	  IOMMU/AGP aperture.  Most of the options enabled by this can
99d013a27cSRandy Dunlap	  be set more finegrained using the iommu= command line
100ff61f079SJonathan Corbet	  options. See Documentation/arch/x86/x86_64/boot-options.rst for more
101d013a27cSRandy Dunlap	  details.
102d013a27cSRandy Dunlap
103d013a27cSRandy Dunlapconfig IOMMU_LEAK
104d013a27cSRandy Dunlap	bool "IOMMU leak tracing"
10519c1a6f5SFUJITA Tomonori	depends on IOMMU_DEBUG && DMA_API_DEBUG
106a7f7f624SMasahiro Yamada	help
107d013a27cSRandy Dunlap	  Add a simple leak tracer to the IOMMU code. This is useful when you
108d013a27cSRandy Dunlap	  are debugging a buggy device driver that leaks IOMMU mappings.
109d013a27cSRandy Dunlap
1106bc5c366SPekka Paalanenconfig HAVE_MMIOTRACE_SUPPORT
1116bc5c366SPekka Paalanen	def_bool y
1128b7d89d0SPekka Paalanen
113ca0e9badSMasami Hiramatsuconfig X86_DECODER_SELFTEST
114ca0e9badSMasami Hiramatsu	bool "x86 instruction decoder selftest"
1157720804aSMasami Hiramatsu	depends on DEBUG_KERNEL && INSTRUCTION_DECODER
116f8f20234SIngo Molnar	depends on !COMPILE_TEST
117a7f7f624SMasahiro Yamada	help
118ca0e9badSMasami Hiramatsu	  Perform x86 instruction decoder selftests at build time.
119ca0e9badSMasami Hiramatsu	  This option is useful for checking the sanity of x86 instruction
120ca0e9badSMasami Hiramatsu	  decoder code.
121ca0e9badSMasami Hiramatsu	  If unsure, say "N".
122ca0e9badSMasami Hiramatsu
1236e7c4025SIngo Molnarchoice
1246e7c4025SIngo Molnar	prompt "IO delay type"
125fd59e9e9SIngo Molnar	default IO_DELAY_0X80
1266e7c4025SIngo Molnar
1276e7c4025SIngo Molnarconfig IO_DELAY_0X80
1286e7c4025SIngo Molnar	bool "port 0x80 based port-IO delay [recommended]"
129a7f7f624SMasahiro Yamada	help
1306e7c4025SIngo Molnar	  This is the traditional Linux IO delay used for in/out_p.
1316e7c4025SIngo Molnar	  It is the most tested hence safest selection here.
1326e7c4025SIngo Molnar
1336e7c4025SIngo Molnarconfig IO_DELAY_0XED
1346e7c4025SIngo Molnar	bool "port 0xed based port-IO delay"
135a7f7f624SMasahiro Yamada	help
1366e7c4025SIngo Molnar	  Use port 0xed as the IO delay. This frees up port 0x80 which is
1376e7c4025SIngo Molnar	  often used as a hardware-debug port.
1386e7c4025SIngo Molnar
1396e7c4025SIngo Molnarconfig IO_DELAY_UDELAY
1406e7c4025SIngo Molnar	bool "udelay based port-IO delay"
141a7f7f624SMasahiro Yamada	help
1426e7c4025SIngo Molnar	  Use udelay(2) as the IO delay method. This provides the delay
1436e7c4025SIngo Molnar	  while not having any side-effect on the IO port space.
1446e7c4025SIngo Molnar
1456e7c4025SIngo Molnarconfig IO_DELAY_NONE
1466e7c4025SIngo Molnar	bool "no port-IO delay"
147a7f7f624SMasahiro Yamada	help
1486e7c4025SIngo Molnar	  No port-IO delay. Will break on old boxes that require port-IO
1496e7c4025SIngo Molnar	  delay for certain operations. Should work on most new machines.
1506e7c4025SIngo Molnar
1516e7c4025SIngo Molnarendchoice
1526e7c4025SIngo Molnar
1536d7d7433SHuang, Yingconfig DEBUG_BOOT_PARAMS
1546d7d7433SHuang, Ying	bool "Debug boot parameters"
1556d7d7433SHuang, Ying	depends on DEBUG_KERNEL
1566d7d7433SHuang, Ying	depends on DEBUG_FS
157a7f7f624SMasahiro Yamada	help
1586d7d7433SHuang, Ying	  This option will cause struct boot_params to be exported via debugfs.
1596d7d7433SHuang, Ying
1600c42f392SAndi Kleenconfig CPA_DEBUG
161971a52d6SIngo Molnar	bool "CPA self-test code"
162f316fe68SIngo Molnar	depends on DEBUG_KERNEL
163a7f7f624SMasahiro Yamada	help
164971a52d6SIngo Molnar	  Do change_page_attr() self-tests every 30 seconds.
1650c42f392SAndi Kleen
166a97439aaSAndy Lutomirskiconfig DEBUG_ENTRY
167a97439aaSAndy Lutomirski	bool "Debug low-level entry code"
168a97439aaSAndy Lutomirski	depends on DEBUG_KERNEL
169a7f7f624SMasahiro Yamada	help
170a97439aaSAndy Lutomirski	  This option enables sanity checks in x86's low-level entry code.
171a97439aaSAndy Lutomirski	  Some of these sanity checks may slow down kernel entries and
172a97439aaSAndy Lutomirski	  exits or otherwise impact performance.
173a97439aaSAndy Lutomirski
174a97439aaSAndy Lutomirski	  If unsure, say N.
175a97439aaSAndy Lutomirski
17699e8b9caSDon Zickusconfig DEBUG_NMI_SELFTEST
17799e8b9caSDon Zickus	bool "NMI Selftest"
1784f941c57SDon Zickus	depends on DEBUG_KERNEL && X86_LOCAL_APIC
179a7f7f624SMasahiro Yamada	help
18099e8b9caSDon Zickus	  Enabling this option turns on a quick NMI selftest to verify
18199e8b9caSDon Zickus	  that the NMI behaves correctly.
18299e8b9caSDon Zickus
18399e8b9caSDon Zickus	  This might help diagnose strange hangs that rely on NMI to
18499e8b9caSDon Zickus	  function properly.
18599e8b9caSDon Zickus
18699e8b9caSDon Zickus	  If unsure, say N.
18799e8b9caSDon Zickus
18828a375dfSBryan O'Donoghueconfig DEBUG_IMR_SELFTEST
18928a375dfSBryan O'Donoghue	bool "Isolated Memory Region self test"
19028a375dfSBryan O'Donoghue	depends on INTEL_IMR
191a7f7f624SMasahiro Yamada	help
19228a375dfSBryan O'Donoghue	  This option enables automated sanity testing of the IMR code.
19328a375dfSBryan O'Donoghue	  Some simple tests are run to verify IMR bounds checking, alignment
19428a375dfSBryan O'Donoghue	  and overlapping. This option is really only useful if you are
19528a375dfSBryan O'Donoghue	  debugging an IMR memory map or are modifying the IMR code and want to
19628a375dfSBryan O'Donoghue	  test your changes.
19728a375dfSBryan O'Donoghue
19828a375dfSBryan O'Donoghue	  If unsure say N here.
19928a375dfSBryan O'Donoghue
200e97131a8SIngo Molnarconfig X86_DEBUG_FPU
201e97131a8SIngo Molnar	bool "Debug the x86 FPU code"
202e97131a8SIngo Molnar	depends on DEBUG_KERNEL
203e97131a8SIngo Molnar	default y
204a7f7f624SMasahiro Yamada	help
205e97131a8SIngo Molnar	  If this option is enabled then there will be extra sanity
206e97131a8SIngo Molnar	  checks and (boot time) debug printouts added to the kernel.
207e97131a8SIngo Molnar	  This debugging adds some small amount of runtime overhead
208e97131a8SIngo Molnar	  to the kernel.
209e97131a8SIngo Molnar
210e97131a8SIngo Molnar	  If unsure, say N.
211e97131a8SIngo Molnar
212956079e0SSrinivas Pandruvadaconfig PUNIT_ATOM_DEBUG
213956079e0SSrinivas Pandruvada	tristate "ATOM Punit debug driver"
214d689c64dSArnd Bergmann	depends on PCI
215956079e0SSrinivas Pandruvada	select DEBUG_FS
216956079e0SSrinivas Pandruvada	select IOSF_MBI
217a7f7f624SMasahiro Yamada	help
218956079e0SSrinivas Pandruvada	  This is a debug driver, which gets the power states
219956079e0SSrinivas Pandruvada	  of all Punit North Complex devices. The power states of
220956079e0SSrinivas Pandruvada	  each device is exposed as part of the debugfs interface.
221956079e0SSrinivas Pandruvada	  The current power state can be read from
222956079e0SSrinivas Pandruvada	  /sys/kernel/debug/punit_atom/dev_power_state
223956079e0SSrinivas Pandruvada
22481d38719SJosh Poimboeufchoice
22581d38719SJosh Poimboeuf	prompt "Choose kernel unwinder"
226fc72ae40SJosh Poimboeuf	default UNWINDER_ORC if X86_64
227fc72ae40SJosh Poimboeuf	default UNWINDER_FRAME_POINTER if X86_32
228a7f7f624SMasahiro Yamada	help
22981d38719SJosh Poimboeuf	  This determines which method will be used for unwinding kernel stack
23081d38719SJosh Poimboeuf	  traces for panics, oopses, bugs, warnings, perf, /proc/<pid>/stack,
23181d38719SJosh Poimboeuf	  livepatch, lockdep, and more.
23281d38719SJosh Poimboeuf
23311af8474SJosh Poimboeufconfig UNWINDER_ORC
234ee9f8fceSJosh Poimboeuf	bool "ORC unwinder"
23581d38719SJosh Poimboeuf	depends on X86_64
23603f16cd0SJosh Poimboeuf	select OBJTOOL
237a7f7f624SMasahiro Yamada	help
238ee9f8fceSJosh Poimboeuf	  This option enables the ORC (Oops Rewind Capability) unwinder for
239ee9f8fceSJosh Poimboeuf	  unwinding kernel stack traces.  It uses a custom data format which is
240ee9f8fceSJosh Poimboeuf	  a simplified version of the DWARF Call Frame Information standard.
241ee9f8fceSJosh Poimboeuf
242ee9f8fceSJosh Poimboeuf	  This unwinder is more accurate across interrupt entry frames than the
243a34a766fSJosh Poimboeuf	  frame pointer unwinder.  It also enables a 5-10% performance
244a34a766fSJosh Poimboeuf	  improvement across the entire kernel compared to frame pointers.
245ee9f8fceSJosh Poimboeuf
246ee9f8fceSJosh Poimboeuf	  Enabling this option will increase the kernel's runtime memory usage
247ee9f8fceSJosh Poimboeuf	  by roughly 2-4MB, depending on your kernel config.
248ee9f8fceSJosh Poimboeuf
249fc72ae40SJosh Poimboeufconfig UNWINDER_FRAME_POINTER
250fc72ae40SJosh Poimboeuf	bool "Frame pointer unwinder"
251*1d95dbaaSMasahiro Yamada	select ARCH_WANT_FRAME_POINTERS
252fc72ae40SJosh Poimboeuf	select FRAME_POINTER
253a7f7f624SMasahiro Yamada	help
254fc72ae40SJosh Poimboeuf	  This option enables the frame pointer unwinder for unwinding kernel
255fc72ae40SJosh Poimboeuf	  stack traces.
256fc72ae40SJosh Poimboeuf
257fc72ae40SJosh Poimboeuf	  The unwinder itself is fast and it uses less RAM than the ORC
258fc72ae40SJosh Poimboeuf	  unwinder, but the kernel text size will grow by ~3% and the kernel's
259fc72ae40SJosh Poimboeuf	  overall performance will degrade by roughly 5-10%.
260fc72ae40SJosh Poimboeuf
26111af8474SJosh Poimboeufconfig UNWINDER_GUESS
26281d38719SJosh Poimboeuf	bool "Guess unwinder"
26381d38719SJosh Poimboeuf	depends on EXPERT
2640a373d4fSAndrey Ryabinin	depends on !STACKDEPOT
265a7f7f624SMasahiro Yamada	help
26681d38719SJosh Poimboeuf	  This option enables the "guess" unwinder for unwinding kernel stack
26781d38719SJosh Poimboeuf	  traces.  It scans the stack and reports every kernel text address it
26881d38719SJosh Poimboeuf	  finds.  Some of the addresses it reports may be incorrect.
26981d38719SJosh Poimboeuf
27081d38719SJosh Poimboeuf	  While this option often produces false positives, it can still be
27181d38719SJosh Poimboeuf	  useful in many cases.  Unlike the other unwinders, it has no runtime
27281d38719SJosh Poimboeuf	  overhead.
27381d38719SJosh Poimboeuf
27481d38719SJosh Poimboeufendchoice
275