]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/uaccess: Remove usage of the oac specifier
authorHeiko Carstens <hca@linux.ibm.com>
Mon, 13 Jan 2025 12:37:05 +0000 (13:37 +0100)
committerAlexander Gordeev <agordeev@linux.ibm.com>
Sun, 26 Jan 2025 16:24:06 +0000 (17:24 +0100)
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>
arch/s390/include/asm/uaccess.h

index db22aefd452c56d1e54f55ec7922db262c5d6c5c..bdf46510b214e2233741481a9b737b311304a253 100644 (file)
@@ -92,14 +92,10 @@ __put_user_##type##_noinstr(unsigned type __user *to,                       \
                            unsigned type *from,                        \
                            unsigned long size)                         \
 {                                                                      \
-       union oac __oac_spec = {                                        \
-               .oac1.as = PSW_BITS_AS_SECONDARY,                       \
-               .oac1.a = 1,                                            \
-       };                                                              \
        int rc;                                                         \
                                                                        \
        asm volatile(                                                   \
-               "       lr      %%r0,%[spec]\n"                         \
+               "       llilh   %%r0,%[spec]\n"                         \
                "0:     mvcos   %[to],%[from],%[size]\n"                \
                "1:     lhi     %[rc],0\n"                              \
                "2:\n"                                                  \
@@ -107,7 +103,7 @@ __put_user_##type##_noinstr(unsigned type __user *to,                       \
                EX_TABLE_UA_FAULT(1b, 2b, %[rc])                        \
                : [rc] "=d" (rc), [to] "+Q" (*to)                       \
                : [size] "d" (size), [from] "Q" (*from),                \
-                 [spec] "d" (__oac_spec.val)                           \
+                 [spec] "I" (0x81)                                     \
                : "cc", "0");                                           \
        return rc;                                                      \
 }                                                                      \
@@ -176,14 +172,10 @@ __get_user_##type##_noinstr(unsigned type *to,                            \
                            const unsigned type __user *from,           \
                            unsigned long size)                         \
 {                                                                      \
-       union oac __oac_spec = {                                        \
-               .oac2.as = PSW_BITS_AS_SECONDARY,                       \
-               .oac2.a = 1,                                            \
-       };                                                              \
        int rc;                                                         \
                                                                        \
        asm volatile(                                                   \
-               "       l     %%r0,%[spec]\n"                         \
+               "       lhi     %%r0,%[spec]\n"                         \
                "0:     mvcos   %[to],%[from],%[size]\n"                \
                "1:     lhi     %[rc],0\n"                              \
                "2:\n"                                                  \
@@ -191,7 +183,7 @@ __get_user_##type##_noinstr(unsigned type *to,                              \
                EX_TABLE_UA_FAULT(1b, 2b, %[rc])                        \
                : [rc] "=d" (rc), [to] "=Q" (*to)                       \
                : [size] "d" (size), [from] "Q" (*from),                \
-                 [spec] "d" (__oac_spec.val)                           \
+                 [spec] "I" (0x81)                                     \
                : "cc", "0");                                           \
        if (likely(!rc))                                                \
                return 0;                                               \