cpumask_copy(&dump_execstate_mask, &cpu_online_map);
/* Get local execution state out immediately, in case we get stuck. */
- dump_execstate(regs);
+ if ( regs )
+ dump_execstate(regs);
+ else
+ run_in_exception_handler(dump_execstate);
/* Alt. handling: remaining CPUs are dumped asynchronously one-by-one. */
if ( alt_key_handling )
tasklet_schedule(&run_all_keyhandlers_tasklet);
}
-static void do_debug_key(unsigned char key, struct cpu_user_regs *regs)
+static void do_debugger_trap_fatal(struct cpu_user_regs *regs)
{
- printk("'%c' pressed -> trapping into debugger\n", key);
(void)debugger_trap_fatal(0xf001, regs);
/* Prevent tail call optimisation, which confuses xendbg. */
barrier();
}
+static void do_debug_key(unsigned char key, struct cpu_user_regs *regs)
+{
+ printk("'%c' pressed -> trapping into debugger\n", key);
+ if ( regs )
+ do_debugger_trap_fatal(regs);
+ else
+ run_in_exception_handler(do_debugger_trap_fatal);
+}
+
static void do_toggle_alt_key(unsigned char key, struct cpu_user_regs *regs)
{
alt_key_handling = !alt_key_handling;