Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 120800
b: refs/heads/master
c: a7d4182
h: refs/heads/master
v: v3
  • Loading branch information
Eduardo Habkost authored and Ingo Molnar committed Nov 12, 2008
1 parent 49c1e58 commit 9afe467
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: eb42c75878e4d13941dcbcf2ef1027c257b099a6
refs/heads/master: a7d41820f683c35b53af719210a51f6aa0f86a6a
31 changes: 20 additions & 11 deletions trunk/arch/x86/kernel/crash.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,34 @@ static int crashing_cpu;
#if defined(CONFIG_SMP) && defined(CONFIG_X86_LOCAL_APIC)
static atomic_t waiting_for_crash_ipi;

static int crash_nmi_callback(struct notifier_block *self,
unsigned long val, void *data)
static void kdump_nmi_callback(int cpu, struct die_args *args)
{
struct pt_regs *regs;
#ifdef CONFIG_X86_32
struct pt_regs fixed_regs;
#endif

regs = args->regs;

#ifdef CONFIG_X86_32
if (!user_mode_vm(regs)) {
crash_fixup_ss_esp(&fixed_regs, regs);
regs = &fixed_regs;
}
#endif
crash_save_cpu(regs, cpu);

disable_local_APIC();
}

static int crash_nmi_callback(struct notifier_block *self,
unsigned long val, void *data)
{
int cpu;

if (val != DIE_NMI_IPI)
return NOTIFY_OK;

regs = ((struct die_args *)data)->regs;
cpu = raw_smp_processor_id();

/* Don't do anything if this handler is invoked on crashing cpu.
Expand All @@ -58,14 +73,8 @@ static int crash_nmi_callback(struct notifier_block *self,
return NOTIFY_STOP;
local_irq_disable();

#ifdef CONFIG_X86_32
if (!user_mode_vm(regs)) {
crash_fixup_ss_esp(&fixed_regs, regs);
regs = &fixed_regs;
}
#endif
crash_save_cpu(regs, cpu);
disable_local_APIC();
kdump_nmi_callback(cpu, (struct die_args *)data);

atomic_dec(&waiting_for_crash_ipi);
/* Assume hlt works */
halt();
Expand Down

0 comments on commit 9afe467

Please sign in to comment.