* [parisc-linux] r3 getting trashed by __wake_up?
@ 2001-07-19 7:51 Grant Grundler
2001-07-19 10:50 ` Alan Modra
0 siblings, 1 reply; 2+ messages in thread
From: Grant Grundler @ 2001-07-19 7:51 UTC (permalink / raw)
To: parisc-linux
Hi parisc asm experts! ;^)
The problem I'm seeing is r3 is zero'd (trashed) by __wake_up()
when called by wake_up_parent(). I'm triggering this consistently
with "pon uunet" - ie fire up a ppp dialup session. The c3k crashes
after the modem returns a "CONNECT" string.
The c3k data page faults with:
Kernel Fault: Code=26 regs=8e6a4740 (Addr=00000098)
IOAQ and GR02 are both wake_up_parent+24
(called from skip_save_ior+164)
"objdump -rD kernel/signal.o" shows:
0000000000000000 <wake_up_parent>:
0: 6b c2 3f d9 stw rp,-14(sp)
4: 6f c4 00 80 stw,ma r4,40(sp)
8: 6b c3 3f 89 stw r3,-3c(sp)
c: 08 1a 02 44 copy r26,r4
10: 08 04 02 43 copy r4,r3
14: 34 19 00 02 ldi 1,r25
18: 34 7a 01 50 ldo a8(r3),r26
1c: e8 00 a0 00 call 24 <wake_up_parent+0x24>
1c: R_PARISC_PCREL22F __wake_up
20: 08 19 02 58 copy r25,r24
24: 48 73 01 30 ldw 98(r3),r19
28: 36 63 3e d1 ldo -98(r19),r3
...
r3 is zero. But it obviously wasn't zero before calling __wake_up.
Now __wake_up save/restore of registers is a bit wierd...
It doesn't look right to me but it's been a long day:
0000000000000000 <__wake_up>:
0: 08 03 02 41 copy r3,r1
4: 6b c2 3f d9 stw rp,-14(sp)
8: 08 1e 02 43 copy sp,r3
c: 6f c1 01 00 stw,ma r1,80(sp)
10: 0c 6d 12 90 stw r13,8(sr0,r3)
...
c8: 0c 70 10 8d ldw 8(sr0,r3),r13
...
f0: 34 7e 00 80 ldo 40(r3),sp
f4: e8 40 d0 00 ret
f8: 4f c3 3f 81 ldw,mb -40(sp),r3
I didn't see any code inbetween that modifies r3.
And from this code it looks like r3 is callee save.
Shouldn't sp be restored with "copy r3,sp"?
And the restore of r3 be "ldw 0(sp),r3"?
Everything on my c3k is up-to-date and vmlinux was built native from scratch:
gcc-3.0 | 1:3.0-1 | unstable | hppa, hurd-i386
gcc-3.0 | 1:3.0-4 | unstable | alpha, arm, i386, mips, mipsel, powerpc, sparc
Perhaps we just need to rebuild/use the newer gcc bits?
Other ideas?
thanks,
grant
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [parisc-linux] r3 getting trashed by __wake_up?
2001-07-19 7:51 [parisc-linux] r3 getting trashed by __wake_up? Grant Grundler
@ 2001-07-19 10:50 ` Alan Modra
0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2001-07-19 10:50 UTC (permalink / raw)
To: Grant Grundler; +Cc: parisc-linux
On Thu, Jul 19, 2001 at 01:51:15AM -0600, Grant Grundler wrote:
>
> f0: 34 7e 00 80 ldo 40(r3),sp
> f4: e8 40 d0 00 ret
> f8: 4f c3 3f 81 ldw,mb -40(sp),r3
>
> Shouldn't sp be restored with "copy r3,sp"?
> And the restore of r3 be "ldw 0(sp),r3"?
No, because then an interrupt might come along and trash 0(sp). All
the assembly you showed looks good to me.
Alan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-07-19 10:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-07-19 7:51 [parisc-linux] r3 getting trashed by __wake_up? Grant Grundler
2001-07-19 10:50 ` Alan Modra
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.