Corey,

NMI compile fixes for x86_64, and for x86 with CONFIG_X86_HT disabled.

Signed-off-by: Bill Rugolsky <[EMAIL PROTECTED]>

--- linux-2.6.17/arch/x86_64/kernel/crash.c     2006-07-06 08:25:02.000000000 
-0400
+++ linux-2.6.17/arch/x86_64/kernel/crash.c     2006-07-06 08:25:46.000000000 
-0400
@@ -95,7 +95,8 @@ static void crash_save_self(struct pt_re
 #ifdef CONFIG_SMP
 static atomic_t waiting_for_crash_ipi;
 
-static int crash_nmi_callback(struct pt_regs *regs, int cpu)
+static int crash_nmi_callback(void *devid, struct pt_regs *regs, int cpu,
+                             int handled)
 {
        /*
         * Don't do anything if this handler is invoked on crashing cpu.
@@ -103,7 +104,7 @@ static int crash_nmi_callback(struct pt_
         * an NMI if system was initially booted with nmi_watchdog parameter.
         */
        if (cpu == crashing_cpu)
-               return 1;
+               return NOTIFY_DONE;
        local_irq_disable();
 
        crash_save_this_cpu(regs, cpu);
@@ -113,7 +114,7 @@ static int crash_nmi_callback(struct pt_
        for(;;)
                asm("hlt");
 
-       return 1;
+       return NOTIFY_OK;
 }
 
 static void smp_send_nmi_allbutself(void)
@@ -127,12 +128,23 @@ static void smp_send_nmi_allbutself(void
  * cpu hotplug shouldn't matter.
  */
 
+static struct nmi_handler crash_nmi_handler =
+{
+       .link     = LIST_HEAD_INIT(crash_nmi_handler.link),
+       .dev_name = "crash",
+       .dev_id   = NULL,
+       .handler  = crash_nmi_callback,
+       .priority = NMI_HANDLER_MAX_PRIORITY /* Highest possible priority */
+};
+
 static void nmi_shootdown_cpus(void)
 {
        unsigned long msecs;
 
        atomic_set(&waiting_for_crash_ipi, num_online_cpus() - 1);
-       set_nmi_callback(crash_nmi_callback);
+
+       /* Would it be better to replace the trap vector here? */
+       request_nmi(&crash_nmi_handler);
 
        /*
         * Ensure the new callback function is set before sending
--- linux-2.6.17/arch/i386/kernel/nmi.c 2006-07-06 08:25:02.000000000 -0400
+++ linux-2.6.17/arch/i386/kernel/nmi.c 2006-07-06 08:26:43.000000000 -0400
@@ -515,9 +515,11 @@ static int p4_watchdog_reset(int handled
 {
        unsigned int low, high;
        int          ovf;
+#ifdef CONFIG_X86_HT
        int          phys = phys_proc_id[cpu];
 
        spin_lock(&p4_nmiwd_lock[phys]);
+#endif
        rdmsr(MSR_P4_IQ_CCCR0, low, high);
        ovf = (low & P4_CCCR_OVF) != 0;
        if (ovf) {
@@ -550,9 +552,9 @@ static int p4_watchdog_reset(int handled
                p4_log_nmiwd_cnt[cpu] = p4_phys_nmiwd_cnt[phys];
                apic_write(APIC_LVTPC, APIC_DM_NMI);
        }
-#endif
 
        spin_unlock(&p4_nmiwd_lock[phys]);
+#endif
 
        return ovf;
 }
@@ -580,8 +582,8 @@ static int setup_p4_watchdog(void)
                                spin_lock_init(&p4_nmiwd_lock[cpu]);
                }
                wdog_initialized = 1;
-       }
 #endif
+       }
 
        if (!(misc_enable & MSR_P4_MISC_ENABLE_PEBS_UNAVAIL))
                clear_msr_range(0x3F1, 2);
--- linux-2.6.17/drivers/serial/8250.c  2006-07-06 08:25:02.000000000 -0400
+++ linux-2.6.17/drivers/serial/8250.c  2006-07-06 08:25:46.000000000 -0400
@@ -39,7 +39,7 @@
 #include <linux/serial_core.h>
 #include <linux/serial.h>
 #include <linux/serial_8250.h>
-#include <linux/nmi.h>
+#include <linux/nmi_watchdog.h>
 #include <linux/mutex.h>
 
 #include <asm/io.h>

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Openipmi-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openipmi-developer

Reply via email to