Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/alternatives: use insn format for new instructions

Use insn format with instruction format specifier instead of plain
longs. This way it is also more obvious that code instead of data is
generated.

The generated code is identical.

Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>

authored by

Heiko Carstens and committed by
Vasily Gorbik
6982dba1 4afeb670

+8 -8
+1 -1
arch/s390/include/asm/spinlock.h
··· 78 78 { 79 79 typecheck(int, lp->lock); 80 80 asm_inline volatile( 81 - ALTERNATIVE("", ".long 0xb2fa0070", 49) /* NIAI 7 */ 81 + ALTERNATIVE("", ".insn rre,0xb2fa0000,7,0", 49) /* NIAI 7 */ 82 82 " sth %1,%0\n" 83 83 : "=R" (((unsigned short *) &lp->lock)[1]) 84 84 : "d" (0) : "cc", "memory");
+5 -5
arch/s390/kernel/entry.S
··· 121 121 .endm 122 122 123 123 .macro BPOFF 124 - ALTERNATIVE "", ".long 0xb2e8c000", 82 124 + ALTERNATIVE "", ".insn rrf,0xb2e80000,0,0,12,0", 82 125 125 .endm 126 126 127 127 .macro BPON 128 - ALTERNATIVE "", ".long 0xb2e8d000", 82 128 + ALTERNATIVE "", ".insn rrf,0xb2e80000,0,0,13,0", 82 129 129 .endm 130 130 131 131 .macro BPENTER tif_ptr,tif_mask 132 - ALTERNATIVE "TSTMSK \tif_ptr,\tif_mask; jz .+8; .long 0xb2e8d000", \ 132 + ALTERNATIVE "TSTMSK \tif_ptr,\tif_mask; jz .+8; .insn rrf,0xb2e80000,0,0,13,0", \ 133 133 "", 82 134 134 .endm 135 135 136 136 .macro BPEXIT tif_ptr,tif_mask 137 137 TSTMSK \tif_ptr,\tif_mask 138 - ALTERNATIVE "jz .+8; .long 0xb2e8c000", \ 139 - "jnz .+8; .long 0xb2e8d000", 82 138 + ALTERNATIVE "jz .+8; .insn rrf,0xb2e80000,0,0,12,0", \ 139 + "jnz .+8; .insn rrf,0xb2e80000,0,0,13,0", 82 140 140 .endm 141 141 142 142 /*
+2 -2
arch/s390/lib/spinlock.c
··· 75 75 int owner; 76 76 77 77 asm_inline volatile( 78 - ALTERNATIVE("", ".long 0xb2fa0040", 49) /* NIAI 4 */ 78 + ALTERNATIVE("", ".insn rre,0xb2fa0000,4,0", 49) /* NIAI 4 */ 79 79 " l %0,%1\n" 80 80 : "=d" (owner) : "Q" (*lock) : "memory"); 81 81 return owner; ··· 86 86 int expected = old; 87 87 88 88 asm_inline volatile( 89 - ALTERNATIVE("", ".long 0xb2fa0080", 49) /* NIAI 8 */ 89 + ALTERNATIVE("", ".insn rre,0xb2fa0000,8,0", 49) /* NIAI 8 */ 90 90 " cs %0,%3,%1\n" 91 91 : "=d" (old), "=Q" (*lock) 92 92 : "0" (old), "d" (new), "Q" (*lock)