Message ID | 20200311180416.6509-4-richard.henderson@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | arm64: gcc asm flag outputs | expand |
On 11/03/2020 6:04 pm, Richard Henderson wrote: > There's no reason for the input address to match the output > register. Give the register allocator a bit more freedom. See commit 9085b34d0e83 - as originally written they *were* the same operand, and this was just some impedance-matching for types. However, I suppose this might save a mov to initialise "ret" in the !CONFIG_ARM64_TAGGED_ADDR_ABI case where the original value of "addr" is still live for subsequent use, so it's probably reasonable. On the other hand, the naming only reinforces my previous complaint - now we have "addr_in" corresponding to "addr", and "addr" bearing no relation to either of those :( Robin. > Signed-off-by: Richard Henderson <richard.henderson@linaro.org> > --- > arch/arm64/include/asm/uaccess.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm/uaccess.h > index ceb1d79eab09..fe3dd70e901e 100644 > --- a/arch/arm64/include/asm/uaccess.h > +++ b/arch/arm64/include/asm/uaccess.h > @@ -75,7 +75,7 @@ static inline unsigned long __range_ok(const void __user *addr, unsigned long si > asm volatile( > // A + B <= C + 1 for all A,B,C, in four easy steps: > // 1: X = A + B; X' = X % 2^64 > - " adds %[addr], %[addr], %[size]\n" > + " adds %[addr], %[addr_in], %[size]\n" > // 2: Set C = 0 if X > 2^64, to guarantee X' > C in step 4 > " csel %[limit], xzr, %[limit], hi\n" > // 3: Set X' = ~0 if X >= 2^64. For X == 2^64, this decrements X' > @@ -88,7 +88,7 @@ static inline unsigned long __range_ok(const void __user *addr, unsigned long si > " sbcs xzr, %[addr], %[limit]\n" > " cset %[addr], ls\n" > : [addr] "=&r" (ret), [limit] "+r" (limit) > - : [size] "Ir" (size), "0" (addr) > + : [size] "Ir" (size), [addr_in] "r" (addr) > : "cc"); > > return ret; >
diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm/uaccess.h index ceb1d79eab09..fe3dd70e901e 100644 --- a/arch/arm64/include/asm/uaccess.h +++ b/arch/arm64/include/asm/uaccess.h @@ -75,7 +75,7 @@ static inline unsigned long __range_ok(const void __user *addr, unsigned long si asm volatile( // A + B <= C + 1 for all A,B,C, in four easy steps: // 1: X = A + B; X' = X % 2^64 - " adds %[addr], %[addr], %[size]\n" + " adds %[addr], %[addr_in], %[size]\n" // 2: Set C = 0 if X > 2^64, to guarantee X' > C in step 4 " csel %[limit], xzr, %[limit], hi\n" // 3: Set X' = ~0 if X >= 2^64. For X == 2^64, this decrements X' @@ -88,7 +88,7 @@ static inline unsigned long __range_ok(const void __user *addr, unsigned long si " sbcs xzr, %[addr], %[limit]\n" " cset %[addr], ls\n" : [addr] "=&r" (ret), [limit] "+r" (limit) - : [size] "Ir" (size), "0" (addr) + : [size] "Ir" (size), [addr_in] "r" (addr) : "cc"); return ret;
There's no reason for the input address to match the output register. Give the register allocator a bit more freedom. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- arch/arm64/include/asm/uaccess.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)