Below is a very preliminary patch that adds kexec/kdump invocation
functionality in kdb. It is currently based on 126.96.36.199 and
supported only for x86_64.
The main use case is for a user who would like to make use of the
interactive debugger but wants to conserve the option whether to
create a crash dump interactively. It also makes it possible to
dump even if the kernel hasn't crashed by manually entering kdb
and entering 'kdump' (yes I know sysrq also allows you to trigger
a crash dump).
There are a few issues with this patch (mainly being incomplete),
I'd like to check the public interest with this feature before I
develop it further.
/* Per cpu memory for storing cpu states in case of system crash. */
@@ -1045,6 +1051,12 @@ asmlinkage long compat_sys_kexec_load(unsigned long entry,
void crash_kexec(struct pt_regs *regs)
+ * If we enabled KDB, we don't want to automatically
+ * perform a kdump since KDB will be responsible for
+ * executing kdb through a special 'kdump' command.