···67 return (*((unsigned long *)stack));68}6970-static inline struct pt_regs *get_child_regs(struct task_struct *task)71-{72- struct pt_regs *regs = (void *)task->thread.rsp0;73- return regs - 1;74-}75-76/*77 * this routine will put a word on the processes privileged stack. 78 * the offset is how far from the base addr as stored in the TSS. ···164165static void set_singlestep(struct task_struct *child)166{167- struct pt_regs *regs = get_child_regs(child);168169 /*170 * Always set TIF_SINGLESTEP - this guarantees that···202203 /* But touch TF only if it was set by us.. */204 if (child->ptrace & PT_DTRACE) {205- struct pt_regs *regs = get_child_regs(child);206 regs->eflags &= ~TRAP_FLAG;207 child->ptrace &= ~PT_DTRACE;208 }
···67 return (*((unsigned long *)stack));68}6900000070/*71 * this routine will put a word on the processes privileged stack. 72 * the offset is how far from the base addr as stored in the TSS. ···170171static void set_singlestep(struct task_struct *child)172{173+ struct pt_regs *regs = task_pt_regs(child);174175 /*176 * Always set TIF_SINGLESTEP - this guarantees that···208209 /* But touch TF only if it was set by us.. */210 if (child->ptrace & PT_DTRACE) {211+ struct pt_regs *regs = task_pt_regs(child);212 regs->eflags &= ~TRAP_FLAG;213 child->ptrace &= ~PT_DTRACE;214 }
+1-1
arch/x86_64/kernel/traps.c
···666 ;667 /* Exception from user space */668 else if (user_mode(eregs))669- regs = ((struct pt_regs *)current->thread.rsp0) - 1;670 /* Exception from kernel and interrupts are enabled. Move to671 kernel process stack. */672 else if (eregs->eflags & X86_EFLAGS_IF)
···666 ;667 /* Exception from user space */668 else if (user_mode(eregs))669+ regs = task_pt_regs(current);670 /* Exception from kernel and interrupts are enabled. Move to671 kernel process stack. */672 else if (eregs->eflags & X86_EFLAGS_IF)