aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlauber Costa <gcosta@redhat.com>2008-06-13 15:35:52 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-09 03:13:59 -0400
commitedf10162b2c5ad78ada8e63e960f9d0949c6c219 (patch)
treec860cce966d760d230fe56de713093b7eec25df4
parentf8dd0d3c62164160c59034a96eb17d69ac8a0328 (diff)
x86: don't clobber r8 nor use rcx.
There's really no reason to clobber r8 or pass the address in rcx. We can safely use only two registers (which we already have to touch anyway) to do the job. Signed-off-by: Glauber Costa <gcosta@redhat.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/lib/getuser_64.S42
-rw-r--r--include/asm-x86/uaccess_64.h3
2 files changed, 22 insertions, 23 deletions
diff --git a/arch/x86/lib/getuser_64.S b/arch/x86/lib/getuser_64.S
index 5448876261f8..2b003d313480 100644
--- a/arch/x86/lib/getuser_64.S
+++ b/arch/x86/lib/getuser_64.S
@@ -36,10 +36,10 @@
36 .text 36 .text
37ENTRY(__get_user_1) 37ENTRY(__get_user_1)
38 CFI_STARTPROC 38 CFI_STARTPROC
39 GET_THREAD_INFO(%r8) 39 GET_THREAD_INFO(%rdx)
40 cmpq threadinfo_addr_limit(%r8),%rcx 40 cmpq threadinfo_addr_limit(%rdx),%rax
41 jae bad_get_user 41 jae bad_get_user
421: movzb (%rcx),%edx 421: movzb (%rax),%edx
43 xorl %eax,%eax 43 xorl %eax,%eax
44 ret 44 ret
45 CFI_ENDPROC 45 CFI_ENDPROC
@@ -47,48 +47,48 @@ ENDPROC(__get_user_1)
47 47
48ENTRY(__get_user_2) 48ENTRY(__get_user_2)
49 CFI_STARTPROC 49 CFI_STARTPROC
50 GET_THREAD_INFO(%r8) 50 GET_THREAD_INFO(%rdx)
51 addq $1,%rcx 51 addq $1,%rax
52 jc 20f 52 jc 20f
53 cmpq threadinfo_addr_limit(%r8),%rcx 53 cmpq threadinfo_addr_limit(%rdx),%rax
54 jae 20f 54 jae 20f
55 decq %rcx 55 decq %rax
562: movzwl (%rcx),%edx 562: movzwl (%rax),%edx
57 xorl %eax,%eax 57 xorl %eax,%eax
58 ret 58 ret
5920: decq %rcx 5920: decq %rax
60 jmp bad_get_user 60 jmp bad_get_user
61 CFI_ENDPROC 61 CFI_ENDPROC
62ENDPROC(__get_user_2) 62ENDPROC(__get_user_2)
63 63
64ENTRY(__get_user_4) 64ENTRY(__get_user_4)
65 CFI_STARTPROC 65 CFI_STARTPROC
66 GET_THREAD_INFO(%r8) 66 GET_THREAD_INFO(%rdx)
67 addq $3,%rcx 67 addq $3,%rax
68 jc 30f 68 jc 30f
69 cmpq threadinfo_addr_limit(%r8),%rcx 69 cmpq threadinfo_addr_limit(%rdx),%rax
70 jae 30f 70 jae 30f
71 subq $3,%rcx 71 subq $3,%rax
723: movl (%rcx),%edx 723: movl (%rax),%edx
73 xorl %eax,%eax 73 xorl %eax,%eax
74 ret 74 ret
7530: subq $3,%rcx 7530: subq $3,%rax
76 jmp bad_get_user 76 jmp bad_get_user
77 CFI_ENDPROC 77 CFI_ENDPROC
78ENDPROC(__get_user_4) 78ENDPROC(__get_user_4)
79 79
80ENTRY(__get_user_8) 80ENTRY(__get_user_8)
81 CFI_STARTPROC 81 CFI_STARTPROC
82 GET_THREAD_INFO(%r8) 82 GET_THREAD_INFO(%rdx)
83 addq $7,%rcx 83 addq $7,%rax
84 jc 40f 84 jc 40f
85 cmpq threadinfo_addr_limit(%r8),%rcx 85 cmpq threadinfo_addr_limit(%rdx),%rax
86 jae 40f 86 jae 40f
87 subq $7,%rcx 87 subq $7,%rax
884: movq (%rcx),%rdx 884: movq (%rax),%rdx
89 xorl %eax,%eax 89 xorl %eax,%eax
90 ret 90 ret
9140: subq $7,%rcx 9140: subq $7,%rax
92 jmp bad_get_user 92 jmp bad_get_user
93 CFI_ENDPROC 93 CFI_ENDPROC
94ENDPROC(__get_user_8) 94ENDPROC(__get_user_8)
diff --git a/include/asm-x86/uaccess_64.h b/include/asm-x86/uaccess_64.h
index b8a2f4339903..a2d49078e19c 100644
--- a/include/asm-x86/uaccess_64.h
+++ b/include/asm-x86/uaccess_64.h
@@ -90,8 +90,7 @@ extern int fixup_exception(struct pt_regs *regs);
90#define __get_user_x(size, ret, x, ptr) \ 90#define __get_user_x(size, ret, x, ptr) \
91 asm volatile("call __get_user_" #size \ 91 asm volatile("call __get_user_" #size \
92 : "=a" (ret),"=d" (x) \ 92 : "=a" (ret),"=d" (x) \
93 : "c" (ptr) \ 93 : "0" (ptr)) \
94 : "r8")
95 94
96/* Careful: we have to cast the result to the type of the pointer 95/* Careful: we have to cast the result to the type of the pointer
97 * for sign reasons */ 96 * for sign reasons */