]>
Commit | Line | Data |
---|---|---|
82094b55 AF |
1 | From: Greg Kroah-Hartman <gregkh@suse.de> |
2 | Subject: Linux 2.6.27.37 | |
3 | ||
4 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
5 | ||
6 | Automatically created from "patches.kernel.org/patch-2.6.27.36-37" by xen-port-patches.py | |
7 | ||
8 | --- sle11-2009-10-16.orig/arch/x86/ia32/ia32entry-xen.S 2009-10-16 14:52:16.000000000 +0200 | |
9 | +++ sle11-2009-10-16/arch/x86/ia32/ia32entry-xen.S 2009-10-19 09:53:48.000000000 +0200 | |
10 | @@ -21,8 +21,8 @@ | |
11 | #define __AUDIT_ARCH_LE 0x40000000 | |
12 | ||
13 | #ifndef CONFIG_AUDITSYSCALL | |
14 | -#define sysexit_audit int_ret_from_sys_call | |
15 | -#define sysretl_audit int_ret_from_sys_call | |
16 | +#define sysexit_audit ia32_ret_from_sys_call | |
17 | +#define sysretl_audit ia32_ret_from_sys_call | |
18 | #endif | |
19 | ||
20 | #define IA32_NR_syscalls ((ia32_syscall_end - ia32_sys_call_table)/8) | |
21 | @@ -39,12 +39,12 @@ | |
22 | .endm | |
23 | ||
24 | /* clobbers %eax */ | |
25 | - .macro CLEAR_RREGS | |
26 | + .macro CLEAR_RREGS offset=0, _r9=rax | |
27 | xorl %eax,%eax | |
28 | - movq %rax,R11(%rsp) | |
29 | - movq %rax,R10(%rsp) | |
30 | - movq %rax,R9(%rsp) | |
31 | - movq %rax,R8(%rsp) | |
32 | + movq %rax,\offset+R11(%rsp) | |
33 | + movq %rax,\offset+R10(%rsp) | |
34 | + movq %\_r9,\offset+R9(%rsp) | |
35 | + movq %rax,\offset+R8(%rsp) | |
36 | .endm | |
37 | ||
38 | /* | |
39 | @@ -52,11 +52,10 @@ | |
40 | * We don't reload %eax because syscall_trace_enter() returned | |
41 | * the value it wants us to use in the table lookup. | |
42 | */ | |
43 | - .macro LOAD_ARGS32 offset | |
44 | - movl \offset(%rsp),%r11d | |
45 | - movl \offset+8(%rsp),%r10d | |
46 | + .macro LOAD_ARGS32 offset, _r9=0 | |
47 | + .if \_r9 | |
48 | movl \offset+16(%rsp),%r9d | |
49 | - movl \offset+24(%rsp),%r8d | |
50 | + .endif | |
51 | movl \offset+40(%rsp),%ecx | |
52 | movl \offset+48(%rsp),%edx | |
53 | movl \offset+56(%rsp),%esi | |
54 | @@ -135,7 +134,7 @@ ENTRY(ia32_sysenter_target) | |
55 | SAVE_ARGS 0,0,1 | |
56 | /* no need to do an access_ok check here because rbp has been | |
57 | 32bit zero extended */ | |
58 | -1: movl (%rbp),%r9d | |
59 | +1: movl (%rbp),%ebp | |
60 | .section __ex_table,"a" | |
61 | .quad 1b,ia32_badarg | |
62 | .previous | |
63 | @@ -146,7 +145,7 @@ ENTRY(ia32_sysenter_target) | |
64 | cmpl $(IA32_NR_syscalls-1),%eax | |
65 | ja ia32_badsys | |
66 | sysenter_do_call: | |
67 | - IA32_ARG_FIXUP 1 | |
68 | + IA32_ARG_FIXUP | |
69 | sysenter_dispatch: | |
70 | call *ia32_sys_call_table(,%rax,8) | |
71 | movq %rax,RAX-ARGOFFSET(%rsp) | |
72 | @@ -155,7 +154,7 @@ sysenter_dispatch: | |
73 | TRACE_IRQS_OFF | |
74 | testl $_TIF_ALLWORK_MASK,TI_flags(%r10) | |
75 | jnz sysexit_audit | |
76 | - jmp int_ret_from_sys_call | |
77 | + jmp ia32_ret_from_sys_call | |
78 | ||
79 | #ifdef CONFIG_AUDITSYSCALL | |
80 | .macro auditsys_entry_common | |
81 | @@ -178,7 +177,7 @@ sysenter_dispatch: | |
82 | ||
83 | .macro auditsys_exit exit,ebpsave=RBP | |
84 | testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10) | |
85 | - jnz int_ret_from_sys_call | |
86 | + jnz ia32_ret_from_sys_call | |
87 | TRACE_IRQS_ON | |
88 | ENABLE_INTERRUPTS(CLBR_NONE) | |
89 | movl %eax,%esi /* second arg, syscall return value */ | |
90 | @@ -189,6 +188,7 @@ sysenter_dispatch: | |
91 | call audit_syscall_exit | |
92 | movl \ebpsave-ARGOFFSET(%rsp),%ebp /* reload user register value */ | |
93 | movl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),%edi | |
94 | + CLEAR_RREGS -ARGOFFSET | |
95 | DISABLE_INTERRUPTS(CLBR_NONE) | |
96 | TRACE_IRQS_OFF | |
97 | jmp int_with_check | |
98 | @@ -204,20 +204,17 @@ sysexit_audit: | |
99 | #endif | |
100 | ||
101 | sysenter_tracesys: | |
102 | - xchgl %r9d,%ebp | |
103 | #ifdef CONFIG_AUDITSYSCALL | |
104 | testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10) | |
105 | jz sysenter_auditsys | |
106 | #endif | |
107 | SAVE_REST | |
108 | CLEAR_RREGS | |
109 | - movq %r9,R9(%rsp) | |
110 | movq $-ENOSYS,RAX(%rsp)/* ptrace can change this for a bad syscall */ | |
111 | movq %rsp,%rdi /* &pt_regs -> arg1 */ | |
112 | call syscall_trace_enter | |
113 | LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */ | |
114 | RESTORE_REST | |
115 | - xchgl %ebp,%r9d | |
116 | cmpl $(IA32_NR_syscalls-1),%eax | |
117 | ja int_ret_from_sys_call /* sysenter_tracesys has set RAX(%rsp) */ | |
118 | jmp sysenter_do_call | |
119 | @@ -272,9 +269,9 @@ ENTRY(ia32_cstar_target) | |
120 | orl $TS_COMPAT,TI_status(%r10) | |
121 | testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10) | |
122 | jnz cstar_tracesys | |
123 | -cstar_do_call: | |
124 | cmpl $IA32_NR_syscalls-1,%eax | |
125 | ja ia32_badsys | |
126 | +cstar_do_call: | |
127 | IA32_ARG_FIXUP 1 | |
128 | cstar_dispatch: | |
129 | call *ia32_sys_call_table(,%rax,8) | |
130 | @@ -283,7 +280,7 @@ cstar_dispatch: | |
131 | DISABLE_INTERRUPTS(CLBR_NONE) | |
132 | testl $_TIF_ALLWORK_MASK,TI_flags(%r10) | |
133 | jnz sysretl_audit | |
134 | - jmp int_ret_from_sys_call | |
135 | + jmp ia32_ret_from_sys_call | |
136 | ||
137 | #ifdef CONFIG_AUDITSYSCALL | |
138 | cstar_auditsys: | |
139 | @@ -303,15 +300,13 @@ cstar_tracesys: | |
140 | #endif | |
141 | xchgl %r9d,%ebp | |
142 | SAVE_REST | |
143 | - CLEAR_RREGS | |
144 | - movq %r9,R9(%rsp) | |
145 | + CLEAR_RREGS 0, r9 | |
146 | movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */ | |
147 | movq %rsp,%rdi /* &pt_regs -> arg1 */ | |
148 | call syscall_trace_enter | |
149 | - LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */ | |
150 | + LOAD_ARGS32 ARGOFFSET, 1 /* reload args from stack in case ptrace changed it */ | |
151 | RESTORE_REST | |
152 | xchgl %ebp,%r9d | |
153 | - movl RSP-ARGOFFSET(%rsp), %r8d | |
154 | cmpl $(IA32_NR_syscalls-1),%eax | |
155 | ja int_ret_from_sys_call /* cstar_tracesys has set RAX(%rsp) */ | |
156 | jmp cstar_do_call | |
157 | @@ -376,6 +371,8 @@ ia32_do_call: | |
158 | call *ia32_sys_call_table(,%rax,8) # xxx: rip relative | |
159 | ia32_sysret: | |
160 | movq %rax,RAX-ARGOFFSET(%rsp) | |
161 | +ia32_ret_from_sys_call: | |
162 | + CLEAR_RREGS -ARGOFFSET | |
163 | jmp int_ret_from_sys_call | |
164 | ||
165 | ia32_tracesys: | |
166 | @@ -393,8 +390,8 @@ END(ia32_syscall) | |
167 | ||
168 | ia32_badsys: | |
169 | movq $0,ORIG_RAX-ARGOFFSET(%rsp) | |
170 | - movq $-ENOSYS,RAX-ARGOFFSET(%rsp) | |
171 | - jmp int_ret_from_sys_call | |
172 | + movq $-ENOSYS,%rax | |
173 | + jmp ia32_sysret | |
174 | ||
175 | quiet_ni_syscall: | |
176 | movq $-ENOSYS,%rax |