Re: [PATCH v4] kprobes: arm: enable OPTPROBES for ARM 32

2014-08-15 Thread Masami Hiramatsu
(2014/08/16 10:38), Wang Nan wrote: > On 2014/8/15 23:23, Masami Hiramatsu wrote: >> (2014/08/12 13:56), Wang Nan wrote: >>> +/* Caller must ensure addr & 3 == 0 */ >>> +static int can_optimize(unsigned long paddr) >>> +{ >>> + return 1; >>> +} >> >> As we have talked on another thread, we'd

Re: [PATCH v4] kprobes: arm: enable OPTPROBES for ARM 32

2014-08-15 Thread Wang Nan
On 2014/8/15 23:23, Masami Hiramatsu wrote: > (2014/08/12 13:56), Wang Nan wrote: >> +/* Caller must ensure addr & 3 == 0 */ >> +static int can_optimize(unsigned long paddr) >> +{ >> +return 1; >> +} > > As we have talked on another thread, we'd better filter-out all stack-pushing >

Re: [PATCH v4] kprobes: arm: enable OPTPROBES for ARM 32

2014-08-15 Thread Masami Hiramatsu
(2014/08/12 13:56), Wang Nan wrote: > +/* Caller must ensure addr & 3 == 0 */ > +static int can_optimize(unsigned long paddr) > +{ > + return 1; > +} As we have talked on another thread, we'd better filter-out all stack-pushing instructions here, since (as you said) that will corrupt pt_regs

Re: [PATCH v4] kprobes: arm: enable OPTPROBES for ARM 32

2014-08-15 Thread Masami Hiramatsu
(2014/08/12 13:56), Wang Nan wrote: +/* Caller must ensure addr 3 == 0 */ +static int can_optimize(unsigned long paddr) +{ + return 1; +} As we have talked on another thread, we'd better filter-out all stack-pushing instructions here, since (as you said) that will corrupt pt_regs on the

Re: [PATCH v4] kprobes: arm: enable OPTPROBES for ARM 32

2014-08-15 Thread Wang Nan
On 2014/8/15 23:23, Masami Hiramatsu wrote: (2014/08/12 13:56), Wang Nan wrote: +/* Caller must ensure addr 3 == 0 */ +static int can_optimize(unsigned long paddr) +{ +return 1; +} As we have talked on another thread, we'd better filter-out all stack-pushing instructions here, since

Re: [PATCH v4] kprobes: arm: enable OPTPROBES for ARM 32

2014-08-15 Thread Masami Hiramatsu
(2014/08/16 10:38), Wang Nan wrote: On 2014/8/15 23:23, Masami Hiramatsu wrote: (2014/08/12 13:56), Wang Nan wrote: +/* Caller must ensure addr 3 == 0 */ +static int can_optimize(unsigned long paddr) +{ + return 1; +} As we have talked on another thread, we'd better filter-out all

Re: [PATCH v4] kprobes: arm: enable OPTPROBES for ARM 32

2014-08-12 Thread Masami Hiramatsu
(2014/08/12 22:03), Wang Nan wrote: > Hi Masami and everyone, > > When checking my code I found a problem: if we replace a stack operatinon > instruction, > it is possible that the emulate execution of such instruction destroy the > stack used > by kprobeopt: > >> + >> +asm ( >> +

Re: [PATCH v4] kprobes: arm: enable OPTPROBES for ARM 32

2014-08-12 Thread Wang Nan
Hi Masami and everyone, When checking my code I found a problem: if we replace a stack operatinon instruction, it is possible that the emulate execution of such instruction destroy the stack used by kprobeopt: > + > +asm ( > + ".global optprobe_template_entry\n" > +

Re: [PATCH v4] kprobes: arm: enable OPTPROBES for ARM 32

2014-08-12 Thread Wang Nan
Hi Masami and everyone, When checking my code I found a problem: if we replace a stack operatinon instruction, it is possible that the emulate execution of such instruction destroy the stack used by kprobeopt: + +asm ( + .global optprobe_template_entry\n +

Re: [PATCH v4] kprobes: arm: enable OPTPROBES for ARM 32

2014-08-12 Thread Masami Hiramatsu
(2014/08/12 22:03), Wang Nan wrote: Hi Masami and everyone, When checking my code I found a problem: if we replace a stack operatinon instruction, it is possible that the emulate execution of such instruction destroy the stack used by kprobeopt: + +asm ( +.global

[PATCH v4] kprobes: arm: enable OPTPROBES for ARM 32

2014-08-11 Thread Wang Nan
This patch introduce kprobeopt for ARM 32. Limitations: - Currently only kernel compiled with ARM ISA is supported. - Offset between probe point and optinsn slot must not larger than 32MiB. Masami Hiramatsu suggests replacing 2 words, it will make things complex. Futher patch can make

[PATCH v4] kprobes: arm: enable OPTPROBES for ARM 32

2014-08-11 Thread Wang Nan
This patch introduce kprobeopt for ARM 32. Limitations: - Currently only kernel compiled with ARM ISA is supported. - Offset between probe point and optinsn slot must not larger than 32MiB. Masami Hiramatsu suggests replacing 2 words, it will make things complex. Futher patch can make