>> The first problem was the usage of r13. On Page 3 of the PowerPC EABI
>>  spec [1], the r13 register is described as a dedicated register. So 
>> the usage of such a register is delicate.
> 
> Other ABI specs are not as categorical about r2 and r13. I was told by
> IBM that r2 is used as TLS pointer in 32-bit OSes and r13 in 64-bit
> ones. As signal handler is allowed to reference TLS pointer, these
> registers were left alone. Referred specification says that *both* r2
> and r13 can be dereferenced in signal/exception handler...
> 
>> I could not use it because it is forbidden in our startup code. But
>> at Line 101 of "crypto/aes/asm/aes-ppc.pl" I found a workaround for
>> the 64 bit case, which replaces r13 with r0.
>>
>> # stay away from TLS pointer
>> if ($SIZE_T==8)      { die if ($t1 ne "r13");  $t1="r0";             }
>> else         { die if ($Tbl3 ne "r2"); $Tbl3=$t0; $t0="r0";  }
>>
>> So in the aes-ppc Perl source I replaced r13 with r0 at line 77,
>> which made the line 538
>>      lwz     $t1,4($key)
>> execute smoothly.
> 
> Presumably this is circumstantial. In sense that it worked solely
> because exceptions didn't happed to dereference r2 at times subroutine
> in question was executing. In other words, replacing r13 with r0 is not
> sufficient, and the only right thing to do is to leave alone *both* r2
> and r13. One can off-load $out to stack and use r4 instead of r13.

http://cvs.openssl.org/chngview?cn=22015. It addresses similar issue
even sha512-ppc.pl module.

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to