Re: SMP+PREEMPT causes NULL dereference in khelper on startup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dave Johnson writes:
> It appears a0 to detach_pid (*task) points to somewhere wrong as
> 'link' (now in a1) is a valid pointer, but points to a bunch of
> zeros.

I found the issue.  This appears to be a compiler bug in
__unhash_process().

SMP (works):
-----------

ffffffff8013c940:       0220f809        jalr    s1
ffffffff8013c944:       0080802d        move    s0,a0
ffffffff8013c948:       24050001        li      a1,1
ffffffff8013c94c:       de020170        ld      v0,368(s0)
ffffffff8013c950:       12020015        beq     s0,v0,ffffffff8013c9a8 <$L10>
ffffffff8013c954:       0200202d        move    a0,s0

[...]

ffffffff8013c9a8 <$L10>:
ffffffff8013c9a8:       0220f809        jalr    s1    <<< detach_pid(p, PIDTYPE_PGID);
ffffffff8013c9ac:       00000000        nop
ffffffff8013c9b0:       0200202d        move    a0,s0
ffffffff8013c9b4:       0220f809        jalr    s1    <<< detach_pid(p, PIDTYPE_SID);
ffffffff8013c9b8:       24050002        li      a1,2


SMP+PREEMPT (fails):
-------------------

ffffffff8013e62c:       0220f809        jalr    s1
ffffffff8013e630:       0080802d        move    s0,a0
ffffffff8013e634:       24050001        li      a1,1
ffffffff8013e638:       de020170        ld      v0,368(s0)
ffffffff8013e63c:       12020016        beq     s0,v0,ffffffff8013e698 <$L10>
ffffffff8013e640:       0200202d        move    a0,s0

[...]
ffffffff8013e698 <$L10>:
ffffffff8013e698:       0220f809        jalr    s1    <<< detach_pid(p, PIDTYPE_PGID);
ffffffff8013e69c:       0200202d        move    a0,s0
ffffffff8013e6a0:       0220f809        jalr    s1    <<< detach_pid(p, PIDTYPE_SID);
ffffffff8013e6a4:       24050002        li      a1,2


The delay slot is missing after the first call causing a0 to not
get set for the second call.



-- 
Dave Johnson
Starent Networks



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux