Re: [BUG?]3.0-rc4+ftrace+kprobe: set kprobe at instruction 'stwu' lead to system crash/freeze

2011-12-01 Thread Benjamin Herrenschmidt
On Thu, 2011-12-01 at 18:44 +0800, tiejun.chen wrote: > Do you mean we should push the original pt_regs (or that whole exception > stack) > downwards the location the new r1 point? Then its safe to perform this real > emulated stw instruction. At last we will reroute r1 to that copied exception >

Re: [BUG?]3.0-rc4+ftrace+kprobe: set kprobe at instruction 'stwu' lead to system crash/freeze

2011-12-01 Thread tiejun.chen
Benjamin Herrenschmidt wrote: > On Wed, 2011-11-30 at 19:06 +0800, tiejun.chen wrote: > >>> - Copy the exception frame we're about to unwind to just -below- the >>> new r1 value we want to write to. Then perform the write, and change >>> r1 to point to that copy of the frame. >>> >>> - Branch to

Re: [BUG?]3.0-rc4+ftrace+kprobe: set kprobe at instruction 'stwu' lead to system crash/freeze

2011-11-30 Thread Benjamin Herrenschmidt
On Wed, 2011-11-30 at 19:06 +0800, tiejun.chen wrote: > > - Copy the exception frame we're about to unwind to just -below- the > > new r1 value we want to write to. Then perform the write, and change > > r1 to point to that copy of the frame. > > > > - Branch to restore: which will unwind every

Re: [BUG?]3.0-rc4+ftrace+kprobe: set kprobe at instruction 'stwu' lead to system crash/freeze

2011-11-30 Thread tiejun.chen
Benjamin Herrenschmidt wrote: > On Fri, 2011-07-01 at 18:03 +0800, tiejun.chen wrote: >> Here emulate_step() is called to emulate 'stwu'. Actually this is equivalent >> to >> 1> update pr_regs->gpr[1] = mem(old r1 + (-A)) >> 2> 'stw , mem<(old r1 + (-A)) > >> >> You should notice the stack based o

Re: [BUG?]3.0-rc4+ftrace+kprobe: set kprobe at instruction 'stwu' lead to system crash/freeze

2011-11-29 Thread Benjamin Herrenschmidt
On Fri, 2011-07-01 at 18:03 +0800, tiejun.chen wrote: > > Here emulate_step() is called to emulate 'stwu'. Actually this is equivalent > to > 1> update pr_regs->gpr[1] = mem(old r1 + (-A)) > 2> 'stw , mem<(old r1 + (-A)) > > > You should notice the stack based on new r1 would be covered with mem

Re: [BUG?]3.0-rc4+ftrace+kprobe: set kprobe at instruction 'stwu' lead to system crash/freeze

2011-07-03 Thread Yong Zhang
On Fri, Jul 1, 2011 at 6:03 PM, tiejun.chen wrote: >> root@unknown:/root> insmod kprobe_example.ko func=show_interrupts >> Planted kprobe at c009be18 >> root@unknown:/root> cat /proc/interrupts >> pre_handler: p->addr = 0xc009be18, nip = 0xc009be18, msr = 0x29000 >> post_handler: p->addr = 0xc009b

Re: [BUG?]3.0-rc4+ftrace+kprobe: set kprobe at instruction 'stwu' lead to system crash/freeze

2011-07-01 Thread tiejun.chen
Yong Zhang wrote: > On Mon, Jun 27, 2011 at 6:01 PM, Ananth N Mavinakayanahalli > wrote: >> On Sun, Jun 26, 2011 at 11:47:13PM +0900, Masami Hiramatsu wrote: >>> (2011/06/24 19:29), Steven Rostedt wrote: On Fri, 2011-06-24 at 17:21 +0800, Yong Zhang wrote: > Hi, > > When I use kpr

Re: [BUG?]3.0-rc4+ftrace+kprobe: set kprobe at instruction 'stwu' lead to system crash/freeze

2011-06-30 Thread Yong Zhang
On Wed, Jun 29, 2011 at 2:46 PM, Ananth N Mavinakayanahalli wrote: > > Certain functions are off limits for probing -- look for __kprobe Yup. > annotations in the kernel. Some such functions are arch specific, but > show_interrupts() would definitely not be one of them. It works fine on > my (64

Re: [BUG?]3.0-rc4+ftrace+kprobe: set kprobe at instruction 'stwu' lead to system crash/freeze

2011-06-28 Thread Ananth N Mavinakayanahalli
On Wed, Jun 29, 2011 at 02:23:28PM +0800, Yong Zhang wrote: > On Mon, Jun 27, 2011 at 6:01 PM, Ananth N Mavinakayanahalli > wrote: > > On Sun, Jun 26, 2011 at 11:47:13PM +0900, Masami Hiramatsu wrote: > >> (2011/06/24 19:29), Steven Rostedt wrote: > >> > On Fri, 2011-06-24 at 17:21 +0800, Yong Zha

Re: [BUG?]3.0-rc4+ftrace+kprobe: set kprobe at instruction 'stwu' lead to system crash/freeze

2011-06-28 Thread Yong Zhang
On Tue, Jun 28, 2011 at 6:41 PM, Ananth N Mavinakayanahalli wrote: > > My access to a 32bit powerpc box is very limited. Also, embedded powerpc > has had issues with gcc-4.6 while gcc-4.5 worked fine. I think I can do some test if you have any ideas :) > >> > > I'm not sure if x86 had a similar

Re: [BUG?]3.0-rc4+ftrace+kprobe: set kprobe at instruction 'stwu' lead to system crash/freeze

2011-06-28 Thread Yong Zhang
On Mon, Jun 27, 2011 at 6:01 PM, Ananth N Mavinakayanahalli wrote: > On Sun, Jun 26, 2011 at 11:47:13PM +0900, Masami Hiramatsu wrote: >> (2011/06/24 19:29), Steven Rostedt wrote: >> > On Fri, 2011-06-24 at 17:21 +0800, Yong Zhang wrote: >> >> Hi, >> >> >> >> When I use kprobe to do something, I f

Re: [BUG?]3.0-rc4+ftrace+kprobe: set kprobe at instruction 'stwu' lead to system crash/freeze

2011-06-28 Thread Steven Rostedt
On Tue, 2011-06-28 at 16:11 +0530, Ananth N Mavinakayanahalli wrote: > My access to a 32bit powerpc box is very limited. Also, embedded powerpc > has had issues with gcc-4.6 while gcc-4.5 worked fine. I'd work to debug this too, but I don't have access to a 32bit ppc either. Although I've been to

Re: [BUG?]3.0-rc4+ftrace+kprobe: set kprobe at instruction 'stwu' lead to system crash/freeze

2011-06-28 Thread Ananth N Mavinakayanahalli
On Mon, Jun 27, 2011 at 03:31:05PM +0530, Ananth N Mavinakayanahalli wrote: > On Sun, Jun 26, 2011 at 11:47:13PM +0900, Masami Hiramatsu wrote: > > (2011/06/24 19:29), Steven Rostedt wrote: > > > On Fri, 2011-06-24 at 17:21 +0800, Yong Zhang wrote: > > >> Hi, > > >> > > >> When I use kprobe to do s

Re: [BUG?]3.0-rc4+ftrace+kprobe: set kprobe at instruction 'stwu' lead to system crash/freeze

2011-06-27 Thread Ananth N Mavinakayanahalli
On Sun, Jun 26, 2011 at 11:47:13PM +0900, Masami Hiramatsu wrote: > (2011/06/24 19:29), Steven Rostedt wrote: > > On Fri, 2011-06-24 at 17:21 +0800, Yong Zhang wrote: > >> Hi, > >> > >> When I use kprobe to do something, I found some wired thing. > >> > >> When CONFIG_FUNCTION_TRACER is disabled: >

Re: [BUG?]3.0-rc4+ftrace+kprobe: set kprobe at instruction 'stwu' lead to system crash/freeze

2011-06-26 Thread Masami Hiramatsu
(2011/06/24 19:29), Steven Rostedt wrote: > On Fri, 2011-06-24 at 17:21 +0800, Yong Zhang wrote: >> Hi, >> >> When I use kprobe to do something, I found some wired thing. >> >> When CONFIG_FUNCTION_TRACER is disabled: >> (gdb) disassemble do_fork >> Dump of assembler code for function do_fork: >>

Re: [BUG?]3.0-rc4+ftrace+kprobe: set kprobe at instruction 'stwu' lead to system crash/freeze

2011-06-24 Thread Steven Rostedt
On Fri, 2011-06-24 at 17:21 +0800, Yong Zhang wrote: > Hi, > > When I use kprobe to do something, I found some wired thing. > > When CONFIG_FUNCTION_TRACER is disabled: > (gdb) disassemble do_fork > Dump of assembler code for function do_fork: >0xc0037390 <+0>: mflrr0 >0xc0037394 <+