Messages in this thread | | | Subject | Re: [PATCH] x86, 32-bit: Fix invalid stack address while in softirq | From | Steven Rostedt <> | Date | Thu, 06 Sep 2012 11:54:47 -0400 |
| |
On Thu, 2012-09-06 at 17:36 +0200, Robert Richter wrote:
> I meant: > > unsigned long kernel_stack_pointer(struct pt_regs *regs) > { > unsigned long context = (unsigned long)regs & ~(THREAD_SIZE - 1); > unsigned long sp = (unsigned long)®s->sp; > struct thread_info *tinfo; > > if (context == (sp & ~(THREAD_SIZE - 1))) > return sp; > > tinfo = (struct thread_info *)context; > if (tinfo->previous_esp) > return tinfo->previous_esp; > > return (unsigned long)regs; > } > > -Robert > > > > > Maybe this is even better. > > > >
Yeah, this is probably the safest.
Thanks,
-- Steve
| |