Skip to content

Commit 636d35a

Browse files
hcahcaAlexander Gordeev
authored andcommitted
s390/uaccess: Remove usage of the oac specifier
Remove usage of the operand access control specifier for put_user() and get_user() (again). Instead hardcode the specifier for both inline assemblies. This saves one instruction. Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
1 parent dc7ff4b commit 636d35a

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

arch/s390/include/asm/uaccess.h

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -92,22 +92,18 @@ __put_user_##type##_noinstr(unsigned type __user *to, \
9292
unsigned type *from, \
9393
unsigned long size) \
9494
{ \
95-
union oac __oac_spec = { \
96-
.oac1.as = PSW_BITS_AS_SECONDARY, \
97-
.oac1.a = 1, \
98-
}; \
9995
int rc; \
10096
\
10197
asm volatile( \
102-
" lr %%r0,%[spec]\n" \
98+
" llilh %%r0,%[spec]\n" \
10399
"0: mvcos %[to],%[from],%[size]\n" \
104100
"1: lhi %[rc],0\n" \
105101
"2:\n" \
106102
EX_TABLE_UA_FAULT(0b, 2b, %[rc]) \
107103
EX_TABLE_UA_FAULT(1b, 2b, %[rc]) \
108104
: [rc] "=d" (rc), [to] "+Q" (*to) \
109105
: [size] "d" (size), [from] "Q" (*from), \
110-
[spec] "d" (__oac_spec.val) \
106+
[spec] "I" (0x81) \
111107
: "cc", "0"); \
112108
return rc; \
113109
} \
@@ -176,22 +172,18 @@ __get_user_##type##_noinstr(unsigned type *to, \
176172
const unsigned type __user *from, \
177173
unsigned long size) \
178174
{ \
179-
union oac __oac_spec = { \
180-
.oac2.as = PSW_BITS_AS_SECONDARY, \
181-
.oac2.a = 1, \
182-
}; \
183175
int rc; \
184176
\
185177
asm volatile( \
186-
" lr %%r0,%[spec]\n" \
178+
" lhi %%r0,%[spec]\n" \
187179
"0: mvcos %[to],%[from],%[size]\n" \
188180
"1: lhi %[rc],0\n" \
189181
"2:\n" \
190182
EX_TABLE_UA_FAULT(0b, 2b, %[rc]) \
191183
EX_TABLE_UA_FAULT(1b, 2b, %[rc]) \
192184
: [rc] "=d" (rc), [to] "=Q" (*to) \
193185
: [size] "d" (size), [from] "Q" (*from), \
194-
[spec] "d" (__oac_spec.val) \
186+
[spec] "I" (0x81) \
195187
: "cc", "0"); \
196188
if (likely(!rc)) \
197189
return 0; \

0 commit comments

Comments
 (0)