Skip to content

Commit d714abe

Browse files
hcahcaVasily Gorbik
authored andcommitted
s390/vdso: Use one large alternative instead of an alternative branch
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 <hca@linux.ibm.com> Reviewed-by: Jens Remus <jremus@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
1 parent c902b57 commit d714abe

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

arch/s390/kernel/vdso64/vgetrandom-chacha.S

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,22 @@ SYM_FUNC_START(__arch_chacha20_blocks_nostack)
130130
/* OUTPUT3 = STATE3 + COPY3 */
131131
VAF STATE3,STATE3,COPY3
132132

133-
/*
134-
* 32 bit wise little endian store to OUTPUT. If the vector
135-
* enhancement facility 2 is not installed use the slow path.
136-
*/
137-
ALTERNATIVE "brc 0xf,.Lstoreslow", "nop", ALT_FACILITY(148)
138-
VSTBRF STATE0,0,,%r2
139-
VSTBRF STATE1,16,,%r2
140-
VSTBRF STATE2,32,,%r2
141-
VSTBRF STATE3,48,,%r2
142-
.Lstoredone:
133+
ALTERNATIVE \
134+
__stringify( \
135+
/* Convert STATE to little endian and store to OUTPUT */\
136+
VPERM TMP0,STATE0,STATE0,BEPERM; \
137+
VPERM TMP1,STATE1,STATE1,BEPERM; \
138+
VPERM TMP2,STATE2,STATE2,BEPERM; \
139+
VPERM TMP3,STATE3,STATE3,BEPERM; \
140+
VSTM TMP0,TMP3,0,%r2), \
141+
__stringify( \
142+
/* 32 bit wise little endian store to OUTPUT */ \
143+
VSTBRF STATE0,0,,%r2; \
144+
VSTBRF STATE1,16,,%r2; \
145+
VSTBRF STATE2,32,,%r2; \
146+
VSTBRF STATE3,48,,%r2; \
147+
brcl 0,0), \
148+
ALT_FACILITY(148)
143149

144150
/* ++COPY3.COUNTER */
145151
/* alsih %r3,1 */
@@ -171,14 +177,5 @@ SYM_FUNC_START(__arch_chacha20_blocks_nostack)
171177
VZERO TMP3
172178

173179
br %r14
174-
175-
.Lstoreslow:
176-
/* Convert STATE to little endian format and store to OUTPUT */
177-
VPERM TMP0,STATE0,STATE0,BEPERM
178-
VPERM TMP1,STATE1,STATE1,BEPERM
179-
VPERM TMP2,STATE2,STATE2,BEPERM
180-
VPERM TMP3,STATE3,STATE3,BEPERM
181-
VSTM TMP0,TMP3,0,%r2
182-
j .Lstoredone
183180
CFI_ENDPROC
184181
SYM_FUNC_END(__arch_chacha20_blocks_nostack)

0 commit comments

Comments
 (0)