Commit bcaa2a3af6 for openssl.org

commit bcaa2a3af60c3c1f282b621522bbc316341bf692
Author: Holger Dengler <dengler@linux.ibm.com>
Date:   Wed Nov 26 16:18:37 2025 +0100

    s390x: Return condition code of kdsa instruction

    The kdsa instruction is doing some parameter checking for the verify
    function codes, like r/s equals zero and range checks. To handle these
    cases correctly in the calling functions, the asm returns now also
    condition code 2.

    Signed-off-by: Holger Dengler <dengler@linux.ibm.com>

    Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
    Reviewed-by: Tomas Mraz <tomas@openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/29214)

diff --git a/crypto/s390xcpuid.pl b/crypto/s390xcpuid.pl
index a14e577ef6..36457d798a 100755
--- a/crypto/s390xcpuid.pl
+++ b/crypto/s390xcpuid.pl
@@ -461,16 +461,12 @@ $code.=<<___;
 s390x_kdsa:
 	lr	%r0,$fc
 	l${g}r	%r1,$param
-	lhi	%r2,0

 	.long	0xb93a0004	# kdsa %r0,$in
 	brc	1,.-4		# pay attention to "partial completion"
-	brc	7,.Lkdsa_err	# if CC==0 return 0, else return 1
-.Lkdsa_out:
+	ipm	%r2		# load program mask and
+	srl	%r2,28		# extract cc
 	br	$ra
-.Lkdsa_err:
-	lhi	%r2,1
-	j	.Lkdsa_out
 .size	s390x_kdsa,.-s390x_kdsa
 ___
 }