~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise-security

« back to all changes in this revision

Viewing changes to arch/x86/kernel/reboot.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati
  • Date: 2011-12-06 15:56:07 UTC
  • Revision ID: package-import@ubuntu.com-20111206155607-pcf44kv5fmhk564f
Tags: 3.2.0-1401.1
[ Paolo Pisati ]

* Rebased on top of Ubuntu-3.2.0-3.8
* Tilt-tracking @ ef2487af4bb15bdd0689631774b5a5e3a59f74e2
* Delete debian.ti-omap4/control, it shoudln't be tracked
* Fix architecture spelling (s/armel/armhf/)
* [Config] Update configs following 3.2 import
* [Config] Fix compilation: disable CODA and ARCH_OMAP3
* [Config] Fix compilation: disable Ethernet Faraday
* Update series to precise

Show diffs side-by-side

added added

removed removed

Lines of Context:
496
496
        }
497
497
}
498
498
 
499
 
static void vmxoff_nmi(int cpu, struct die_args *args)
 
499
static void vmxoff_nmi(int cpu, struct pt_regs *regs)
500
500
{
501
501
        cpu_emergency_vmxoff();
502
502
}
768
768
 
769
769
static atomic_t waiting_for_crash_ipi;
770
770
 
771
 
static int crash_nmi_callback(struct notifier_block *self,
772
 
                        unsigned long val, void *data)
 
771
static int crash_nmi_callback(unsigned int val, struct pt_regs *regs)
773
772
{
774
773
        int cpu;
775
774
 
776
 
        if (val != DIE_NMI)
777
 
                return NOTIFY_OK;
778
 
 
779
775
        cpu = raw_smp_processor_id();
780
776
 
781
777
        /* Don't do anything if this handler is invoked on crashing cpu.
783
779
         * an NMI if system was initially booted with nmi_watchdog parameter.
784
780
         */
785
781
        if (cpu == crashing_cpu)
786
 
                return NOTIFY_STOP;
 
782
                return NMI_HANDLED;
787
783
        local_irq_disable();
788
784
 
789
 
        shootdown_callback(cpu, (struct die_args *)data);
 
785
        shootdown_callback(cpu, regs);
790
786
 
791
787
        atomic_dec(&waiting_for_crash_ipi);
792
788
        /* Assume hlt works */
794
790
        for (;;)
795
791
                cpu_relax();
796
792
 
797
 
        return 1;
 
793
        return NMI_HANDLED;
798
794
}
799
795
 
800
796
static void smp_send_nmi_allbutself(void)
802
798
        apic->send_IPI_allbutself(NMI_VECTOR);
803
799
}
804
800
 
805
 
static struct notifier_block crash_nmi_nb = {
806
 
        .notifier_call = crash_nmi_callback,
807
 
        /* we want to be the first one called */
808
 
        .priority = NMI_LOCAL_HIGH_PRIOR+1,
809
 
};
810
 
 
811
801
/* Halt all other CPUs, calling the specified function on each of them
812
802
 *
813
803
 * This function can be used to halt all other CPUs on crash
826
816
 
827
817
        atomic_set(&waiting_for_crash_ipi, num_online_cpus() - 1);
828
818
        /* Would it be better to replace the trap vector here? */
829
 
        if (register_die_notifier(&crash_nmi_nb))
 
819
        if (register_nmi_handler(NMI_LOCAL, crash_nmi_callback,
 
820
                                 NMI_FLAG_FIRST, "crash"))
830
821
                return;         /* return what? */
831
822
        /* Ensure the new callback function is set before sending
832
823
         * out the NMI