aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/kernel/traps.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-01-02 15:33:12 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-02 15:33:12 -0800
commita8e782348d9f0dc64f6adb81f5f6959921949f13 (patch)
tree7a51119583b33fd2394f45dc3f7ff56b65095774 /arch/x86/kernel/traps.c
parent6680598b44ed3c0052d155522eb21fc5a00de5f3 (diff)
parent47dabdc7fcd4daa52dcda72a1f18603dd168355d (diff)
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (27 commits) x86: mpparse.c fix style problems x86: nmi.c fix style problems x86: ldt.c fix style problems x86: cpuid.c fix style problems x86, UV: remove erroneous BAU initialization x86: fix incorrect __read_mostly on _boot_cpu_pda x86: convert permanent_kmaps_init() from macro to inline x86: early_printk - use sizeof instead of hardcoded number x86: xsave.c: restore_user_xstate should be static x86: uv_bau.h: fix dubious bitfield x86: apic.c: xapic_icr_read and x2apic_icr_read should be static x86: bios_uv.c: uv_systab should be static x86: genx2apic_phys.c: x2apic_send_IPI_self and init_x2apic_ldr should be static x86: amd_iommu.c: prealloc_protection_domains should be static x86: amd_iommu_init.c: iommu_enable and iommu_enable_event_logging should be static x86, pci: move arch/x86/pci/pci.h to arch/x86/include/asm/pci_x86.h x86_64: pci-gart_64.c iommu_fullflush should be static x86: efi.c declare add_efi_memmap before they get used x86: io_apic.c io_apic_sync should be static x86: apic.c declare pic_mode before they get used ...
Diffstat (limited to 'arch/x86/kernel/traps.c')
-rw-r--r--arch/x86/kernel/traps.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 2d1f4c7e405..ce6650eb64e 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -292,8 +292,10 @@ dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code)
tsk->thread.error_code = error_code;
tsk->thread.trap_no = 8;
- /* This is always a kernel trap and never fixable (and thus must
- never return). */
+ /*
+ * This is always a kernel trap and never fixable (and thus must
+ * never return).
+ */
for (;;)
die(str, regs, error_code);
}
@@ -520,9 +522,11 @@ dotraplinkage void __kprobes do_int3(struct pt_regs *regs, long error_code)
}
#ifdef CONFIG_X86_64
-/* Help handler running on IST stack to switch back to user stack
- for scheduling or signal handling. The actual stack switch is done in
- entry.S */
+/*
+ * Help handler running on IST stack to switch back to user stack
+ * for scheduling or signal handling. The actual stack switch is done in
+ * entry.S
+ */
asmlinkage __kprobes struct pt_regs *sync_regs(struct pt_regs *eregs)
{
struct pt_regs *regs = eregs;
@@ -532,8 +536,10 @@ asmlinkage __kprobes struct pt_regs *sync_regs(struct pt_regs *eregs)
/* Exception from user space */
else if (user_mode(eregs))
regs = task_pt_regs(current);
- /* Exception from kernel and interrupts are enabled. Move to
- kernel process stack. */
+ /*
+ * Exception from kernel and interrupts are enabled. Move to
+ * kernel process stack.
+ */
else if (eregs->flags & X86_EFLAGS_IF)
regs = (struct pt_regs *)(eregs->sp -= sizeof(struct pt_regs));
if (eregs != regs)
@@ -685,12 +691,7 @@ void math_error(void __user *ip)
cwd = get_fpu_cwd(task);
swd = get_fpu_swd(task);
- err = swd & ~cwd & 0x3f;
-
-#ifdef CONFIG_X86_32
- if (!err)
- return;
-#endif
+ err = swd & ~cwd;
if (err & 0x001) { /* Invalid op */
/*
@@ -708,7 +709,11 @@ void math_error(void __user *ip)
} else if (err & 0x020) { /* Precision */
info.si_code = FPE_FLTRES;
} else {
- info.si_code = __SI_FAULT|SI_KERNEL; /* WTF? */
+ /*
+ * If we're using IRQ 13, or supposedly even some trap 16
+ * implementations, it's possible we get a spurious trap...
+ */
+ return; /* Spurious trap, no error */
}
force_sig_info(SIGFPE, &info, task);
}