History

Merge tag 'kgdb-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux

Pull kgdb fixes from Daniel Thompson: "The main change here is a fix for a number of unsafe interactions between kdb and the console system. The fixes are specific to kdb (pure kgdb debugging does not use the console system at all). On systems with an NMI then kdb, if it is enabled, must get messages to the user despite potentially running from some "difficult" calling contexts. These fixes avoid using the console system where we have been provided an alternative (safer) way to interact with the user and, if using the console system in unavoidable, use oops_in_progress for deadlock avoidance. These fixes also ensure kdb honours the console enable flag. Also included is a fix that wraps kgdb trap handling in an RCU read lock to avoids triggering diagnostic warnings. This is a wide lock scope but this is OK because kgdb is a stop-the-world debugger. When we stop the world we put all the CPUs into holding pens and this inhibits RCU update anyway" * tag 'kgdb-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux: kgdb: Avoid suspicious RCU usage warning kdb: Switch to use safer dbg_io_ops over console APIs kdb: Make kdb_printf() console handling more robust kdb: Check status of console prior to invoking handlers kdb: Re-factor kdb_printf() message write code

Linus Torvalds committed 6 years ago

Commit 6116dea2 parents 21d2f68 440ab9e6 files · +68 −50Browse files

Showing the changes to include/linux (1 of 6 files). Show all

Unified · Split

include/linux/kgdb.h+2−3
@@ -276,8 +276,7 @@ struct kgdb_arch { · 275 unmodified lines
276 * the I/O driver.276 * the I/O driver.
277 * @post_exception: Pointer to a function that will do any cleanup work277 * @post_exception: Pointer to a function that will do any cleanup work
278 * for the I/O driver.278 * for the I/O driver.
279 * @is_console: 1 if the end device is a console 0 if the I/O device is279 * @cons: valid if the I/O device is a console; else NULL.
280 * not a console
281 */280 */
282struct kgdb_io {281struct kgdb_io {
283 const char *name;282 const char *name;
@@ -288,7 +287,7 @@ struct kgdb_io { · 4 unmodified lines
288 void (*deinit) (void);287 void (*deinit) (void);
289 void (*pre_exception) (void);288 void (*pre_exception) (void);
290 void (*post_exception) (void);289 void (*post_exception) (void);
291 int is_console;290 struct console *cons;
292};291};
293 292
294extern const struct kgdb_arch arch_kgdb_ops;293extern const struct kgdb_arch arch_kgdb_ops;