diff options
-rw-r--r-- | arch/x86/kernel/traps_64.c | 36 | ||||
-rw-r--r-- | include/asm-x86/traps.h | 6 |
2 files changed, 24 insertions, 18 deletions
diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c index 1cd61ddd90be..b295ebf0cb3f 100644 --- a/arch/x86/kernel/traps_64.c +++ b/arch/x86/kernel/traps_64.c | |||
@@ -452,18 +452,12 @@ static int kernel_math_error(struct pt_regs *regs, const char *str, int trapnr) | |||
452 | * the correct behaviour even in the presence of the asynchronous | 452 | * the correct behaviour even in the presence of the asynchronous |
453 | * IRQ13 behaviour | 453 | * IRQ13 behaviour |
454 | */ | 454 | */ |
455 | asmlinkage void do_coprocessor_error(struct pt_regs *regs) | 455 | void math_error(void __user *ip) |
456 | { | 456 | { |
457 | void __user *ip = (void __user *)(regs->ip); | ||
458 | struct task_struct *task; | 457 | struct task_struct *task; |
459 | siginfo_t info; | 458 | siginfo_t info; |
460 | unsigned short cwd, swd; | 459 | unsigned short cwd, swd; |
461 | 460 | ||
462 | conditional_sti(regs); | ||
463 | if (!user_mode(regs) && | ||
464 | kernel_math_error(regs, "kernel x87 math error", 16)) | ||
465 | return; | ||
466 | |||
467 | /* | 461 | /* |
468 | * Save the info for the exception handler and clear the error. | 462 | * Save the info for the exception handler and clear the error. |
469 | */ | 463 | */ |
@@ -516,23 +510,26 @@ asmlinkage void do_coprocessor_error(struct pt_regs *regs) | |||
516 | force_sig_info(SIGFPE, &info, task); | 510 | force_sig_info(SIGFPE, &info, task); |
517 | } | 511 | } |
518 | 512 | ||
513 | asmlinkage void do_coprocessor_error(struct pt_regs *regs, long error_code) | ||
514 | { | ||
515 | conditional_sti(regs); | ||
516 | if (!user_mode(regs) && | ||
517 | kernel_math_error(regs, "kernel x87 math error", 16)) | ||
518 | return; | ||
519 | math_error((void __user *)regs->ip); | ||
520 | } | ||
521 | |||
519 | asmlinkage void bad_intr(void) | 522 | asmlinkage void bad_intr(void) |
520 | { | 523 | { |
521 | printk("bad interrupt"); | 524 | printk("bad interrupt"); |
522 | } | 525 | } |
523 | 526 | ||
524 | asmlinkage void do_simd_coprocessor_error(struct pt_regs *regs) | 527 | static void simd_math_error(void __user *ip) |
525 | { | 528 | { |
526 | void __user *ip = (void __user *)(regs->ip); | ||
527 | struct task_struct *task; | 529 | struct task_struct *task; |
528 | siginfo_t info; | 530 | siginfo_t info; |
529 | unsigned short mxcsr; | 531 | unsigned short mxcsr; |
530 | 532 | ||
531 | conditional_sti(regs); | ||
532 | if (!user_mode(regs) && | ||
533 | kernel_math_error(regs, "kernel simd math error", 19)) | ||
534 | return; | ||
535 | |||
536 | /* | 533 | /* |
537 | * Save the info for the exception handler and clear the error. | 534 | * Save the info for the exception handler and clear the error. |
538 | */ | 535 | */ |
@@ -575,7 +572,16 @@ asmlinkage void do_simd_coprocessor_error(struct pt_regs *regs) | |||
575 | force_sig_info(SIGFPE, &info, task); | 572 | force_sig_info(SIGFPE, &info, task); |
576 | } | 573 | } |
577 | 574 | ||
578 | asmlinkage void do_spurious_interrupt_bug(struct pt_regs *regs) | 575 | asmlinkage void do_simd_coprocessor_error(struct pt_regs *regs, long error_code) |
576 | { | ||
577 | conditional_sti(regs); | ||
578 | if (!user_mode(regs) && | ||
579 | kernel_math_error(regs, "kernel simd math error", 19)) | ||
580 | return; | ||
581 | simd_math_error((void __user *)regs->ip); | ||
582 | } | ||
583 | |||
584 | asmlinkage void do_spurious_interrupt_bug(struct pt_regs *regs, long error_code) | ||
579 | { | 585 | { |
580 | } | 586 | } |
581 | 587 | ||
diff --git a/include/asm-x86/traps.h b/include/asm-x86/traps.h index 7a692baa51ae..c82c39c7b5ea 100644 --- a/include/asm-x86/traps.h +++ b/include/asm-x86/traps.h | |||
@@ -72,9 +72,9 @@ asmlinkage void double_fault(void); | |||
72 | asmlinkage void do_int3(struct pt_regs *, long); | 72 | asmlinkage void do_int3(struct pt_regs *, long); |
73 | asmlinkage void do_stack_segment(struct pt_regs *, long); | 73 | asmlinkage void do_stack_segment(struct pt_regs *, long); |
74 | asmlinkage void do_debug(struct pt_regs *, unsigned long); | 74 | asmlinkage void do_debug(struct pt_regs *, unsigned long); |
75 | asmlinkage void do_coprocessor_error(struct pt_regs *); | 75 | asmlinkage void do_coprocessor_error(struct pt_regs *, long); |
76 | asmlinkage void do_simd_coprocessor_error(struct pt_regs *); | 76 | asmlinkage void do_simd_coprocessor_error(struct pt_regs *, long); |
77 | asmlinkage void do_spurious_interrupt_bug(struct pt_regs *); | 77 | asmlinkage void do_spurious_interrupt_bug(struct pt_regs *, long); |
78 | 78 | ||
79 | asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code); | 79 | asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code); |
80 | 80 | ||