Discussion:
[9fans] arm breakpoints
(too old to reply)
Richard Miller
2013-01-06 15:02:57 UTC
Permalink
I had a surprise when I tried to debug a user process on the raspberry pi.
The first time it hit a breakpoint, the kernel panicked. Oops.

It turns out than on armv6 (and armv7, I think) the breakpoint instruction
causes a Prefetch Abort exception, instead of Undefined Instruction as on
previous arm architectures.

I've updated the rpi kernel source to deal with this. I wonder if
somebody with plan 9 on an armv7 system (omap or teg2) could check
whether the same panic occurs there too?
David du Colombier
2013-01-06 22:28:17 UTC
Permalink
Post by Richard Miller
I had a surprise when I tried to debug a user process on the
raspberry pi. The first time it hit a breakpoint, the kernel
panicked. Oops.
It turns out than on armv6 (and armv7, I think) the breakpoint
instruction causes a Prefetch Abort exception, instead of Undefined
Instruction as on previous arm architectures.
I've updated the rpi kernel source to deal with this. I wonder if
somebody with plan 9 on an armv7 system (omap or teg2) could check
whether the same panic occurs there too?
I just played a bit with acid on my IGEPv2 (omap) and Trim-Slice (teg2),
and I experienced the same problem with both.

cpu% acid /bin/ls
/bin/ls:arm plan 9 executable
/sys/lib/acid/port
/sys/lib/acid/arm
acid: new()

Then acid hangs forever.

When I interrupt it:

135: SVC/SWI Exception _main MOVW.W R14,#-0x54(R13)
<stdin>:2: (error) msg: pid=135 startstop: interrupted
acid:

Acid on acid:

cpu% acid 209
/proc/209/text:arm plan 9 executable
/sys/lib/acid/port
/sys/lib/acid/arm
acid: stk()
pwrite()+0xc /sys/src/libc/9syscall/pwrite.s:6
write(buf=0x3dd4d,n=0x9)+0x1c /sys/src/libc/9sys/write.c:7
msg(msg=0x3dd4d,pid=0xd2)+0x58 /sys/src/cmd/acid/proc.c:231
startstop(args=0xaf300)+0x78 /sys/src/cmd/acid/builtin.c:238
ocall(res=0x1fffd368,n=0xaf360)+0x88 /sys/src/cmd/acid/expr.c:963
execute(n=0xaf360)+0x30c /sys/src/cmd/acid/exec.c:94
execute(n=0xaf3c0)+0x14c /sys/src/cmd/acid/exec.c:123
call(parameters=0x0,fn=0xae580,local=0x0,retexp=0x1fffe520,body=0xaf3c0)+0x2ac /sys/src/cmd/acid/exec.c:490
ocall(res=0x1fffe520,n=0xb75a0)+0xec /sys/src/cmd/acid/expr.c:970
execute(n=0xb75a0)+0x30c /sys/src/cmd/acid/exec.c:94
execute(n=0xb7600)+0x14c /sys/src/cmd/acid/exec.c:123
execute(n=0xb77e0)+0x140 /sys/src/cmd/acid/exec.c:122
call(parameters=0x0,fn=0xb6e90,local=0x0,retexp=0x1ffff76c,body=0xb77e0)+0x2ac /sys/src/cmd/acid/exec.c:490
ocall(res=0x1ffff76c,n=0xf94a8)+0xec /sys/src/cmd/acid/expr.c:970
execute(n=0xf94a8)+0x30c /sys/src/cmd/acid/exec.c:94
yyparse()+0xefc /sys/src/cmd/acid/dbg.y:55
main(argv=0x1fffffb0,argc=0x1)+0x2ac /sys/src/cmd/acid/main.c:150
_main+0x28 /sys/src/libc/arm/main9.s:19
acid:

On the Trim-Slice, the kernel write the following
message in the console:

trap: cpu1: i-fault va 0x1024 != ifar 0x1020
--
David du Colombier
Richard Miller
2013-01-07 10:43:24 UTC
Permalink
Post by David du Colombier
I just played a bit with acid on my IGEPv2 (omap) and Trim-Slice (teg2),
and I experienced the same problem with both.
Thanks for trying that. In /n/miller/contrib/bkpt.tar there are some
patched omap and teg2 files which I hope will work better. Would you
like to try them before I submit a patch?
David du Colombier
2013-01-07 19:05:09 UTC
Permalink
Post by Richard Miller
Post by David du Colombier
I just played a bit with acid on my IGEPv2 (omap) and Trim-Slice
(teg2), and I experienced the same problem with both.
Thanks for trying that. In /n/miller/contrib/bkpt.tar there are some
patched omap and teg2 files which I hope will work better. Would you
like to try them before I submit a patch?
Your fix solves the problem on both the IGEPv2 and Trim-Slice.
Thank you!
--
David du Colombier
Richard Miller
2013-01-08 11:04:28 UTC
Permalink
Post by David du Colombier
Your fix solves the problem on both the IGEPv2 and Trim-Slice.
Thanks for testing it, I've offered a patch now (armv7-bkpt).

Loading...