diff options
Diffstat (limited to 'arch/x86/kernel/traps.c')
-rw-r--r-- | arch/x86/kernel/traps.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index a1d288327ff0..5204332f475d 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c | |||
@@ -45,6 +45,7 @@ | |||
45 | #include <linux/edac.h> | 45 | #include <linux/edac.h> |
46 | #endif | 46 | #endif |
47 | 47 | ||
48 | #include <asm/kmemcheck.h> | ||
48 | #include <asm/stacktrace.h> | 49 | #include <asm/stacktrace.h> |
49 | #include <asm/processor.h> | 50 | #include <asm/processor.h> |
50 | #include <asm/debugreg.h> | 51 | #include <asm/debugreg.h> |
@@ -53,6 +54,7 @@ | |||
53 | #include <asm/traps.h> | 54 | #include <asm/traps.h> |
54 | #include <asm/desc.h> | 55 | #include <asm/desc.h> |
55 | #include <asm/i387.h> | 56 | #include <asm/i387.h> |
57 | #include <asm/mce.h> | ||
56 | 58 | ||
57 | #include <asm/mach_traps.h> | 59 | #include <asm/mach_traps.h> |
58 | 60 | ||
@@ -64,8 +66,6 @@ | |||
64 | #include <asm/setup.h> | 66 | #include <asm/setup.h> |
65 | #include <asm/traps.h> | 67 | #include <asm/traps.h> |
66 | 68 | ||
67 | #include "cpu/mcheck/mce.h" | ||
68 | |||
69 | asmlinkage int system_call(void); | 69 | asmlinkage int system_call(void); |
70 | 70 | ||
71 | /* Do we ignore FPU interrupts ? */ | 71 | /* Do we ignore FPU interrupts ? */ |
@@ -346,6 +346,9 @@ io_check_error(unsigned char reason, struct pt_regs *regs) | |||
346 | printk(KERN_EMERG "NMI: IOCK error (debug interrupt?)\n"); | 346 | printk(KERN_EMERG "NMI: IOCK error (debug interrupt?)\n"); |
347 | show_registers(regs); | 347 | show_registers(regs); |
348 | 348 | ||
349 | if (panic_on_io_nmi) | ||
350 | panic("NMI IOCK error: Not continuing"); | ||
351 | |||
349 | /* Re-enable the IOCK line, wait for a few seconds */ | 352 | /* Re-enable the IOCK line, wait for a few seconds */ |
350 | reason = (reason & 0xf) | 8; | 353 | reason = (reason & 0xf) | 8; |
351 | outb(reason, 0x61); | 354 | outb(reason, 0x61); |
@@ -534,6 +537,10 @@ dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code) | |||
534 | 537 | ||
535 | get_debugreg(condition, 6); | 538 | get_debugreg(condition, 6); |
536 | 539 | ||
540 | /* Catch kmemcheck conditions first of all! */ | ||
541 | if (condition & DR_STEP && kmemcheck_trap(regs)) | ||
542 | return; | ||
543 | |||
537 | /* | 544 | /* |
538 | * The processor cleared BTF, so don't mark that we need it set. | 545 | * The processor cleared BTF, so don't mark that we need it set. |
539 | */ | 546 | */ |
@@ -798,15 +805,15 @@ unsigned long patch_espfix_desc(unsigned long uesp, unsigned long kesp) | |||
798 | 805 | ||
799 | return new_kesp; | 806 | return new_kesp; |
800 | } | 807 | } |
801 | #else | 808 | #endif |
809 | |||
802 | asmlinkage void __attribute__((weak)) smp_thermal_interrupt(void) | 810 | asmlinkage void __attribute__((weak)) smp_thermal_interrupt(void) |
803 | { | 811 | { |
804 | } | 812 | } |
805 | 813 | ||
806 | asmlinkage void __attribute__((weak)) mce_threshold_interrupt(void) | 814 | asmlinkage void __attribute__((weak)) smp_threshold_interrupt(void) |
807 | { | 815 | { |
808 | } | 816 | } |
809 | #endif | ||
810 | 817 | ||
811 | /* | 818 | /* |
812 | * 'math_state_restore()' saves the current math information in the | 819 | * 'math_state_restore()' saves the current math information in the |
@@ -839,9 +846,6 @@ asmlinkage void math_state_restore(void) | |||
839 | } | 846 | } |
840 | 847 | ||
841 | clts(); /* Allow maths ops (or we recurse) */ | 848 | clts(); /* Allow maths ops (or we recurse) */ |
842 | #ifdef CONFIG_X86_32 | ||
843 | restore_fpu(tsk); | ||
844 | #else | ||
845 | /* | 849 | /* |
846 | * Paranoid restore. send a SIGSEGV if we fail to restore the state. | 850 | * Paranoid restore. send a SIGSEGV if we fail to restore the state. |
847 | */ | 851 | */ |
@@ -850,7 +854,7 @@ asmlinkage void math_state_restore(void) | |||
850 | force_sig(SIGSEGV, tsk); | 854 | force_sig(SIGSEGV, tsk); |
851 | return; | 855 | return; |
852 | } | 856 | } |
853 | #endif | 857 | |
854 | thread->status |= TS_USEDFPU; /* So we fnsave on switch_to() */ | 858 | thread->status |= TS_USEDFPU; /* So we fnsave on switch_to() */ |
855 | tsk->fpu_counter++; | 859 | tsk->fpu_counter++; |
856 | } | 860 | } |
@@ -945,8 +949,13 @@ void __init trap_init(void) | |||
945 | #endif | 949 | #endif |
946 | set_intr_gate(19, &simd_coprocessor_error); | 950 | set_intr_gate(19, &simd_coprocessor_error); |
947 | 951 | ||
952 | /* Reserve all the builtin and the syscall vector: */ | ||
953 | for (i = 0; i < FIRST_EXTERNAL_VECTOR; i++) | ||
954 | set_bit(i, used_vectors); | ||
955 | |||
948 | #ifdef CONFIG_IA32_EMULATION | 956 | #ifdef CONFIG_IA32_EMULATION |
949 | set_system_intr_gate(IA32_SYSCALL_VECTOR, ia32_syscall); | 957 | set_system_intr_gate(IA32_SYSCALL_VECTOR, ia32_syscall); |
958 | set_bit(IA32_SYSCALL_VECTOR, used_vectors); | ||
950 | #endif | 959 | #endif |
951 | 960 | ||
952 | #ifdef CONFIG_X86_32 | 961 | #ifdef CONFIG_X86_32 |
@@ -963,17 +972,9 @@ void __init trap_init(void) | |||
963 | } | 972 | } |
964 | 973 | ||
965 | set_system_trap_gate(SYSCALL_VECTOR, &system_call); | 974 | set_system_trap_gate(SYSCALL_VECTOR, &system_call); |
966 | #endif | ||
967 | |||
968 | /* Reserve all the builtin and the syscall vector: */ | ||
969 | for (i = 0; i < FIRST_EXTERNAL_VECTOR; i++) | ||
970 | set_bit(i, used_vectors); | ||
971 | |||
972 | #ifdef CONFIG_X86_64 | ||
973 | set_bit(IA32_SYSCALL_VECTOR, used_vectors); | ||
974 | #else | ||
975 | set_bit(SYSCALL_VECTOR, used_vectors); | 975 | set_bit(SYSCALL_VECTOR, used_vectors); |
976 | #endif | 976 | #endif |
977 | |||
977 | /* | 978 | /* |
978 | * Should be a barrier for any external CPU state: | 979 | * Should be a barrier for any external CPU state: |
979 | */ | 980 | */ |