[PATCH 3/4] ppc32/kprobe: complete kprobe and migrate exception frame

2011-12-12 Thread Tiejun Chen
We can't emulate stwu since that may corrupt current exception stack. So we will have to do real store operation in the exception return code. Firstly we'll allocate a trampoline exception frame below the kprobed function stack and copy the current exception frame to the trampoline. Then we can do

Re: [PATCH 3/4] ppc32/kprobe: complete kprobe and migrate exception frame

2011-12-12 Thread Benjamin Herrenschmidt
On Mon, 2011-12-12 at 16:50 +0800, Tiejun Chen wrote: > We can't emulate stwu since that may corrupt current exception stack. > So we will have to do real store operation in the exception return code. > > Firstly we'll allocate a trampoline exception frame below the kprobed > function stack and co

Re: [PATCH 3/4] ppc32/kprobe: complete kprobe and migrate exception frame

2011-12-12 Thread tiejun.chen
Benjamin Herrenschmidt wrote: > On Mon, 2011-12-12 at 16:50 +0800, Tiejun Chen wrote: >> We can't emulate stwu since that may corrupt current exception stack. >> So we will have to do real store operation in the exception return code. >> >> Firstly we'll allocate a trampoline exception frame below

Re: [PATCH 3/4] ppc32/kprobe: complete kprobe and migrate exception frame

2011-12-13 Thread tiejun.chen
>> >> You need to hook into "resume_kernel" instead. > > Maybe I'm misunderstanding what you mean since as I recall you suggestion we > should do this at the end of do_work. > I regenerate this with hooking into resume_kernel in below. >> Also, we may want to simplify the whole thing, instead of

Re: [PATCH 3/4] ppc32/kprobe: complete kprobe and migrate exception frame

2011-12-13 Thread tiejun.chen
Sorry please ignore this email since I'm missing something here :( Tiejun tiejun.chen wrote: >>> You need to hook into "resume_kernel" instead. >> Maybe I'm misunderstanding what you mean since as I recall you suggestion we >> should do this at the end of do_work. >> > > I regenerate this with h

Re: [PATCH 3/4] ppc32/kprobe: complete kprobe and migrate exception frame

2011-12-13 Thread tiejun.chen
>> You need to hook into "resume_kernel" instead. > I regenerate this with hooking into resume_kernel in below. > Maybe I'm misunderstanding what you mean since as I recall you suggestion we > should do this at the end of do_work. > >> Also, we may want to simplify the whole thing, instead of ch

Re: [PATCH 3/4] ppc32/kprobe: complete kprobe and migrate exception frame

2011-12-14 Thread Benjamin Herrenschmidt
On Tue, 2011-12-13 at 18:36 +0800, tiejun.chen wrote: > >> You need to hook into "resume_kernel" instead. > > > > I regenerate this with hooking into resume_kernel in below. .../... > I assume it may not necessary to reorganize ret_from_except for *ppc32* . It might be cleaner but I can do tha

Re: [PATCH 3/4] ppc32/kprobe: complete kprobe and migrate exception frame

2011-12-15 Thread tiejun.chen
Looks we have to go into 'restore' at last as I said previously. I send v2 based on your all comments. >> I assume it may not necessary to reorganize ret_from_except for *ppc32* . > > It might be cleaner but I can do that myself later. > I have this version but I'm not 100% sure if its as you e