]> Git Repo - linux.git/commitdiff
s390/uaccess: avoid __ashlti3() call
authorHeiko Carstens <[email protected]>
Wed, 4 Jan 2023 15:55:53 +0000 (16:55 +0100)
committerHeiko Carstens <[email protected]>
Wed, 4 Jan 2023 16:54:50 +0000 (17:54 +0100)
__cmpxchg_user_key() uses 128 bit types which, depending on compiler
and config options, may lead to an __ashlti3() library call.

Get rid of that by simply casting the 128 bit values to 32 bit values.

Reported-by: kernel test robot <[email protected]>
Suggested-by: Janis Schoetterl-Glausch <[email protected]>
Fixes: 51098f0eb22e ("s390/cmpxchg: make loop condition for 1,2 byte cases precise")
Link: https://lore.kernel.org/all/[email protected]/
Signed-off-by: Heiko Carstens <[email protected]>
arch/s390/include/asm/uaccess.h

index 7c10f594e74782fde1e0d656b5658fd9f1d069f3..8a8c64a678c4a83a7310bca0f48e8139d7a6e7ea 100644 (file)
@@ -407,8 +407,8 @@ static __always_inline int __cmpxchg_user_key(unsigned long address, void *uval,
 
                shift = (3 ^ (address & 3)) << 3;
                address ^= address & 3;
-               _old = (old & 0xff) << shift;
-               _new = (new & 0xff) << shift;
+               _old = ((unsigned int)old & 0xff) << shift;
+               _new = ((unsigned int)new & 0xff) << shift;
                mask = ~(0xff << shift);
                asm volatile(
                        "       spka    0(%[key])\n"
@@ -455,8 +455,8 @@ static __always_inline int __cmpxchg_user_key(unsigned long address, void *uval,
 
                shift = (2 ^ (address & 2)) << 3;
                address ^= address & 2;
-               _old = (old & 0xffff) << shift;
-               _new = (new & 0xffff) << shift;
+               _old = ((unsigned int)old & 0xffff) << shift;
+               _new = ((unsigned int)new & 0xffff) << shift;
                mask = ~(0xffff << shift);
                asm volatile(
                        "       spka    0(%[key])\n"
This page took 0.05672 seconds and 4 git commands to generate.