|
@@ -28,6 +28,8 @@ int panic_on_unrecovered_nmi;
|
|
|
int panic_on_io_nmi;
|
|
|
static int die_counter;
|
|
|
|
|
|
+static struct pt_regs exec_summary_regs;
|
|
|
+
|
|
|
bool in_task_stack(unsigned long *stack, struct task_struct *task,
|
|
|
struct stack_info *info)
|
|
|
{
|
|
@@ -321,6 +323,9 @@ void oops_end(unsigned long flags, struct pt_regs *regs, int signr)
|
|
|
raw_local_irq_restore(flags);
|
|
|
oops_exit();
|
|
|
|
|
|
+ /* Executive summary in case the oops scrolled away */
|
|
|
+ __show_regs(&exec_summary_regs, true);
|
|
|
+
|
|
|
if (!signr)
|
|
|
return;
|
|
|
if (in_interrupt())
|
|
@@ -339,10 +344,10 @@ NOKPROBE_SYMBOL(oops_end);
|
|
|
|
|
|
int __die(const char *str, struct pt_regs *regs, long err)
|
|
|
{
|
|
|
-#ifdef CONFIG_X86_32
|
|
|
- unsigned short ss;
|
|
|
- unsigned long sp;
|
|
|
-#endif
|
|
|
+ /* Save the regs of the first oops for the executive summary later. */
|
|
|
+ if (!die_counter)
|
|
|
+ exec_summary_regs = *regs;
|
|
|
+
|
|
|
printk(KERN_DEFAULT
|
|
|
"%s: %04lx [#%d]%s%s%s%s%s\n", str, err & 0xffff, ++die_counter,
|
|
|
IS_ENABLED(CONFIG_PREEMPT) ? " PREEMPT" : "",
|
|
@@ -352,26 +357,13 @@ int __die(const char *str, struct pt_regs *regs, long err)
|
|
|
IS_ENABLED(CONFIG_PAGE_TABLE_ISOLATION) ?
|
|
|
(boot_cpu_has(X86_FEATURE_PTI) ? " PTI" : " NOPTI") : "");
|
|
|
|
|
|
+ show_regs(regs);
|
|
|
+ print_modules();
|
|
|
+
|
|
|
if (notify_die(DIE_OOPS, str, regs, err,
|
|
|
current->thread.trap_nr, SIGSEGV) == NOTIFY_STOP)
|
|
|
return 1;
|
|
|
|
|
|
- print_modules();
|
|
|
- show_regs(regs);
|
|
|
-#ifdef CONFIG_X86_32
|
|
|
- if (user_mode(regs)) {
|
|
|
- sp = regs->sp;
|
|
|
- ss = regs->ss;
|
|
|
- } else {
|
|
|
- sp = kernel_stack_pointer(regs);
|
|
|
- savesegment(ss, ss);
|
|
|
- }
|
|
|
- printk(KERN_EMERG "EIP: %pS SS:ESP: %04x:%08lx\n",
|
|
|
- (void *)regs->ip, ss, sp);
|
|
|
-#else
|
|
|
- /* Executive summary in case the oops scrolled away */
|
|
|
- printk(KERN_ALERT "RIP: %pS RSP: %016lx\n", (void *)regs->ip, regs->sp);
|
|
|
-#endif
|
|
|
return 0;
|
|
|
}
|
|
|
NOKPROBE_SYMBOL(__die);
|