aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/traps.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/traps.c')
-rw-r--r--arch/x86/kernel/traps.c36
1 files changed, 7 insertions, 29 deletions
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 60788dee0f8a..cb838ca42c96 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -575,6 +575,7 @@ dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code)
575 if (regs->flags & X86_VM_MASK) { 575 if (regs->flags & X86_VM_MASK) {
576 handle_vm86_trap((struct kernel_vm86_regs *) regs, 576 handle_vm86_trap((struct kernel_vm86_regs *) regs,
577 error_code, 1); 577 error_code, 1);
578 preempt_conditional_cli(regs);
578 return; 579 return;
579 } 580 }
580 581
@@ -776,21 +777,10 @@ asmlinkage void math_state_restore(void)
776} 777}
777EXPORT_SYMBOL_GPL(math_state_restore); 778EXPORT_SYMBOL_GPL(math_state_restore);
778 779
779#ifndef CONFIG_MATH_EMULATION
780void math_emulate(struct math_emu_info *info)
781{
782 printk(KERN_EMERG
783 "math-emulation not enabled and no coprocessor found.\n");
784 printk(KERN_EMERG "killing %s.\n", current->comm);
785 force_sig(SIGFPE, current);
786 schedule();
787}
788#endif /* CONFIG_MATH_EMULATION */
789
790dotraplinkage void __kprobes 780dotraplinkage void __kprobes
791do_device_not_available(struct pt_regs *regs, long error_code) 781do_device_not_available(struct pt_regs *regs, long error_code)
792{ 782{
793#ifdef CONFIG_X86_32 783#ifdef CONFIG_MATH_EMULATION
794 if (read_cr0() & X86_CR0_EM) { 784 if (read_cr0() & X86_CR0_EM) {
795 struct math_emu_info info = { }; 785 struct math_emu_info info = { };
796 786
@@ -798,12 +788,12 @@ do_device_not_available(struct pt_regs *regs, long error_code)
798 788
799 info.regs = regs; 789 info.regs = regs;
800 math_emulate(&info); 790 math_emulate(&info);
801 } else { 791 return;
802 math_state_restore(); /* interrupts still off */
803 conditional_sti(regs);
804 } 792 }
805#else 793#endif
806 math_state_restore(); 794 math_state_restore(); /* interrupts still off */
795#ifdef CONFIG_X86_32
796 conditional_sti(regs);
807#endif 797#endif
808} 798}
809 799
@@ -881,18 +871,6 @@ void __init trap_init(void)
881#endif 871#endif
882 872
883#ifdef CONFIG_X86_32 873#ifdef CONFIG_X86_32
884 if (cpu_has_fxsr) {
885 printk(KERN_INFO "Enabling fast FPU save and restore... ");
886 set_in_cr4(X86_CR4_OSFXSR);
887 printk("done.\n");
888 }
889 if (cpu_has_xmm) {
890 printk(KERN_INFO
891 "Enabling unmasked SIMD FPU exception support... ");
892 set_in_cr4(X86_CR4_OSXMMEXCPT);
893 printk("done.\n");
894 }
895
896 set_system_trap_gate(SYSCALL_VECTOR, &system_call); 874 set_system_trap_gate(SYSCALL_VECTOR, &system_call);
897 set_bit(SYSCALL_VECTOR, used_vectors); 875 set_bit(SYSCALL_VECTOR, used_vectors);
898#endif 876#endif