hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/lib/Kconfig.kgdb
....@@ -1,5 +1,11 @@
1
+# SPDX-License-Identifier: GPL-2.0-only
12
23 config HAVE_ARCH_KGDB
4
+ bool
5
+
6
+# set if architecture has the its kgdb_arch_handle_qxfer_pkt
7
+# function to enable gdb stub to address XML packet sent from GDB.
8
+config HAVE_ARCH_KGDB_QXFER_PKT
39 bool
410
511 menuconfig KGDB
....@@ -17,6 +23,21 @@
1723 unsure, say N.
1824
1925 if KGDB
26
+
27
+config KGDB_HONOUR_BLOCKLIST
28
+ bool "KGDB: use kprobe blocklist to prohibit unsafe breakpoints"
29
+ depends on HAVE_KPROBES
30
+ depends on MODULES
31
+ select KPROBES
32
+ default y
33
+ help
34
+ If set to Y the debug core will use the kprobe blocklist to
35
+ identify symbols where it is unsafe to set breakpoints.
36
+ In particular this disallows instrumentation of functions
37
+ called during debug trap handling and thus makes it very
38
+ difficult to inadvertently provoke recursive trap handling.
39
+
40
+ If unsure, say Y.
2041
2142 config KGDB_SERIAL_CONSOLE
2243 tristate "KGDB: use kgdb over the serial console"
....@@ -63,9 +84,9 @@
6384 depends on X86 || MIPS
6485 default n
6586 help
66
- This will add an extra call back to kgdb for the breakpoint
67
- exception handler which will allow kgdb to step through a
68
- notify handler.
87
+ This will add an extra call back to kgdb for the breakpoint
88
+ exception handler which will allow kgdb to step through a
89
+ notify handler.
6990
7091 config KGDB_KDB
7192 bool "KGDB_KDB: include kdb frontend for kgdb"
....@@ -95,7 +116,7 @@
95116
96117 The config option merely sets the default at boot time. Both
97118 issuing 'echo X > /sys/module/kdb/parameters/cmd_enable' or
98
- setting with kdb.cmd_enable=X kernel command line option will
119
+ setting with kdb.cmd_enable=X kernel command line option will
99120 override the default settings.
100121
101122 config KDB_KEYBOARD
....@@ -123,4 +144,22 @@
123144 CONFIG_KDB_CONTINUE_CATASTROPHIC == 2. KDB forces a reboot.
124145 If you are not sure, say 0.
125146
147
+config ARCH_HAS_EARLY_DEBUG
148
+ bool
149
+ default n
150
+ help
151
+ If an architecture can definitely handle entering the debugger
152
+ when early_param's are parsed then it select this config.
153
+ Otherwise, if "kgdbwait" is passed on the kernel command line it
154
+ won't actually be processed until dbg_late_init() just after the
155
+ call to kgdb_arch_late() is made.
156
+
157
+ NOTE: Even if this isn't selected by an architecture we will
158
+ still try to register kgdb to handle breakpoints and crashes
159
+ when early_param's are parsed, we just won't act on the
160
+ "kgdbwait" parameter until dbg_late_init(). If you get a
161
+ crash and try to drop into kgdb somewhere between these two
162
+ places you might or might not end up being able to use kgdb
163
+ depending on exactly how far along the architecture has initted.
164
+
126165 endif # KGDB