x86: use fixup_exception() in traps_64.c
Use the fixup_exception() helper instead of the open-coded search_extable() users. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
parent
318aa296c3
commit
b3a5acc17c
1 changed files with 15 additions and 32 deletions
|
@ -601,20 +601,13 @@ static void __kprobes do_trap(int trapnr, int signr, char *str,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* kernel trap */
|
if (!fixup_exception(regs)) {
|
||||||
{
|
|
||||||
const struct exception_table_entry *fixup;
|
|
||||||
fixup = search_exception_tables(regs->ip);
|
|
||||||
if (fixup)
|
|
||||||
regs->ip = fixup->fixup;
|
|
||||||
else {
|
|
||||||
tsk->thread.error_code = error_code;
|
tsk->thread.error_code = error_code;
|
||||||
tsk->thread.trap_no = trapnr;
|
tsk->thread.trap_no = trapnr;
|
||||||
die(str, regs, error_code);
|
die(str, regs, error_code);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#define DO_ERROR(trapnr, signr, str, name) \
|
#define DO_ERROR(trapnr, signr, str, name) \
|
||||||
asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
|
asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
|
||||||
|
@ -703,14 +696,8 @@ asmlinkage void __kprobes do_general_protection(struct pt_regs * regs,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* kernel gp */
|
if (fixup_exception(regs))
|
||||||
{
|
|
||||||
const struct exception_table_entry *fixup;
|
|
||||||
fixup = search_exception_tables(regs->ip);
|
|
||||||
if (fixup) {
|
|
||||||
regs->ip = fixup->fixup;
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
tsk->thread.error_code = error_code;
|
tsk->thread.error_code = error_code;
|
||||||
tsk->thread.trap_no = 13;
|
tsk->thread.trap_no = 13;
|
||||||
|
@ -719,7 +706,6 @@ asmlinkage void __kprobes do_general_protection(struct pt_regs * regs,
|
||||||
return;
|
return;
|
||||||
die("general protection fault", regs, error_code);
|
die("general protection fault", regs, error_code);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static __kprobes void
|
static __kprobes void
|
||||||
mem_parity_error(unsigned char reason, struct pt_regs * regs)
|
mem_parity_error(unsigned char reason, struct pt_regs * regs)
|
||||||
|
@ -910,12 +896,9 @@ clear_TF_reenable:
|
||||||
|
|
||||||
static int kernel_math_error(struct pt_regs *regs, const char *str, int trapnr)
|
static int kernel_math_error(struct pt_regs *regs, const char *str, int trapnr)
|
||||||
{
|
{
|
||||||
const struct exception_table_entry *fixup;
|
if (fixup_exception(regs))
|
||||||
fixup = search_exception_tables(regs->ip);
|
|
||||||
if (fixup) {
|
|
||||||
regs->ip = fixup->fixup;
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
|
||||||
notify_die(DIE_GPF, str, regs, 0, trapnr, SIGFPE);
|
notify_die(DIE_GPF, str, regs, 0, trapnr, SIGFPE);
|
||||||
/* Illegal floating point operation in the kernel */
|
/* Illegal floating point operation in the kernel */
|
||||||
current->thread.trap_no = trapnr;
|
current->thread.trap_no = trapnr;
|
||||||
|
|
Loading…
Add table
Reference in a new issue