patch-2.3.40 linux/arch/i386/kernel/traps.c

Next file: linux/arch/i386/mm/fault.c
Previous file: linux/arch/i386/kernel/time.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.39/linux/arch/i386/kernel/traps.c linux/arch/i386/kernel/traps.c
@@ -138,7 +138,7 @@
 	unsigned short ss;
 	unsigned long *stack, addr, module_start, module_end;
 
-	esp = (unsigned long) (1+regs);
+	esp = (unsigned long) (&regs->esp);
 	ss = __KERNEL_DS;
 	if (regs->xcs & 3) {
 		in_kernel = 0;
@@ -337,7 +337,7 @@
 
 atomic_t nmi_counter[NR_CPUS];
 
-#if CONFIG_SMP
+#if CONFIG_X86_IO_APIC
 
 int nmi_watchdog = 1;
 
@@ -388,7 +388,12 @@
 		alert_counter[cpu]++;
 		if (alert_counter[cpu] == 5*HZ) {
 			spin_lock(&nmi_print_lock);
-			console_lock.lock = 0;	// we are in trouble anyway
+			/*
+			 * We are in trouble anyway, lets at least try
+			 * to get a message out.
+			 */
+			spin_trylock(&console_lock);
+			spin_unlock(&console_lock);
 			printk("NMI Watchdog detected LOCKUP on CPU%d, registers:\n", cpu);
 			show_registers(regs);
 			printk("console shuts up ...\n");
@@ -409,7 +414,7 @@
 
 	atomic_inc(nmi_counter+smp_processor_id());
 	if (!(reason & 0xc0)) {
-#if CONFIG_SMP
+#if CONFIG_X86_IO_APIC
 		/*
 		 * Ok, so this is none of the documented NMI sources,
 		 * so it must be the NMI watchdog.
@@ -600,7 +605,10 @@
 	pte = pte_offset(pmd, page);
 	__free_page(pte_page(*pte));
 	*pte = mk_pte_phys(__pa(&idt_table), PAGE_KERNEL_RO);
-	local_flush_tlb();
+	/*
+	 * Not that any PGE-capable kernel should have the f00f bug ...
+	 */
+	__flush_tlb_all();
 
 	/*
 	 * "idt" is magic - it overlaps the idt_descr
@@ -806,13 +814,9 @@
 	set_call_gate(&default_ldt[4],lcall27);
 
 	/*
-	 * on SMP we do not yet know which CPU is on which TSS,
-	 * so we delay this until smp_init(). (the CPU is already
-	 * in a reasonable state, otherwise we wouldnt have gotten so far :)
+	 * Should be a barrier for any external CPU state.
 	 */
-#ifndef __SMP__
 	cpu_init();
-#endif
 
 #ifdef CONFIG_X86_VISWS_APIC
 	superio_init();

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)