projects
/
GitHub
/
mt8127
/
android_kernel_alcatel_ttab.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
x86: add hooks for kmemcheck
[GitHub/mt8127/android_kernel_alcatel_ttab.git]
/
arch
/
x86
/
kernel
/
traps.c
diff --git
a/arch/x86/kernel/traps.c
b/arch/x86/kernel/traps.c
index 2310700faca5f2f491f56c7a82aefc378f9b254c..e7a28e6aa4bcc047f2a2dd3b9988a95b3c12986b 100644
(file)
--- a/
arch/x86/kernel/traps.c
+++ b/
arch/x86/kernel/traps.c
@@
-45,6
+45,7
@@
#include <linux/edac.h>
#endif
#include <linux/edac.h>
#endif
+#include <asm/kmemcheck.h>
#include <asm/stacktrace.h>
#include <asm/processor.h>
#include <asm/debugreg.h>
#include <asm/stacktrace.h>
#include <asm/processor.h>
#include <asm/debugreg.h>
@@
-534,6
+535,10
@@
dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code)
get_debugreg(condition, 6);
get_debugreg(condition, 6);
+ /* Catch kmemcheck conditions first of all! */
+ if (condition & DR_STEP && kmemcheck_trap(regs))
+ return;
+
/*
* The processor cleared BTF, so don't mark that we need it set.
*/
/*
* The processor cleared BTF, so don't mark that we need it set.
*/
@@
-839,9
+844,6
@@
asmlinkage void math_state_restore(void)
}
clts(); /* Allow maths ops (or we recurse) */
}
clts(); /* Allow maths ops (or we recurse) */
-#ifdef CONFIG_X86_32
- restore_fpu(tsk);
-#else
/*
* Paranoid restore. send a SIGSEGV if we fail to restore the state.
*/
/*
* Paranoid restore. send a SIGSEGV if we fail to restore the state.
*/
@@
-850,7
+852,7
@@
asmlinkage void math_state_restore(void)
force_sig(SIGSEGV, tsk);
return;
}
force_sig(SIGSEGV, tsk);
return;
}
-#endif
+
thread->status |= TS_USEDFPU; /* So we fnsave on switch_to() */
tsk->fpu_counter++;
}
thread->status |= TS_USEDFPU; /* So we fnsave on switch_to() */
tsk->fpu_counter++;
}
@@
-945,8
+947,13
@@
void __init trap_init(void)
#endif
set_intr_gate(19, &simd_coprocessor_error);
#endif
set_intr_gate(19, &simd_coprocessor_error);
+ /* Reserve all the builtin and the syscall vector: */
+ for (i = 0; i < FIRST_EXTERNAL_VECTOR; i++)
+ set_bit(i, used_vectors);
+
#ifdef CONFIG_IA32_EMULATION
set_system_intr_gate(IA32_SYSCALL_VECTOR, ia32_syscall);
#ifdef CONFIG_IA32_EMULATION
set_system_intr_gate(IA32_SYSCALL_VECTOR, ia32_syscall);
+ set_bit(IA32_SYSCALL_VECTOR, used_vectors);
#endif
#ifdef CONFIG_X86_32
#endif
#ifdef CONFIG_X86_32
@@
-963,14
+970,9
@@
void __init trap_init(void)
}
set_system_trap_gate(SYSCALL_VECTOR, &system_call);
}
set_system_trap_gate(SYSCALL_VECTOR, &system_call);
+ set_bit(SYSCALL_VECTOR, used_vectors);
#endif
#endif
- /* Reserve all the builtin and the syscall vector: */
- for (i = 0; i < FIRST_EXTERNAL_VECTOR; i++)
- set_bit(i, used_vectors);
-
- set_bit(IA32_SYSCALL_VECTOR, used_vectors);
-
/*
* Should be a barrier for any external CPU state:
*/
/*
* Should be a barrier for any external CPU state:
*/