pushq $0
CFI_ADJUST_CFA_OFFSET 8
paranoidentry do_debug
-paranoid_stack_switch:
- testq %rax,%rax
- jz paranoid_exit
/* switch back to process stack to restore the state ptrace touched */
movq %rax,%rsp
jmp paranoid_exit
/* runs on exception stack */
ENTRY(double_fault)
+ CFI_STARTPROC
paranoidentry do_double_fault
- jmp paranoid_stack_switch
+ movq %rax,%rsp
+ jmp paranoid_exit
+ CFI_ENDPROC
ENTRY(invalid_TSS)
errorentry do_invalid_TSS
/* runs on exception stack */
ENTRY(stack_segment)
+ CFI_STARTPROC
paranoidentry do_stack_segment
- jmp paranoid_stack_switch
+ movq %rax,%rsp
+ jmp paranoid_exit
+ CFI_ENDPROC
ENTRY(general_protection)
errorentry do_general_protection
DO_ERROR(18, SIGSEGV, "reserved", reserved)
#define DO_ERROR_STACK(trapnr, signr, str, name) \
-asmlinkage unsigned long do_##name(struct pt_regs * regs, long error_code) \
+asmlinkage void *do_##name(struct pt_regs * regs, long error_code) \
{ \
struct pt_regs *pr = ((struct pt_regs *)(current->thread.rsp0))-1; \
if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) == NOTIFY_BAD) \
- return 0; \
- if (regs->cs & 3) \
+ return regs; \
+ if (regs->cs & 3) { \
memcpy(pr, regs, sizeof(struct pt_regs)); \
+ regs = pr; \
+ } \
do_trap(trapnr, signr, str, regs, error_code, NULL); \
- return (regs->cs & 3) ? (unsigned long)pr : 0; \
+ return regs; \
}
DO_ERROR_STACK(12, SIGBUS, "stack segment", stack_segment)
}
/* runs on IST stack. */
-asmlinkage unsigned long do_debug(struct pt_regs * regs, unsigned long error_code)
+asmlinkage void *do_debug(struct pt_regs * regs, unsigned long error_code)
{
- struct pt_regs *processregs;
+ struct pt_regs *pr;
unsigned long condition;
struct task_struct *tsk = current;
siginfo_t info;
- processregs = (struct pt_regs *)(current->thread.rsp0)-1;
- if (regs->cs & 3)
- memcpy(processregs, regs, sizeof(struct pt_regs));
+ pr = (struct pt_regs *)(current->thread.rsp0)-1;
+ if (regs->cs & 3) {
+ memcpy(pr, regs, sizeof(struct pt_regs));
+ regs = pr;
+ }
#ifdef CONFIG_CHECKING
{
clear_dr7:
asm volatile("movq %0,%%db7"::"r"(0UL));
notify_die(DIE_DEBUG, "debug", regs, condition, 1, SIGTRAP);
-out:
- return (regs->cs & 3) ? (unsigned long)processregs : 0;
+ return regs;
clear_TF_reenable:
printk("clear_tf_reenable\n");
if (notify_die(DIE_DEBUG, "debug2", regs, condition, 1, SIGTRAP)
!= NOTIFY_BAD)
regs->eflags &= ~TF_MASK;
-
- goto out;
+ return regs;
}
/*