>>> I'm getting:
>>> crypto/chacha/chacha-s390x.S: Assembler messages:
>>> crypto/chacha/chacha-s390x.S:7: Error: Unrecognized opcode: `clgije'
>>>
>>>
>>> A full build log is available on:
>>> https://buildd.debian.org/status/fetch.php?pkg=openssl&arch=s390x&ver=1.1.0~pre5-1&stamp=1464594754
>>
>> It's overly easy to get carried away if you have access to single
>> system. Double-check attached.
> 
> I made this while I did not notice this earlier:
>   https://github.com/openssl/openssl/pull/1146
> 
> It fixes the chacha thing + memcpy.

Thanks!!! There is couple of problems with suggested modifications
though. First general comment. While 31-bit is arguably not very
fashionable, bugs are still reported at occasions. Important to keep in
mind that 31-bit build still requires z/Arch processor *and* highgprs
kernel feature, i.e. target is not s390 systems (note lack of x), but
64-bit processor running 64-bit OS, just running legacy *process*. Goal
also is to minimize deviations and "parametrize", so that most of the
code is constantly "exposed" to assembler. That's what are those ${g}
things are and that's why #if clauses are limited to clearing most
significant 32 bits of registers. This means that suggestion to
introduce big #if in CRYPTO_memcmp is not considered favourable.
Adhering to non-extension instructions is. Another problem is with
suggested ltgr in chacha-s390x. It has to be "parametrized", i.e. look
as lt${g}r. Because in 31-bit build there is no guarantee that most
significant 32-bit of $len register are actually zero-ed. In other words
could you double-check attached patch instead?


-- 
Ticket here: http://rt.openssl.org/Ticket/Display.html?id=4548
Please log in as guest with password guest if prompted

commit d11ca41a907ce6465e688cbfe548e21c0db94311
Author: Andy Polyakov <ap...@openssl.org>
Date:   Mon May 30 22:16:31 2016 +0200

    s390x assembly pack: improve portability.
    
    Some of the instructions used in latest additions are extension
    ones. There is no real reason to limit ourselves to specific
    processors, so [re-]adhere to base ISA set.

diff --git a/crypto/chacha/asm/chacha-s390x.pl b/crypto/chacha/asm/chacha-s390x.pl
index c7a2692..c315264 100755
--- a/crypto/chacha/asm/chacha-s390x.pl
+++ b/crypto/chacha/asm/chacha-s390x.pl
@@ -147,7 +147,8 @@ $code.=<<___;
 .type	ChaCha20_ctr32,\@function
 .align	32
 ChaCha20_ctr32:
-	cl${g}ije	$len,0,.Lno_data	# $len==0?
+	lt${g}r	$len,$len			# $len==0?
+	bzr	%r14
 	a${g}hi	$len,-64
 	l${g}hi	%r1,-$frame
 	stm${g}	%r6,%r15,`6*$SIZE_T`($sp)
@@ -279,7 +280,6 @@ $code.=<<___;
 	stmg	%r0,%r3,$stdframe+4*12($sp)
 
 	lm${g}	%r6,%r15,`$frame+6*$SIZE_T`($sp)
-.Lno_data:
 	br	%r14
 
 .align	16
diff --git a/crypto/s390xcpuid.S b/crypto/s390xcpuid.S
index df7b35a..a292d10 100644
--- a/crypto/s390xcpuid.S
+++ b/crypto/s390xcpuid.S
@@ -137,9 +137,9 @@ CRYPTO_memcmp:
 	je	.Lno_data
 
 .Loop_cmp:
-	llc	%r0,0(%r2)
+	llgc	%r0,0(%r2)
 	la	%r2,1(%r2)
-	llc	%r1,0(%r3)
+	llgc	%r1,0(%r3)
 	la	%r3,1(%r3)
 	xr	%r1,%r0
 	or	%r5,%r1
-- 
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev

Reply via email to