xref: /openbmc/linux/arch/powerpc/Kconfig.debug (revision 79f382b9)
1# SPDX-License-Identifier: GPL-2.0
2
3config PPC_DISABLE_WERROR
4	bool "Don't build arch/powerpc code with -Werror"
5	help
6	  This option tells the compiler NOT to build the code under
7	  arch/powerpc with the -Werror flag (which means warnings
8	  are treated as errors).
9
10	  Only enable this if you are hitting a build failure in the
11	  arch/powerpc code caused by a warning, and you don't feel
12	  inclined to fix it.
13
14config PPC_WERROR
15	bool
16	depends on !PPC_DISABLE_WERROR
17	default y
18
19config PRINT_STACK_DEPTH
20	int "Stack depth to print" if DEBUG_KERNEL
21	default 64
22	help
23	  This option allows you to set the stack depth that the kernel
24	  prints in stack traces. This can be useful if your display is
25	  too small and stack traces cause important information to
26	  scroll off the screen.
27
28config HCALL_STATS
29	bool "Hypervisor call instrumentation"
30	depends on PPC_PSERIES && DEBUG_FS && TRACEPOINTS
31	help
32	  Adds code to keep track of the number of hypervisor calls made and
33	  the amount of time spent in hypervisor calls.  Wall time spent in
34	  each call is always calculated, and if available CPU cycles spent
35	  are also calculated.  A directory named hcall_inst is added at the
36	  root of the debugfs filesystem.  Within the hcall_inst directory
37	  are files that contain CPU specific call statistics.
38
39	  This option will add a small amount of overhead to all hypervisor
40	  calls.
41
42config PPC_EMULATED_STATS
43	bool "Emulated instructions tracking"
44	depends on DEBUG_FS
45	help
46	  Adds code to keep track of the number of instructions that are
47	  emulated by the in-kernel emulator. Counters for the various classes
48	  of emulated instructions are available under
49	  powerpc/emulated_instructions/ in the root of the debugfs file
50	  system. Optionally (controlled by
51	  powerpc/emulated_instructions/do_warn in debugfs), rate-limited
52	  warnings can be printed to the console when instructions are
53	  emulated.
54
55config CODE_PATCHING_SELFTEST
56	bool "Run self-tests of the code-patching code"
57	depends on DEBUG_KERNEL
58
59config JUMP_LABEL_FEATURE_CHECKS
60	bool "Enable use of jump label for cpu/mmu_has_feature()"
61	depends on JUMP_LABEL
62	default y
63	help
64	  Selecting this options enables use of jump labels for some internal
65	  feature checks. This should generate more optimal code for those
66	  checks.
67
68config JUMP_LABEL_FEATURE_CHECK_DEBUG
69	bool "Do extra check on feature fixup calls"
70	depends on DEBUG_KERNEL && JUMP_LABEL_FEATURE_CHECKS
71	help
72	  This tries to catch incorrect usage of cpu_has_feature() and
73	  mmu_has_feature() in the code.
74
75	  If you don't know what this means, say N.
76
77config FTR_FIXUP_SELFTEST
78	bool "Run self-tests of the feature-fixup code"
79	depends on DEBUG_KERNEL
80
81config MSI_BITMAP_SELFTEST
82	bool "Run self-tests of the MSI bitmap code"
83	depends on DEBUG_KERNEL
84
85config PPC_IRQ_SOFT_MASK_DEBUG
86	bool "Include extra checks for powerpc irq soft masking"
87
88config XMON
89	bool "Include xmon kernel debugger"
90	depends on DEBUG_KERNEL
91	select CONSOLE_POLL if SERIAL_CPM_CONSOLE
92	help
93	  Include in-kernel hooks for the xmon kernel monitor/debugger.
94	  Unless you are intending to debug the kernel, say N here.
95	  Make sure to enable also CONFIG_BOOTX_TEXT on Macs. Otherwise
96	  nothing will appear on the screen (xmon writes directly to the
97	  framebuffer memory).
98	  The cmdline option 'xmon' or 'xmon=early' will drop into xmon
99	  very early during boot. 'xmon=on' will just enable the xmon
100	  debugger hooks.  'xmon=off' will disable the debugger hooks
101	  if CONFIG_XMON_DEFAULT is set.
102	  xmon will print a backtrace on the very first invocation.
103	  'xmon=nobt' will disable this autobacktrace.
104
105config XMON_DEFAULT
106	bool "Enable xmon by default"
107	depends on XMON
108	help
109	  xmon is normally disabled unless booted with 'xmon=on'.
110	  Use 'xmon=off' to disable xmon init during runtime.
111
112config XMON_DISASSEMBLY
113	bool "Include disassembly support in xmon"
114	depends on XMON
115	default y
116	help
117	  Include support for disassembling in xmon. You probably want
118	  to say Y here, unless you're building for a memory-constrained
119	  system.
120
121config XMON_DEFAULT_RO_MODE
122	bool "Restrict xmon to read-only operations by default"
123	depends on XMON
124	default y
125	help
126	  Operate xmon in read-only mode. The cmdline options 'xmon=rw' and
127	  'xmon=ro' override this default.
128
129config DEBUGGER
130	bool
131	depends on KGDB || XMON
132	default y
133
134config BDI_SWITCH
135	bool "Include BDI-2000 user context switcher"
136	depends on DEBUG_KERNEL && PPC32
137	help
138	  Include in-kernel support for the Abatron BDI2000 debugger.
139	  Unless you are intending to debug the kernel with one of these
140	  machines, say N here.
141
142config BOOTX_TEXT
143	bool "Support for early boot text console (BootX or OpenFirmware only)"
144	depends on PPC_BOOK3S
145	help
146	  Say Y here to see progress messages from the boot firmware in text
147	  mode. Requires either BootX or Open Firmware.
148
149config PPC_EARLY_DEBUG
150	bool "Early debugging (dangerous)"
151	help
152	  Say Y to enable some early debugging facilities that may be available
153	  for your processor/board combination. Those facilities are hacks
154	  intended to debug problems early during boot, this should not be
155	  enabled in a production kernel.
156	  Note that enabling this will also cause the kernel default log level
157	  to be pushed to max automatically very early during boot
158
159choice
160	prompt "Early debugging console"
161	depends on PPC_EARLY_DEBUG
162	help
163	  Use the selected console for early debugging. Careful, if you
164	  enable debugging for the wrong type of machine your kernel
165	  _will not boot_.
166
167config PPC_EARLY_DEBUG_BOOTX
168	bool "BootX or OpenFirmware"
169	depends on BOOTX_TEXT
170	help
171	  Select this to enable early debugging for a machine using BootX
172	  or OpenFirmware.
173
174config PPC_EARLY_DEBUG_LPAR
175	bool "LPAR HV Console"
176	depends on PPC_PSERIES && HVC_CONSOLE
177	help
178	  Select this to enable early debugging for a machine with a HVC
179	  console on vterm 0.
180
181config PPC_EARLY_DEBUG_LPAR_HVSI
182	bool "LPAR HVSI Console"
183	depends on PPC_PSERIES && HVC_CONSOLE
184	help
185	  Select this to enable early debugging for a machine with a HVSI
186	  console on a specified vterm.
187
188config PPC_EARLY_DEBUG_G5
189	bool "Apple G5"
190	depends on PPC_PMAC64
191	help
192	  Select this to enable early debugging for Apple G5 machines.
193
194config PPC_EARLY_DEBUG_RTAS_PANEL
195	bool "RTAS Panel"
196	depends on PPC_RTAS
197	help
198	  Select this to enable early debugging via the RTAS panel.
199
200config PPC_EARLY_DEBUG_RTAS_CONSOLE
201	bool "RTAS Console"
202	depends on PPC_RTAS
203	select UDBG_RTAS_CONSOLE
204	help
205	  Select this to enable early debugging via the RTAS console.
206
207config PPC_EARLY_DEBUG_MAPLE
208	bool "Maple real mode"
209	depends on PPC_MAPLE
210	help
211	  Select this to enable early debugging for Maple.
212
213config PPC_EARLY_DEBUG_PAS_REALMODE
214	bool "PA Semi real mode"
215	depends on PPC_PASEMI
216	help
217	  Select this to enable early debugging for PA Semi.
218	  Output will be on UART0.
219
220config PPC_EARLY_DEBUG_44x
221	bool "Early serial debugging for IBM/AMCC 44x CPUs"
222	depends on 44x
223	help
224	  Select this to enable early debugging for IBM 44x chips via the
225	  inbuilt serial port.  If you enable this, ensure you set
226	  PPC_EARLY_DEBUG_44x_PHYSLOW below to suit your target board.
227
228config PPC_EARLY_DEBUG_40x
229	bool "Early serial debugging for IBM/AMCC 40x CPUs"
230	depends on 40x
231	help
232	  Select this to enable early debugging for IBM 40x chips via the
233	  inbuilt serial port. This works on chips with a 16550 compatible
234	  UART.
235
236config PPC_EARLY_DEBUG_CPM
237	bool "Early serial debugging for Freescale CPM-based serial ports"
238	depends on SERIAL_CPM
239	help
240	  Select this to enable early debugging for Freescale chips
241	  using a CPM-based serial port.  This assumes that the bootwrapper
242	  has run, and set up the CPM in a particular way.
243
244config PPC_EARLY_DEBUG_USBGECKO
245	bool "Early debugging through the USB Gecko adapter"
246	depends on GAMECUBE_COMMON
247	select USBGECKO_UDBG
248	help
249	  Select this to enable early debugging for Nintendo GameCube/Wii
250	  consoles via an external USB Gecko adapter.
251
252config PPC_EARLY_DEBUG_PS3GELIC
253	bool "Early debugging through the PS3 Ethernet port"
254	depends on PPC_PS3
255	select PS3GELIC_UDBG
256	help
257	  Select this to enable early debugging for the PlayStation3 via
258	  UDP broadcasts sent out through the Ethernet port.
259
260config PPC_EARLY_DEBUG_OPAL_RAW
261	bool "OPAL raw console"
262	depends on HVC_OPAL
263	help
264	  Select this to enable early debugging for the PowerNV platform
265	  using a "raw" console
266
267config PPC_EARLY_DEBUG_OPAL_HVSI
268	bool "OPAL hvsi console"
269	depends on HVC_OPAL
270	help
271	  Select this to enable early debugging for the PowerNV platform
272	  using an "hvsi" console
273
274config PPC_EARLY_DEBUG_MEMCONS
275	bool "In memory console"
276	help
277	  Select this to enable early debugging using an in memory console.
278	  This console provides input and output buffers stored within the
279	  kernel BSS and should be safe to select on any system. A debugger
280	  can then be used to read kernel output or send input to the console.
281endchoice
282
283config PPC_MEMCONS_OUTPUT_SIZE
284	int "In memory console output buffer size"
285	depends on PPC_EARLY_DEBUG_MEMCONS
286	default 4096
287	help
288	  Selects the size of the output buffer (in bytes) of the in memory
289	  console.
290
291config PPC_MEMCONS_INPUT_SIZE
292	int "In memory console input buffer size"
293	depends on PPC_EARLY_DEBUG_MEMCONS
294	default 128
295	help
296	  Selects the size of the input buffer (in bytes) of the in memory
297	  console.
298
299config PPC_EARLY_DEBUG_OPAL
300	def_bool y
301	depends on PPC_EARLY_DEBUG_OPAL_RAW || PPC_EARLY_DEBUG_OPAL_HVSI
302
303
304config PPC_EARLY_DEBUG_HVSI_VTERMNO
305	hex "vterm number to use with early debug HVSI"
306	depends on PPC_EARLY_DEBUG_LPAR_HVSI
307	default "0x30000000"
308	help
309	  You probably want 0x30000000 for your first serial port and
310	  0x30000001 for your second one
311
312config PPC_EARLY_DEBUG_OPAL_VTERMNO
313	hex "vterm number to use with OPAL early debug"
314	depends on PPC_EARLY_DEBUG_OPAL
315	default "0"
316	help
317	  This correspond to which /dev/hvcN you want to use for early
318	  debug.
319
320	  On OPAL v2, this will be 0 for network console and 1 or 2 for
321	  the machine built-in serial ports.
322
323config PPC_EARLY_DEBUG_44x_PHYSLOW
324	hex "Low 32 bits of early debug UART physical address"
325	depends on PPC_EARLY_DEBUG_44x
326	default "0x40000200"
327	help
328	  You probably want 0x40000200 for ebony boards and
329	  0x40000300 for taishan
330
331config PPC_EARLY_DEBUG_44x_PHYSHIGH
332	hex "EPRN of early debug UART physical address"
333	depends on PPC_EARLY_DEBUG_44x
334	default "0x1"
335
336config PPC_EARLY_DEBUG_40x_PHYSADDR
337	hex "Early debug UART physical address"
338	depends on PPC_EARLY_DEBUG_40x
339	default "0xef600300"
340
341config PPC_EARLY_DEBUG_CPM_ADDR
342	hex "CPM UART early debug transmit descriptor address"
343	depends on PPC_EARLY_DEBUG_CPM
344	default "0xfa202008" if PPC_EP88XC
345	default "0xf0001ff8" if CPM2
346	default "0xff002008" if CPM1
347	help
348	  This specifies the address of the transmit descriptor
349	  used for early debug output.  Because it is needed before
350	  platform probing is done, all platforms selected must
351	  share the same address.
352
353config FAIL_IOMMU
354	bool "Fault-injection capability for IOMMU"
355	depends on FAULT_INJECTION
356	help
357	  Provide fault-injection capability for IOMMU. Each device can
358	  be selectively enabled via the fail_iommu property.
359
360	  If you are unsure, say N.
361
362config PPC_PTDUMP
363	bool "Export kernel pagetable layout to userspace via debugfs"
364	depends on DEBUG_KERNEL && DEBUG_FS
365	help
366	  This option exports the state of the kernel pagetables to a
367	  debugfs file. This is only useful for kernel developers who are
368	  working in architecture specific areas of the kernel - probably
369	  not a good idea to enable this feature in a production kernel.
370
371	  If you are unsure, say N.
372
373config PPC_DEBUG_WX
374	bool "Warn on W+X mappings at boot"
375	depends on PPC_PTDUMP && STRICT_KERNEL_RWX
376	help
377	  Generate a warning if any W+X mappings are found at boot.
378
379	  This is useful for discovering cases where the kernel is leaving
380	  W+X mappings after applying NX, as such mappings are a security risk.
381
382	  Note that even if the check fails, your kernel is possibly
383	  still fine, as W+X mappings are not a security hole in
384	  themselves, what they do is that they make the exploitation
385	  of other unfixed kernel bugs easier.
386
387	  There is no runtime or memory usage effect of this option
388	  once the kernel has booted up - it's a one time check.
389
390	  If in doubt, say "Y".
391
392config PPC_FAST_ENDIAN_SWITCH
393	bool "Deprecated fast endian-switch syscall"
394	depends on DEBUG_KERNEL && PPC_BOOK3S_64
395	help
396	  If you're unsure what this is, say N.
397
398config KASAN_SHADOW_OFFSET
399	hex
400	depends on KASAN
401	default 0xe0000000
402