]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
s390x: Return condition code of kdsa instruction
authorHolger Dengler <dengler@linux.ibm.com>
Wed, 26 Nov 2025 15:18:37 +0000 (16:18 +0100)
committerTomas Mraz <tomas@openssl.org>
Wed, 3 Dec 2025 13:32:07 +0000 (14:32 +0100)
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)

crypto/s390xcpuid.pl

index a14e577ef6c40ba24aa21b9e7fdeafa8c514a20c..36457d798a1648b59b57a49b20081f95f10c4630 100755 (executable)
@@ -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
 ___
 }