]> Git Repo - J-linux.git/commitdiff
s390/vdso: Use one large alternative instead of an alternative branch
authorHeiko Carstens <[email protected]>
Thu, 19 Sep 2024 12:40:10 +0000 (14:40 +0200)
committerVasily Gorbik <[email protected]>
Mon, 23 Sep 2024 15:57:04 +0000 (17:57 +0200)
Replace the alternative branch with a larger alternative that contains
both paths. That way the two paths are closer together and it is easier
to change both paths if the need should arise.

Signed-off-by: Heiko Carstens <[email protected]>
Reviewed-by: Jens Remus <[email protected]>
Signed-off-by: Vasily Gorbik <[email protected]>
arch/s390/kernel/vdso64/vgetrandom-chacha.S

index 4c52ba78e060f34d160b8ea7943f20daea029f2e..09c034c2f853127292abd75db0c616879f78997e 100644 (file)
@@ -130,16 +130,22 @@ SYM_FUNC_START(__arch_chacha20_blocks_nostack)
        /* OUTPUT3 = STATE3 + COPY3 */
        VAF     STATE3,STATE3,COPY3
 
-       /*
-        * 32 bit wise little endian store to OUTPUT. If the vector
-        * enhancement facility 2 is not installed use the slow path.
-        */
-       ALTERNATIVE "brc 0xf,.Lstoreslow", "nop", ALT_FACILITY(148)
-       VSTBRF  STATE0,0,,%r2
-       VSTBRF  STATE1,16,,%r2
-       VSTBRF  STATE2,32,,%r2
-       VSTBRF  STATE3,48,,%r2
-.Lstoredone:
+       ALTERNATIVE                                                     \
+               __stringify(                                            \
+               /* Convert STATE to little endian and store to OUTPUT */\
+               VPERM   TMP0,STATE0,STATE0,BEPERM;                      \
+               VPERM   TMP1,STATE1,STATE1,BEPERM;                      \
+               VPERM   TMP2,STATE2,STATE2,BEPERM;                      \
+               VPERM   TMP3,STATE3,STATE3,BEPERM;                      \
+               VSTM    TMP0,TMP3,0,%r2),                               \
+               __stringify(                                            \
+               /* 32 bit wise little endian store to OUTPUT */         \
+               VSTBRF  STATE0,0,,%r2;                                  \
+               VSTBRF  STATE1,16,,%r2;                                 \
+               VSTBRF  STATE2,32,,%r2;                                 \
+               VSTBRF  STATE3,48,,%r2;                                 \
+               brcl    0,0),                                           \
+               ALT_FACILITY(148)
 
        /* ++COPY3.COUNTER */
        /* alsih %r3,1 */
@@ -171,14 +177,5 @@ SYM_FUNC_START(__arch_chacha20_blocks_nostack)
        VZERO   TMP3
 
        br      %r14
-
-.Lstoreslow:
-       /* Convert STATE to little endian format and store to OUTPUT */
-       VPERM   TMP0,STATE0,STATE0,BEPERM
-       VPERM   TMP1,STATE1,STATE1,BEPERM
-       VPERM   TMP2,STATE2,STATE2,BEPERM
-       VPERM   TMP3,STATE3,STATE3,BEPERM
-       VSTM    TMP0,TMP3,0,%r2
-       j       .Lstoredone
        CFI_ENDPROC
 SYM_FUNC_END(__arch_chacha20_blocks_nostack)
This page took 0.049836 seconds and 4 git commands to generate.