diff options
author | Glauber Costa <gcosta@redhat.com> | 2008-06-24 15:51:59 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-09 03:14:09 -0400 |
commit | 663aa96df32af9c4141ef3179282f95c7537643a (patch) | |
tree | fd8856815bea7ef8b6525f498cbc6f7dc2ded28e /arch/x86 | |
parent | 0ada3164031162b4e1b7ff6b36ba8cc80ff7fe96 (diff) |
x86: change testing logic in putuser_64.S.
Instead of operating over a register we need to put back
into normal state afterwards (the memory position), just
sub from rbx, which is trashed anyway. We can save a few instructions.
Also, this is the i386 way.
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>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/lib/putuser_64.S | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/arch/x86/lib/putuser_64.S b/arch/x86/lib/putuser_64.S index ce5fcd5d8c16..a96bd8a5298e 100644 --- a/arch/x86/lib/putuser_64.S +++ b/arch/x86/lib/putuser_64.S | |||
@@ -46,48 +46,39 @@ ENDPROC(__put_user_1) | |||
46 | ENTRY(__put_user_2) | 46 | ENTRY(__put_user_2) |
47 | CFI_STARTPROC | 47 | CFI_STARTPROC |
48 | GET_THREAD_INFO(%rbx) | 48 | GET_THREAD_INFO(%rbx) |
49 | addq $1,%rcx | 49 | mov TI_addr_limit(%rbx),%rbx |
50 | jc 20f | 50 | sub $1, %rbx |
51 | cmpq TI_addr_limit(%rbx),%rcx | 51 | cmpq %rbx ,%rcx |
52 | jae 20f | 52 | jae bad_put_user |
53 | decq %rcx | ||
54 | 2: movw %ax,(%rcx) | 53 | 2: movw %ax,(%rcx) |
55 | xorl %eax,%eax | 54 | xorl %eax,%eax |
56 | ret | 55 | ret |
57 | 20: decq %rcx | ||
58 | jmp bad_put_user | ||
59 | CFI_ENDPROC | 56 | CFI_ENDPROC |
60 | ENDPROC(__put_user_2) | 57 | ENDPROC(__put_user_2) |
61 | 58 | ||
62 | ENTRY(__put_user_4) | 59 | ENTRY(__put_user_4) |
63 | CFI_STARTPROC | 60 | CFI_STARTPROC |
64 | GET_THREAD_INFO(%rbx) | 61 | GET_THREAD_INFO(%rbx) |
65 | addq $3,%rcx | 62 | mov TI_addr_limit(%rbx),%rbx |
66 | jc 30f | 63 | sub $3, %rbx |
67 | cmpq TI_addr_limit(%rbx),%rcx | 64 | cmp %rbx, %rcx |
68 | jae 30f | 65 | jae bad_put_user |
69 | subq $3,%rcx | ||
70 | 3: movl %eax,(%rcx) | 66 | 3: movl %eax,(%rcx) |
71 | xorl %eax,%eax | 67 | xorl %eax,%eax |
72 | ret | 68 | ret |
73 | 30: subq $3,%rcx | ||
74 | jmp bad_put_user | ||
75 | CFI_ENDPROC | 69 | CFI_ENDPROC |
76 | ENDPROC(__put_user_4) | 70 | ENDPROC(__put_user_4) |
77 | 71 | ||
78 | ENTRY(__put_user_8) | 72 | ENTRY(__put_user_8) |
79 | CFI_STARTPROC | 73 | CFI_STARTPROC |
80 | GET_THREAD_INFO(%rbx) | 74 | GET_THREAD_INFO(%rbx) |
81 | addq $7,%rcx | 75 | mov TI_addr_limit(%rbx),%rbx |
82 | jc 40f | 76 | sub $7, %rbx |
83 | cmpq TI_addr_limit(%rbx),%rcx | 77 | cmp %rbx, %rcx |
84 | jae 40f | 78 | jae bad_put_user |
85 | subq $7,%rcx | ||
86 | 4: movq %rax,(%rcx) | 79 | 4: movq %rax,(%rcx) |
87 | xorl %eax,%eax | 80 | xorl %eax,%eax |
88 | ret | 81 | ret |
89 | 40: subq $7,%rcx | ||
90 | jmp bad_put_user | ||
91 | CFI_ENDPROC | 82 | CFI_ENDPROC |
92 | ENDPROC(__put_user_8) | 83 | ENDPROC(__put_user_8) |
93 | 84 | ||