x86, putuser: switch 64-bit version to normal calling convention
PATCH 4/4 x86, putuser: switch 64-bit version to normal calling convention
Use usual RDI, RSI for put_user()'s arguments.
Do everything in 4 registers, clobber RDX being the next in sequence.
Do CLAC as soon as possible.
Indent more.
Delete unnecessary macros.
This essentially undoes what Glauber did 10 years ago, but the "this is the i386 way" is not an argument today :^)
Signed-off-by Alexey Dobriyan <[email protected]>
---
arch/x86/include/asm/uaccess.h | 9 ++- arch/x86/lib/putuser_64.S | 106 ++++++++++++++++------------------------- 2 files changed, 50 insertions(+), 65 deletions(-)
arch/x86/include/asm/uaccess.h +7 -2
@@ -175,12 +175,17 @@ __typeof__(__builtin_choose_expr(sizeof(x) > sizeof(0UL), 0ULL, 0UL))__builtin_expect (__ret_gu,0 ); \ }) +#ifdef CONFIG_X86_32 #define __put_user_x (size, x, ptr, __ret_pu) \ asm volatile("call __put_user_" #size \ : "=a" (__ret_pu), ASM_CALL_CONSTRAINT \ : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx") - - +#else +#define __put_user_x (size, x, ptr, __ret_pu) \ + asm volatile("call __put_user_" #size \ + : "=a" (__ret_pu), ASM_CALL_CONSTRAINT \ + : "D" ((typeof(*(ptr)))(x)), "S" (ptr) : "rdx") +#endif #ifdef CONFIG_X86_32 #define __put_user_goto_u64 (x, addr, label) \
arch/x86/lib/putuser_64.S +43 -63
140 lines not on this page · raw message