[parisc-linux] Re: schedule_tail

Alan Modra alan@linuxcare.com.au
Fri, 23 Feb 2001 01:28:36 +1100 (EST)


On Thu, 22 Feb 2001, Alan Modra wrote:

> First time in do_fork, I see
>  p = 0x14ff0000, current = 0x102cc000 (= init_task)
> 
> first call to ret_from_kernel_thread gives
>  r26 = 0x102cc000, r30 = 0x14ff0500, and called func = init
> 
> so that checks out OK.  Disassmbling schedule_tail doesn't show anything
> bad.
> 
>  copy r3,r1
>  copy sp,r3
>  stw,ma r1,0x40(sp)
>  ldw 0x28(r26),r19
>  depwi 0,27,1,r19
>  stw r19,0x28(r26)
>  ldo 0x40(r3),sp
>  bv (rp)
>  ldw,mb -0x40(sp),r3

This is really crazy (or I am).  I replaced the calls to schedule_tail
with a call to foo_schedule_tail, a local copy of the above without the
bit twiddling.  Still crashed.  OK, so maybe the stack is messed up.
Turn foo_schedule_tail into

foo_schedule_tail:
  bv (%rp)
  nop

It crashes!!  Remove the calls, and it's OK.  What????