Re: [PATCH v2] MIPS: Add basic R5900 support

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

 



Hi Maciej,

>  Anyway, as noted above that shouldn't cause a problem with user software 
> and I think that any corruption you can see comes from elsewhere.  You'll 
> have to paper this $ra non-sign-extension issue over somehow to proceed 
> though.

I've extended do_IRQ with a register check under the condition that
user_mode(get_irq_regs()) is true, with the following sample results
where registers $2-$25 are printed if they are not sign-extended
properly (there is a certain amount of randomness to this):

    $10 : 00005f6362696c5f
    epc = 0fb6db00 in ld.so.1[fb60000+19000]

     $8 : ffffff7272655f5f
     $9 : ffffff7272655f5f
    $10 : 7066732e6362696c
    epc = 0fb759a0 in ld.so.1[fb60000+19000]

    $10 : 7274735f65646f6d
    $12 : ffff000000000000
    $13 : 0000ffffffffffff
    $14 : 000000ffffffffff
    epc = 0fb6d03c in ld.so.1[fb60000+19000]

    $10 : ffff732e6362696c
    epc = 0fb6cfe8 in ld.so.1[fb60000+19000]

     $8 : 000000ff00000000
    epc = 77e29fe4 in libc.so.6[77dc0000+12e000]

     $9 : 7fb71f357fb71f40
    epc = 0041cc60 in busybox[400000+3d000]

    $10 : 0000ffffff6f6c63
    epc = 0fb6d060 in ld.so.1[fb60000+19000]

    $10 : 00ffffffff657365
    epc = 0fb6d03c in ld.so.1[fb60000+19000]

    $12 : ffff000000000000
    $13 : 0000ffffffffffff
    epc = 0fb6d03c in ld.so.1[fb60000+19000]

     $8 : 4700302e325f4342
     $9 : 4700302e325f4342
    $10 : 0000ff6e6769735f
    $14 : 00ff000000000000
    epc = 0fb75a6c in ld.so.1[fb60000+19000]

    $10 : 635f6362696c5f5f
    $12 : ffff000000000000
    $13 : 0000ffffffffffff
    epc = 0fb6d608 in ld.so.1[fb60000+19000]

I'm not yet sure this approach is completely correct, because there are
quite a few macros and other things to set this up, and I'm assuming all
these registers are saved for IRQs by SAVE_ALL. The regs variable is
64-bits unsigned long long and save/restore is SD/LD in relevant places.

It would be interesting to somehow single-step through BusyBox and for
every hardware instruction validate registers to find the first occurrence
where sign-extension breaks.

What about making the R5900 a 64-bit kernel only if it would turn out that
the 32-bit sign-extension logic is not completely reliable?

Fredrik


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

  Powered by Linux