blob: 53c0f9c6d12817459138164bdd3522c4535d4497 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001menu "Kernel hacking"
2
3source "lib/Kconfig.debug"
4
5config STRICT_DEVMEM
6 bool "Filter access to /dev/mem"
7 depends on MMU
8 ---help---
9 If this option is disabled, you allow userspace (root) access to all
10 of memory, including kernel and userspace memory. Accidental
11 access to this is obviously disastrous, but specific access can
12 be used by people debugging the kernel.
13
14 If this option is switched on, the /dev/mem file only allows
15 userspace access to memory mapped peripherals.
16
17 If in doubt, say Y.
18
19# RMK wants arm kernels compiled with frame pointers or stack unwinding.
20# If you know what you are doing and are willing to live without stack
21# traces, you can get a slightly smaller kernel by setting this option to
22# n, but then RMK will have to kill you ;).
23config FRAME_POINTER
24 bool
25 depends on !THUMB2_KERNEL
26 default y if !ARM_UNWIND || FUNCTION_GRAPH_TRACER
27 help
28 If you say N here, the resulting kernel will be slightly smaller and
29 faster. However, if neither FRAME_POINTER nor ARM_UNWIND are enabled,
30 when a problem occurs with the kernel, the information that is
31 reported is severely limited.
32
33config ARM_UNWIND
34 bool "Enable stack unwinding support (EXPERIMENTAL)"
35 depends on AEABI && EXPERIMENTAL
36 default y
37 help
38 This option enables stack unwinding support in the kernel
39 using the information automatically generated by the
40 compiler. The resulting kernel image is slightly bigger but
41 the performance is not affected. Currently, this feature
42 only works with EABI compilers. If unsure say Y.
43
44config OLD_MCOUNT
45 bool
46 depends on FUNCTION_TRACER && FRAME_POINTER
47 default y
48
49config DEBUG_USER
50 bool "Verbose user fault messages"
51 help
52 When a user program crashes due to an exception, the kernel can
53 print a brief message explaining what the problem was. This is
54 sometimes helpful for debugging but serves no purpose on a
55 production system. Most people should say N here.
56
57 In addition, you need to pass user_debug=N on the kernel command
58 line to enable this feature. N consists of the sum of:
59
60 1 - undefined instruction events
61 2 - system calls
62 4 - invalid data aborts
63 8 - SIGSEGV faults
64 16 - SIGBUS faults
65
66config DEBUG_RODATA
67 bool "Write protect kernel text section"
68 default n
69 depends on DEBUG_KERNEL && MMU
70 ---help---
71 Mark the kernel text section as write-protected in the pagetables,
72 in order to catch accidental (and incorrect) writes to such const
73 data. This will cause the size of the kernel, plus up to 4MB, to
74 be mapped as pages instead of sections, which will increase TLB
75 pressure.
76 If in doubt, say "N".
77
78config DEBUG_RODATA_TEST
79 bool "Testcase for the DEBUG_RODATA feature"
80 depends on DEBUG_RODATA
81 default n
82 ---help---
83 This option enables a testcase for the DEBUG_RODATA
84 feature.
85 If in doubt, say "N"
86
87# These options are only for real kernel hackers who want to get their hands dirty.
88config DEBUG_LL
89 bool "Kernel low-level debugging functions (read help!)"
90 depends on DEBUG_KERNEL
91 help
92 Say Y here to include definitions of printascii, printch, printhex
93 in the kernel. This is helpful if you are debugging code that
94 executes before the console is initialized.
95
96 Note that selecting this option will limit the kernel to a single
97 UART definition, as specified below. Attempting to boot the kernel
98 image on a different platform *will not work*, so this option should
99 not be enabled for kernels that are intended to be portable.
100
101choice
102 prompt "Kernel low-level debugging port"
103 depends on DEBUG_LL
104
105 config AT91_DEBUG_LL_DBGU0
106 bool "Kernel low-level debugging on rm9200, 9260/9g20, 9261/9g10 and 9rl"
107 depends on HAVE_AT91_DBGU0
108
109 config AT91_DEBUG_LL_DBGU1
110 bool "Kernel low-level debugging on 9263 and 9g45"
111 depends on HAVE_AT91_DBGU1
112
113 config DEBUG_CLPS711X_UART1
114 bool "Kernel low-level debugging messages via UART1"
115 depends on ARCH_CLPS711X
116 help
117 Say Y here if you want the debug print routines to direct
118 their output to the first serial port on these devices.
119
120 config DEBUG_CLPS711X_UART2
121 bool "Kernel low-level debugging messages via UART2"
122 depends on ARCH_CLPS711X
123 help
124 Say Y here if you want the debug print routines to direct
125 their output to the second serial port on these devices.
126
127 config DEBUG_DC21285_PORT
128 bool "Kernel low-level debugging messages via footbridge serial port"
129 depends on FOOTBRIDGE
130 help
131 Say Y here if you want the debug print routines to direct
132 their output to the serial port in the DC21285 (Footbridge).
133
134 config DEBUG_FOOTBRIDGE_COM1
135 bool "Kernel low-level debugging messages via footbridge 8250 at PCI COM1"
136 depends on FOOTBRIDGE
137 help
138 Say Y here if you want the debug print routines to direct
139 their output to the 8250 at PCI COM1.
140
141 config DEBUG_HIGHBANK_UART
142 bool "Kernel low-level debugging messages via Highbank UART"
143 depends on ARCH_HIGHBANK
144 help
145 Say Y here if you want the debug print routines to direct
146 their output to the UART on Highbank based devices.
147
148 config DEBUG_IMX1_UART
149 bool "i.MX1 Debug UART"
150 depends on SOC_IMX1
151 help
152 Say Y here if you want kernel low-level debugging support
153 on i.MX1.
154
155 config DEBUG_IMX23_UART
156 bool "i.MX23 Debug UART"
157 depends on SOC_IMX23
158 help
159 Say Y here if you want kernel low-level debugging support
160 on i.MX23.
161
162 config DEBUG_IMX25_UART
163 bool "i.MX25 Debug UART"
164 depends on SOC_IMX25
165 help
166 Say Y here if you want kernel low-level debugging support
167 on i.MX25.
168
169 config DEBUG_IMX21_IMX27_UART
170 bool "i.MX21 and i.MX27 Debug UART"
171 depends on SOC_IMX21 || SOC_IMX27
172 help
173 Say Y here if you want kernel low-level debugging support
174 on i.MX21 or i.MX27.
175
176 config DEBUG_IMX28_UART
177 bool "i.MX28 Debug UART"
178 depends on SOC_IMX28
179 help
180 Say Y here if you want kernel low-level debugging support
181 on i.MX28.
182
183 config DEBUG_IMX31_IMX35_UART
184 bool "i.MX31 and i.MX35 Debug UART"
185 depends on SOC_IMX31 || SOC_IMX35
186 help
187 Say Y here if you want kernel low-level debugging support
188 on i.MX31 or i.MX35.
189
190 config DEBUG_IMX51_UART
191 bool "i.MX51 Debug UART"
192 depends on SOC_IMX51
193 help
194 Say Y here if you want kernel low-level debugging support
195 on i.MX51.
196
197 config DEBUG_IMX50_IMX53_UART
198 bool "i.MX50 and i.MX53 Debug UART"
199 depends on SOC_IMX50 || SOC_IMX53
200 help
201 Say Y here if you want kernel low-level debugging support
202 on i.MX50 or i.MX53.
203
204 config DEBUG_IMX6Q_UART4
205 bool "i.MX6Q Debug UART4"
206 depends on SOC_IMX6Q
207 help
208 Say Y here if you want kernel low-level debugging support
209 on i.MX6Q UART4.
210
211 config DEBUG_MSM_UART1
212 bool "Kernel low-level debugging messages via MSM UART1"
213 depends on ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50
214 help
215 Say Y here if you want the debug print routines to direct
216 their output to the first serial port on MSM devices.
217
218 config DEBUG_MSM_UART2
219 bool "Kernel low-level debugging messages via MSM UART2"
220 depends on ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50
221 help
222 Say Y here if you want the debug print routines to direct
223 their output to the second serial port on MSM devices.
224
225 config DEBUG_MSM_UART3
226 bool "Kernel low-level debugging messages via MSM UART3"
227 depends on ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50
228 help
229 Say Y here if you want the debug print routines to direct
230 their output to the third serial port on MSM devices.
231
232 config DEBUG_MSM8660_UART
233 bool "Kernel low-level debugging messages via MSM 8660 UART"
234 depends on ARCH_MSM8X60
235 select MSM_HAS_DEBUG_UART_HS
236 help
237 Say Y here if you want the debug print routines to direct
238 their output to the serial port on MSM 8660 devices.
239
240 config DEBUG_MSM8960_UART
241 bool "Kernel low-level debugging messages via MSM 8960 UART"
242 depends on ARCH_MSM8960
243 select MSM_HAS_DEBUG_UART_HS
244 help
245 Say Y here if you want the debug print routines to direct
246 their output to the serial port on MSM 8960 devices.
247
248 config DEBUG_REALVIEW_STD_PORT
249 bool "RealView Default UART"
250 depends on ARCH_REALVIEW
251 help
252 Say Y here if you want the debug print routines to direct
253 their output to the serial port on RealView EB, PB11MP, PBA8
254 and PBX platforms.
255
256 config DEBUG_REALVIEW_PB1176_PORT
257 bool "RealView PB1176 UART"
258 depends on MACH_REALVIEW_PB1176
259 help
260 Say Y here if you want the debug print routines to direct
261 their output to the standard serial port on the RealView
262 PB1176 platform.
263
264 config DEBUG_S3C_UART0
265 depends on PLAT_SAMSUNG
266 bool "Use S3C UART 0 for low-level debug"
267 help
268 Say Y here if you want the debug print routines to direct
269 their output to UART 0. The port must have been initialised
270 by the boot-loader before use.
271
272 The uncompressor code port configuration is now handled
273 by CONFIG_S3C_LOWLEVEL_UART_PORT.
274
275 config DEBUG_S3C_UART1
276 depends on PLAT_SAMSUNG
277 bool "Use S3C UART 1 for low-level debug"
278 help
279 Say Y here if you want the debug print routines to direct
280 their output to UART 1. The port must have been initialised
281 by the boot-loader before use.
282
283 The uncompressor code port configuration is now handled
284 by CONFIG_S3C_LOWLEVEL_UART_PORT.
285
286 config DEBUG_S3C_UART2
287 depends on PLAT_SAMSUNG
288 bool "Use S3C UART 2 for low-level debug"
289 help
290 Say Y here if you want the debug print routines to direct
291 their output to UART 2. The port must have been initialised
292 by the boot-loader before use.
293
294 The uncompressor code port configuration is now handled
295 by CONFIG_S3C_LOWLEVEL_UART_PORT.
296
297 config DEBUG_LL_UART_NONE
298 bool "No low-level debugging UART"
299 help
300 Say Y here if your platform doesn't provide a UART option
301 below. This relies on your platform choosing the right UART
302 definition internally in order for low-level debugging to
303 work.
304
305 config DEBUG_ICEDCC
306 bool "Kernel low-level debugging via EmbeddedICE DCC channel"
307 help
308 Say Y here if you want the debug print routines to direct
309 their output to the EmbeddedICE macrocell's DCC channel using
310 co-processor 14. This is known to work on the ARM9 style ICE
311 channel and on the XScale with the PEEDI.
312
313 Note that the system will appear to hang during boot if there
314 is nothing connected to read from the DCC.
315
316 config DEBUG_SEMIHOSTING
317 bool "Kernel low-level debug output via semihosting I"
318 help
319 Semihosting enables code running on an ARM target to use
320 the I/O facilities on a host debugger/emulator through a
321 simple SVC calls. The host debugger or emulator must have
322 semihosting enabled for the special svc call to be trapped
323 otherwise the kernel will crash.
324
325 This is known to work with OpenOCD, as wellas
326 ARM's Fast Models, or any other controlling environment
327 that implements semihosting.
328
329 For more details about semihosting, please see
330 chapter 8 of DUI0203I_rvct_developer_guide.pdf from ARM Ltd.
331
332endchoice
333
334config EARLY_PRINTK
335 bool "Early printk"
336 depends on DEBUG_LL
337 help
338 Say Y here if you want to have an early console using the
339 kernel low-level debugging functions. Add earlyprintk to your
340 kernel parameters to enable this console.
341
342config OC_ETM
343 bool "On-chip ETM and ETB"
344 depends on ARM_AMBA
345 help
346 Enables the on-chip embedded trace macrocell and embedded trace
347 buffer driver that will allow you to collect traces of the
348 kernel code.
349
350config ARM_KPROBES_TEST
351 tristate "Kprobes test module"
352 depends on KPROBES && MODULES
353 help
354 Perform tests of kprobes API and instruction set simulation.
355
356config ACCURATE_CPU_PERCENT
357 bool "Enable accurate cpu percent"
358 default y
359 help
360 This option enables accurate cpu percent.
361
362config IRQ_STACK
363 bool "Enable irq's own stack"
364 depends on PREEMPT_RT_FULL
365 default y
366 help
367 This option enables irq handler run in irq's own stack(not current task's stack) when CONFIG_PREEMPT_RT_FULL is enabled.
368
369endmenu