panic("GENERAL PROTECTION FAULT\n[error_code=%04x]\n", regs->error_code);
}
-static void nmi_action(unsigned long unused)
+static void nmi_mce_softirq(void)
{
/* Only used to defer wakeup of dom0,vcpu0 to a safe (non-NMI) context. */
vcpu_kick(dom0->vcpu[0]);
}
-static DECLARE_TASKLET(nmi_tasklet, nmi_action, 0);
-
static void nmi_dom0_report(unsigned int reason_idx)
{
struct domain *d;
set_bit(reason_idx, nmi_reason(d));
+ /* Not safe to wake a vcpu here, or even to schedule a tasklet! */
if ( !test_and_set_bool(v->nmi_pending) )
- tasklet_schedule(&nmi_tasklet); /* not safe to wake a vcpu here */
+ raise_softirq(NMI_MCE_SOFTIRQ);
}
asmlinkage void mem_parity_error(struct cpu_user_regs *regs)
percpu_traps_init();
cpu_init();
+
+ open_softirq(NMI_MCE_SOFTIRQ, nmi_mce_softirq);
}
long register_guest_nmi_callback(unsigned long address)
#ifndef __ASM_SOFTIRQ_H__
#define __ASM_SOFTIRQ_H__
-#define NR_ARCH_SOFTIRQS 0
+#define NMI_MCE_SOFTIRQ (NR_COMMON_SOFTIRQS + 0)
+
+#define NR_ARCH_SOFTIRQS 1
#endif /* __ASM_SOFTIRQ_H__ */