blob: f27b709754bfd885d2367f7ef10a56bfecc1a926 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Compatibility mode system call entry point for x86-64.
3 *
4 * Copyright 2000-2002 Andi Kleen, SuSE Labs.
5 */
6
7#include <asm/dwarf2.h>
8#include <asm/calling.h>
Sam Ravnborge2d5df92005-09-09 21:28:48 +02009#include <asm/asm-offsets.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070010#include <asm/current.h>
11#include <asm/errno.h>
12#include <asm/ia32_unistd.h>
13#include <asm/thread_info.h>
14#include <asm/segment.h>
Ingo Molnar2601e642006-07-03 00:24:45 -070015#include <asm/irqflags.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070016#include <linux/linkage.h>
17
Roland McGrath5cbf1562008-06-24 01:13:31 -070018/* Avoid __ASSEMBLER__'ifying <linux/audit.h> just for this. */
19#include <linux/elf-em.h>
20#define AUDIT_ARCH_I386 (EM_386|__AUDIT_ARCH_LE)
21#define __AUDIT_ARCH_LE 0x40000000
22
23#ifndef CONFIG_AUDITSYSCALL
Jan Beulich24e35802009-09-30 11:22:11 +010024#define sysexit_audit ia32_ret_from_sys_call
25#define sysretl_audit ia32_ret_from_sys_call
Roland McGrath5cbf1562008-06-24 01:13:31 -070026#endif
27
Jiri Olsaea714542011-03-07 19:10:39 +010028 .section .entry.text, "ax"
29
Andi Kleen67d53ea2006-04-07 19:50:31 +020030#define IA32_NR_syscalls ((ia32_syscall_end - ia32_sys_call_table)/8)
31
Linus Torvalds1da177e2005-04-16 15:20:36 -070032 .macro IA32_ARG_FIXUP noebp=0
33 movl %edi,%r8d
34 .if \noebp
35 .else
36 movl %ebp,%r9d
37 .endif
38 xchg %ecx,%esi
39 movl %ebx,%edi
40 movl %edx,%edx /* zero extension */
41 .endm
42
43 /* clobbers %eax */
Jan Beulich24e35802009-09-30 11:22:11 +010044 .macro CLEAR_RREGS offset=0, _r9=rax
Linus Torvalds1da177e2005-04-16 15:20:36 -070045 xorl %eax,%eax
Jan Beulich24e35802009-09-30 11:22:11 +010046 movq %rax,\offset+R11(%rsp)
47 movq %rax,\offset+R10(%rsp)
48 movq %\_r9,\offset+R9(%rsp)
49 movq %rax,\offset+R8(%rsp)
Linus Torvalds1da177e2005-04-16 15:20:36 -070050 .endm
51
Roland McGrathd4d67152008-07-09 02:38:07 -070052 /*
53 * Reload arg registers from stack in case ptrace changed them.
54 * We don't reload %eax because syscall_trace_enter() returned
Roland McGratheefdca02010-09-14 12:22:58 -070055 * the %rax value we should see. Instead, we just truncate that
56 * value to 32 bits again as we did on entry from user mode.
57 * If it's a new value set by user_regset during entry tracing,
58 * this matches the normal truncation of the user-mode value.
59 * If it's -1 to make us punt the syscall, then (u32)-1 is still
60 * an appropriately invalid value.
Roland McGrathd4d67152008-07-09 02:38:07 -070061 */
Jan Beulich295286a2008-08-29 13:21:11 +010062 .macro LOAD_ARGS32 offset, _r9=0
63 .if \_r9
Andi Kleen176df242007-09-21 16:16:18 +020064 movl \offset+16(%rsp),%r9d
Jan Beulich295286a2008-08-29 13:21:11 +010065 .endif
Andi Kleen176df242007-09-21 16:16:18 +020066 movl \offset+40(%rsp),%ecx
67 movl \offset+48(%rsp),%edx
68 movl \offset+56(%rsp),%esi
69 movl \offset+64(%rsp),%edi
Roland McGratheefdca02010-09-14 12:22:58 -070070 movl %eax,%eax /* zero extension */
Andi Kleen176df242007-09-21 16:16:18 +020071 .endm
72
Jan Beulich27651302006-01-11 22:41:59 +010073 .macro CFI_STARTPROC32 simple
74 CFI_STARTPROC \simple
75 CFI_UNDEFINED r8
76 CFI_UNDEFINED r9
77 CFI_UNDEFINED r10
78 CFI_UNDEFINED r11
79 CFI_UNDEFINED r12
80 CFI_UNDEFINED r13
81 CFI_UNDEFINED r14
82 CFI_UNDEFINED r15
83 .endm
84
Jeremy Fitzhardinge2be29982008-06-25 00:19:28 -040085#ifdef CONFIG_PARAVIRT
86ENTRY(native_usergs_sysret32)
87 swapgs
88 sysretl
89ENDPROC(native_usergs_sysret32)
90
91ENTRY(native_irq_enable_sysexit)
92 swapgs
93 sti
94 sysexit
95ENDPROC(native_irq_enable_sysexit)
96#endif
97
Linus Torvalds1da177e2005-04-16 15:20:36 -070098/*
99 * 32bit SYSENTER instruction entry.
100 *
101 * Arguments:
102 * %eax System call number.
103 * %ebx Arg1
104 * %ecx Arg2
105 * %edx Arg3
106 * %esi Arg4
107 * %edi Arg5
108 * %ebp user stack
109 * 0(%ebp) Arg6
110 *
111 * Interrupts off.
112 *
113 * This is purely a fast path. For anything complicated we use the int 0x80
114 * path below. Set up a complete hardware stack frame to share code
115 * with the int 0x80 path.
116 */
117ENTRY(ia32_sysenter_target)
Jan Beulich27651302006-01-11 22:41:59 +0100118 CFI_STARTPROC32 simple
Jan Beulichadf14232006-09-26 10:52:41 +0200119 CFI_SIGNAL_FRAME
Jan Beulich7effaa82005-09-12 18:49:24 +0200120 CFI_DEF_CFA rsp,0
121 CFI_REGISTER rsp,rbp
Jeremy Fitzhardinge457da702008-06-26 07:28:51 -0700122 SWAPGS_UNSAFE_STACK
Brian Gerst9af45652009-01-19 00:38:58 +0900123 movq PER_CPU_VAR(kernel_stack), %rsp
124 addq $(KERNEL_STACK_OFFSET),%rsp
Ingo Molnar2601e642006-07-03 00:24:45 -0700125 /*
126 * No need to follow this irqs on/off section: the syscall
127 * disabled irqs, here we enable it straight after entry:
128 */
Jeremy Fitzhardinge66804152008-06-25 00:19:29 -0400129 ENABLE_INTERRUPTS(CLBR_NONE)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700130 movl %ebp,%ebp /* zero extension */
131 pushq $__USER32_DS
Jan Beulich7effaa82005-09-12 18:49:24 +0200132 CFI_ADJUST_CFA_OFFSET 8
133 /*CFI_REL_OFFSET ss,0*/
Linus Torvalds1da177e2005-04-16 15:20:36 -0700134 pushq %rbp
Jan Beulich7effaa82005-09-12 18:49:24 +0200135 CFI_ADJUST_CFA_OFFSET 8
136 CFI_REL_OFFSET rsp,0
Linus Torvalds1da177e2005-04-16 15:20:36 -0700137 pushfq
Jan Beulich7effaa82005-09-12 18:49:24 +0200138 CFI_ADJUST_CFA_OFFSET 8
139 /*CFI_REL_OFFSET rflags,0*/
Glauber Costa26ccb8a2008-06-24 11:19:35 -0300140 movl 8*3-THREAD_SIZE+TI_sysenter_return(%rsp), %r10d
Jan Beulich7effaa82005-09-12 18:49:24 +0200141 CFI_REGISTER rip,r10
Linus Torvalds1da177e2005-04-16 15:20:36 -0700142 pushq $__USER32_CS
Jan Beulich7effaa82005-09-12 18:49:24 +0200143 CFI_ADJUST_CFA_OFFSET 8
144 /*CFI_REL_OFFSET cs,0*/
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145 movl %eax, %eax
146 pushq %r10
Jan Beulich7effaa82005-09-12 18:49:24 +0200147 CFI_ADJUST_CFA_OFFSET 8
148 CFI_REL_OFFSET rip,0
Linus Torvalds1da177e2005-04-16 15:20:36 -0700149 pushq %rax
Jan Beulich7effaa82005-09-12 18:49:24 +0200150 CFI_ADJUST_CFA_OFFSET 8
Linus Torvalds1da177e2005-04-16 15:20:36 -0700151 cld
Jan Beulichcdc17932007-07-21 17:10:20 +0200152 SAVE_ARGS 0,0,1
Linus Torvalds1da177e2005-04-16 15:20:36 -0700153 /* no need to do an access_ok check here because rbp has been
154 32bit zero extended */
Jan Beulich295286a2008-08-29 13:21:11 +01001551: movl (%rbp),%ebp
Linus Torvalds1da177e2005-04-16 15:20:36 -0700156 .section __ex_table,"a"
157 .quad 1b,ia32_badarg
158 .previous
159 GET_THREAD_INFO(%r10)
Glauber Costa26ccb8a2008-06-24 11:19:35 -0300160 orl $TS_COMPAT,TI_status(%r10)
Roland McGrathd4d67152008-07-09 02:38:07 -0700161 testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10)
Jan Beulich7effaa82005-09-12 18:49:24 +0200162 CFI_REMEMBER_STATE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700163 jnz sysenter_tracesys
H. Peter Anvin36d001c2010-09-14 12:42:41 -0700164 cmpq $(IA32_NR_syscalls-1),%rax
Andi Kleen67d53ea2006-04-07 19:50:31 +0200165 ja ia32_badsys
Roland McGrathd4d67152008-07-09 02:38:07 -0700166sysenter_do_call:
Jan Beulich295286a2008-08-29 13:21:11 +0100167 IA32_ARG_FIXUP
Roland McGrath5cbf1562008-06-24 01:13:31 -0700168sysenter_dispatch:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700169 call *ia32_sys_call_table(,%rax,8)
170 movq %rax,RAX-ARGOFFSET(%rsp)
171 GET_THREAD_INFO(%r10)
Jeremy Fitzhardinge66804152008-06-25 00:19:29 -0400172 DISABLE_INTERRUPTS(CLBR_NONE)
Ingo Molnar2601e642006-07-03 00:24:45 -0700173 TRACE_IRQS_OFF
Glauber Costa26ccb8a2008-06-24 11:19:35 -0300174 testl $_TIF_ALLWORK_MASK,TI_flags(%r10)
Roland McGrath5cbf1562008-06-24 01:13:31 -0700175 jnz sysexit_audit
176sysexit_from_sys_call:
Glauber Costa26ccb8a2008-06-24 11:19:35 -0300177 andl $~TS_COMPAT,TI_status(%r10)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700178 /* clear IF, that popfq doesn't enable interrupts early */
179 andl $~0x200,EFLAGS-R11(%rsp)
Roland McGrath36197c92008-01-30 13:30:43 +0100180 movl RIP-R11(%rsp),%edx /* User %eip */
181 CFI_REGISTER rip,rdx
Linus Torvalds1da177e2005-04-16 15:20:36 -0700182 RESTORE_ARGS 1,24,1,1,1,1
Jan Beulich24e35802009-09-30 11:22:11 +0100183 xorq %r8,%r8
184 xorq %r9,%r9
185 xorq %r10,%r10
186 xorq %r11,%r11
Linus Torvalds1da177e2005-04-16 15:20:36 -0700187 popfq
Jan Beulich7effaa82005-09-12 18:49:24 +0200188 CFI_ADJUST_CFA_OFFSET -8
189 /*CFI_RESTORE rflags*/
Linus Torvalds1da177e2005-04-16 15:20:36 -0700190 popq %rcx /* User %esp */
Jan Beulich7effaa82005-09-12 18:49:24 +0200191 CFI_ADJUST_CFA_OFFSET -8
192 CFI_REGISTER rsp,rcx
Ingo Molnar2601e642006-07-03 00:24:45 -0700193 TRACE_IRQS_ON
Jeremy Fitzhardinge2be29982008-06-25 00:19:28 -0400194 ENABLE_INTERRUPTS_SYSEXIT32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700195
Roland McGrath5cbf1562008-06-24 01:13:31 -0700196#ifdef CONFIG_AUDITSYSCALL
197 .macro auditsys_entry_common
198 movl %esi,%r9d /* 6th arg: 4th syscall arg */
199 movl %edx,%r8d /* 5th arg: 3rd syscall arg */
200 /* (already in %ecx) 4th arg: 2nd syscall arg */
201 movl %ebx,%edx /* 3rd arg: 1st syscall arg */
202 movl %eax,%esi /* 2nd arg: syscall number */
203 movl $AUDIT_ARCH_I386,%edi /* 1st arg: audit arch */
204 call audit_syscall_entry
205 movl RAX-ARGOFFSET(%rsp),%eax /* reload syscall number */
H. Peter Anvin36d001c2010-09-14 12:42:41 -0700206 cmpq $(IA32_NR_syscalls-1),%rax
Roland McGrath5cbf1562008-06-24 01:13:31 -0700207 ja ia32_badsys
208 movl %ebx,%edi /* reload 1st syscall arg */
209 movl RCX-ARGOFFSET(%rsp),%esi /* reload 2nd syscall arg */
210 movl RDX-ARGOFFSET(%rsp),%edx /* reload 3rd syscall arg */
211 movl RSI-ARGOFFSET(%rsp),%ecx /* reload 4th syscall arg */
212 movl RDI-ARGOFFSET(%rsp),%r8d /* reload 5th syscall arg */
213 .endm
214
Jan Beulich81766742009-10-26 15:20:29 +0000215 .macro auditsys_exit exit
Roland McGrath5cbf1562008-06-24 01:13:31 -0700216 testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10)
Jan Beulich24e35802009-09-30 11:22:11 +0100217 jnz ia32_ret_from_sys_call
Roland McGrath5cbf1562008-06-24 01:13:31 -0700218 TRACE_IRQS_ON
219 sti
220 movl %eax,%esi /* second arg, syscall return value */
221 cmpl $0,%eax /* is it < 0? */
222 setl %al /* 1 if so, 0 if not */
223 movzbl %al,%edi /* zero-extend that into %edi */
224 inc %edi /* first arg, 0->1(AUDITSC_SUCCESS), 1->2(AUDITSC_FAILURE) */
225 call audit_syscall_exit
226 GET_THREAD_INFO(%r10)
227 movl RAX-ARGOFFSET(%rsp),%eax /* reload syscall return value */
Roland McGrath5cbf1562008-06-24 01:13:31 -0700228 movl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),%edi
229 cli
230 TRACE_IRQS_OFF
231 testl %edi,TI_flags(%r10)
Jan Beulich24e35802009-09-30 11:22:11 +0100232 jz \exit
233 CLEAR_RREGS -ARGOFFSET
234 jmp int_with_check
Roland McGrath5cbf1562008-06-24 01:13:31 -0700235 .endm
236
237sysenter_auditsys:
Jan Beulich7effaa82005-09-12 18:49:24 +0200238 CFI_RESTORE_STATE
Roland McGrath5cbf1562008-06-24 01:13:31 -0700239 auditsys_entry_common
240 movl %ebp,%r9d /* reload 6th syscall arg */
241 jmp sysenter_dispatch
242
243sysexit_audit:
244 auditsys_exit sysexit_from_sys_call
245#endif
246
247sysenter_tracesys:
Roland McGrath5cbf1562008-06-24 01:13:31 -0700248#ifdef CONFIG_AUDITSYSCALL
249 testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10)
250 jz sysenter_auditsys
251#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700252 SAVE_REST
253 CLEAR_RREGS
Roland McGrath48ee6792008-03-18 18:23:50 -0700254 movq $-ENOSYS,RAX(%rsp)/* ptrace can change this for a bad syscall */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700255 movq %rsp,%rdi /* &pt_regs -> arg1 */
256 call syscall_trace_enter
Andi Kleen176df242007-09-21 16:16:18 +0200257 LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700258 RESTORE_REST
H. Peter Anvin36d001c2010-09-14 12:42:41 -0700259 cmpq $(IA32_NR_syscalls-1),%rax
Roland McGrath48ee6792008-03-18 18:23:50 -0700260 ja int_ret_from_sys_call /* sysenter_tracesys has set RAX(%rsp) */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700261 jmp sysenter_do_call
262 CFI_ENDPROC
Jan Beulich4b787e02006-06-26 13:56:55 +0200263ENDPROC(ia32_sysenter_target)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700264
265/*
266 * 32bit SYSCALL instruction entry.
267 *
268 * Arguments:
269 * %eax System call number.
270 * %ebx Arg1
271 * %ecx return EIP
272 * %edx Arg3
273 * %esi Arg4
274 * %edi Arg5
275 * %ebp Arg2 [note: not saved in the stack frame, should not be touched]
276 * %esp user stack
277 * 0(%esp) Arg6
278 *
279 * Interrupts off.
280 *
281 * This is purely a fast path. For anything complicated we use the int 0x80
282 * path below. Set up a complete hardware stack frame to share code
283 * with the int 0x80 path.
284 */
285ENTRY(ia32_cstar_target)
Jan Beulich27651302006-01-11 22:41:59 +0100286 CFI_STARTPROC32 simple
Jan Beulichadf14232006-09-26 10:52:41 +0200287 CFI_SIGNAL_FRAME
Brian Gerst9af45652009-01-19 00:38:58 +0900288 CFI_DEF_CFA rsp,KERNEL_STACK_OFFSET
Jan Beulich7effaa82005-09-12 18:49:24 +0200289 CFI_REGISTER rip,rcx
290 /*CFI_REGISTER rflags,r11*/
Jeremy Fitzhardinge457da702008-06-26 07:28:51 -0700291 SWAPGS_UNSAFE_STACK
Linus Torvalds1da177e2005-04-16 15:20:36 -0700292 movl %esp,%r8d
Jan Beulich7effaa82005-09-12 18:49:24 +0200293 CFI_REGISTER rsp,r8
Brian Gerst9af45652009-01-19 00:38:58 +0900294 movq PER_CPU_VAR(kernel_stack),%rsp
Ingo Molnar2601e642006-07-03 00:24:45 -0700295 /*
296 * No need to follow this irqs on/off section: the syscall
297 * disabled irqs and here we enable it straight after entry:
298 */
Jeremy Fitzhardinge66804152008-06-25 00:19:29 -0400299 ENABLE_INTERRUPTS(CLBR_NONE)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700300 SAVE_ARGS 8,1,1
301 movl %eax,%eax /* zero extension */
302 movq %rax,ORIG_RAX-ARGOFFSET(%rsp)
303 movq %rcx,RIP-ARGOFFSET(%rsp)
Jan Beulich7effaa82005-09-12 18:49:24 +0200304 CFI_REL_OFFSET rip,RIP-ARGOFFSET
Linus Torvalds1da177e2005-04-16 15:20:36 -0700305 movq %rbp,RCX-ARGOFFSET(%rsp) /* this lies slightly to ptrace */
306 movl %ebp,%ecx
307 movq $__USER32_CS,CS-ARGOFFSET(%rsp)
308 movq $__USER32_DS,SS-ARGOFFSET(%rsp)
309 movq %r11,EFLAGS-ARGOFFSET(%rsp)
Jan Beulich7effaa82005-09-12 18:49:24 +0200310 /*CFI_REL_OFFSET rflags,EFLAGS-ARGOFFSET*/
Linus Torvalds1da177e2005-04-16 15:20:36 -0700311 movq %r8,RSP-ARGOFFSET(%rsp)
Jan Beulich7effaa82005-09-12 18:49:24 +0200312 CFI_REL_OFFSET rsp,RSP-ARGOFFSET
Linus Torvalds1da177e2005-04-16 15:20:36 -0700313 /* no need to do an access_ok check here because r8 has been
314 32bit zero extended */
315 /* hardware stack frame is complete now */
3161: movl (%r8),%r9d
317 .section __ex_table,"a"
318 .quad 1b,ia32_badarg
319 .previous
320 GET_THREAD_INFO(%r10)
Glauber Costa26ccb8a2008-06-24 11:19:35 -0300321 orl $TS_COMPAT,TI_status(%r10)
Roland McGrathd4d67152008-07-09 02:38:07 -0700322 testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10)
Jan Beulich7effaa82005-09-12 18:49:24 +0200323 CFI_REMEMBER_STATE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700324 jnz cstar_tracesys
H. Peter Anvin36d001c2010-09-14 12:42:41 -0700325 cmpq $IA32_NR_syscalls-1,%rax
Andi Kleen67d53ea2006-04-07 19:50:31 +0200326 ja ia32_badsys
Jan Beulich295286a2008-08-29 13:21:11 +0100327cstar_do_call:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700328 IA32_ARG_FIXUP 1
Roland McGrath5cbf1562008-06-24 01:13:31 -0700329cstar_dispatch:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700330 call *ia32_sys_call_table(,%rax,8)
331 movq %rax,RAX-ARGOFFSET(%rsp)
332 GET_THREAD_INFO(%r10)
Jeremy Fitzhardinge66804152008-06-25 00:19:29 -0400333 DISABLE_INTERRUPTS(CLBR_NONE)
Ingo Molnar2601e642006-07-03 00:24:45 -0700334 TRACE_IRQS_OFF
Glauber Costa26ccb8a2008-06-24 11:19:35 -0300335 testl $_TIF_ALLWORK_MASK,TI_flags(%r10)
Roland McGrath5cbf1562008-06-24 01:13:31 -0700336 jnz sysretl_audit
337sysretl_from_sys_call:
Glauber Costa26ccb8a2008-06-24 11:19:35 -0300338 andl $~TS_COMPAT,TI_status(%r10)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700339 RESTORE_ARGS 1,-ARG_SKIP,1,1,1
340 movl RIP-ARGOFFSET(%rsp),%ecx
Jan Beulich7effaa82005-09-12 18:49:24 +0200341 CFI_REGISTER rip,rcx
Linus Torvalds1da177e2005-04-16 15:20:36 -0700342 movl EFLAGS-ARGOFFSET(%rsp),%r11d
Jan Beulich7effaa82005-09-12 18:49:24 +0200343 /*CFI_REGISTER rflags,r11*/
Jan Beulich24e35802009-09-30 11:22:11 +0100344 xorq %r10,%r10
345 xorq %r9,%r9
346 xorq %r8,%r8
Ingo Molnar2601e642006-07-03 00:24:45 -0700347 TRACE_IRQS_ON
Linus Torvalds1da177e2005-04-16 15:20:36 -0700348 movl RSP-ARGOFFSET(%rsp),%esp
Jan Beulich7effaa82005-09-12 18:49:24 +0200349 CFI_RESTORE rsp
Jeremy Fitzhardinge2be29982008-06-25 00:19:28 -0400350 USERGS_SYSRET32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700351
Roland McGrath5cbf1562008-06-24 01:13:31 -0700352#ifdef CONFIG_AUDITSYSCALL
353cstar_auditsys:
Jan Beulich7effaa82005-09-12 18:49:24 +0200354 CFI_RESTORE_STATE
Roland McGrath5cbf1562008-06-24 01:13:31 -0700355 movl %r9d,R9-ARGOFFSET(%rsp) /* register to be clobbered by call */
356 auditsys_entry_common
357 movl R9-ARGOFFSET(%rsp),%r9d /* reload 6th syscall arg */
358 jmp cstar_dispatch
359
360sysretl_audit:
Jan Beulich81766742009-10-26 15:20:29 +0000361 auditsys_exit sysretl_from_sys_call
Roland McGrath5cbf1562008-06-24 01:13:31 -0700362#endif
363
364cstar_tracesys:
365#ifdef CONFIG_AUDITSYSCALL
366 testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10)
367 jz cstar_auditsys
368#endif
Chuck Ebbertecd744e2007-11-07 10:48:39 -0500369 xchgl %r9d,%ebp
Linus Torvalds1da177e2005-04-16 15:20:36 -0700370 SAVE_REST
Jan Beulich24e35802009-09-30 11:22:11 +0100371 CLEAR_RREGS 0, r9
Roland McGrath48ee6792008-03-18 18:23:50 -0700372 movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700373 movq %rsp,%rdi /* &pt_regs -> arg1 */
374 call syscall_trace_enter
Jan Beulich295286a2008-08-29 13:21:11 +0100375 LOAD_ARGS32 ARGOFFSET, 1 /* reload args from stack in case ptrace changed it */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700376 RESTORE_REST
Chuck Ebbertecd744e2007-11-07 10:48:39 -0500377 xchgl %ebp,%r9d
H. Peter Anvin36d001c2010-09-14 12:42:41 -0700378 cmpq $(IA32_NR_syscalls-1),%rax
Roland McGrath48ee6792008-03-18 18:23:50 -0700379 ja int_ret_from_sys_call /* cstar_tracesys has set RAX(%rsp) */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700380 jmp cstar_do_call
Jan Beulich4b787e02006-06-26 13:56:55 +0200381END(ia32_cstar_target)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700382
383ia32_badarg:
384 movq $-EFAULT,%rax
385 jmp ia32_sysret
386 CFI_ENDPROC
387
388/*
389 * Emulated IA32 system calls via int 0x80.
390 *
391 * Arguments:
392 * %eax System call number.
393 * %ebx Arg1
394 * %ecx Arg2
395 * %edx Arg3
396 * %esi Arg4
397 * %edi Arg5
398 * %ebp Arg6 [note: not saved in the stack frame, should not be touched]
399 *
400 * Notes:
401 * Uses the same stack frame as the x86-64 version.
402 * All registers except %eax must be saved (but ptrace may violate that)
403 * Arguments are zero extended. For system calls that want sign extension and
404 * take long arguments a wrapper is needed. Most calls can just be called
405 * directly.
406 * Assumes it is only called from user space and entered with interrupts off.
407 */
408
409ENTRY(ia32_syscall)
Jan Beulichcdc17932007-07-21 17:10:20 +0200410 CFI_STARTPROC32 simple
Jan Beulichadf14232006-09-26 10:52:41 +0200411 CFI_SIGNAL_FRAME
Jan Beulich7effaa82005-09-12 18:49:24 +0200412 CFI_DEF_CFA rsp,SS+8-RIP
413 /*CFI_REL_OFFSET ss,SS-RIP*/
414 CFI_REL_OFFSET rsp,RSP-RIP
415 /*CFI_REL_OFFSET rflags,EFLAGS-RIP*/
416 /*CFI_REL_OFFSET cs,CS-RIP*/
417 CFI_REL_OFFSET rip,RIP-RIP
Jeremy Fitzhardinge360c0442008-07-08 15:06:28 -0700418 PARAVIRT_ADJUST_EXCEPTION_FRAME
Jeremy Fitzhardinge66804152008-06-25 00:19:29 -0400419 SWAPGS
Ingo Molnar2601e642006-07-03 00:24:45 -0700420 /*
421 * No need to follow this irqs on/off section: the syscall
422 * disabled irqs and here we enable it straight after entry:
423 */
Jeremy Fitzhardinge66804152008-06-25 00:19:29 -0400424 ENABLE_INTERRUPTS(CLBR_NONE)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700425 movl %eax,%eax
426 pushq %rax
Jan Beulich7effaa82005-09-12 18:49:24 +0200427 CFI_ADJUST_CFA_OFFSET 8
Linus Torvalds1da177e2005-04-16 15:20:36 -0700428 cld
429 /* note the registers are not zero extended to the sf.
430 this could be a problem. */
431 SAVE_ARGS 0,0,1
432 GET_THREAD_INFO(%r10)
Glauber Costa26ccb8a2008-06-24 11:19:35 -0300433 orl $TS_COMPAT,TI_status(%r10)
Roland McGrathd4d67152008-07-09 02:38:07 -0700434 testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700435 jnz ia32_tracesys
H. Peter Anvin36d001c2010-09-14 12:42:41 -0700436 cmpq $(IA32_NR_syscalls-1),%rax
Roland McGrathc09249f2009-02-06 18:15:18 -0800437 ja ia32_badsys
438ia32_do_call:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700439 IA32_ARG_FIXUP
440 call *ia32_sys_call_table(,%rax,8) # xxx: rip relative
441ia32_sysret:
442 movq %rax,RAX-ARGOFFSET(%rsp)
Jan Beulich24e35802009-09-30 11:22:11 +0100443ia32_ret_from_sys_call:
444 CLEAR_RREGS -ARGOFFSET
Linus Torvalds1da177e2005-04-16 15:20:36 -0700445 jmp int_ret_from_sys_call
446
447ia32_tracesys:
448 SAVE_REST
Jan Beulichcdc17932007-07-21 17:10:20 +0200449 CLEAR_RREGS
Roland McGrath8ab32bb2008-03-16 21:57:41 -0700450 movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700451 movq %rsp,%rdi /* &pt_regs -> arg1 */
452 call syscall_trace_enter
Andi Kleen176df242007-09-21 16:16:18 +0200453 LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700454 RESTORE_REST
H. Peter Anvin36d001c2010-09-14 12:42:41 -0700455 cmpq $(IA32_NR_syscalls-1),%rax
Roland McGrathc09249f2009-02-06 18:15:18 -0800456 ja int_ret_from_sys_call /* ia32_tracesys has set RAX(%rsp) */
457 jmp ia32_do_call
Jan Beulich4b787e02006-06-26 13:56:55 +0200458END(ia32_syscall)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700459
460ia32_badsys:
461 movq $0,ORIG_RAX-ARGOFFSET(%rsp)
Jan Beulich24e35802009-09-30 11:22:11 +0100462 movq $-ENOSYS,%rax
463 jmp ia32_sysret
Linus Torvalds1da177e2005-04-16 15:20:36 -0700464
Linus Torvalds1da177e2005-04-16 15:20:36 -0700465quiet_ni_syscall:
466 movq $-ENOSYS,%rax
467 ret
468 CFI_ENDPROC
469
470 .macro PTREGSCALL label, func, arg
471 .globl \label
472\label:
473 leaq \func(%rip),%rax
474 leaq -ARGOFFSET+8(%rsp),\arg /* 8 for return address */
475 jmp ia32_ptregs_common
476 .endm
477
Jan Beulich27651302006-01-11 22:41:59 +0100478 CFI_STARTPROC32
Jan Beulich7effaa82005-09-12 18:49:24 +0200479
Linus Torvalds1da177e2005-04-16 15:20:36 -0700480 PTREGSCALL stub32_rt_sigreturn, sys32_rt_sigreturn, %rdi
481 PTREGSCALL stub32_sigreturn, sys32_sigreturn, %rdi
482 PTREGSCALL stub32_sigaltstack, sys32_sigaltstack, %rdx
Linus Torvalds1da177e2005-04-16 15:20:36 -0700483 PTREGSCALL stub32_execve, sys32_execve, %rcx
484 PTREGSCALL stub32_fork, sys_fork, %rdi
485 PTREGSCALL stub32_clone, sys32_clone, %rdx
486 PTREGSCALL stub32_vfork, sys_vfork, %rdi
487 PTREGSCALL stub32_iopl, sys_iopl, %rsi
Linus Torvalds1da177e2005-04-16 15:20:36 -0700488
489ENTRY(ia32_ptregs_common)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700490 popq %r11
Jan Beulich27651302006-01-11 22:41:59 +0100491 CFI_ENDPROC
492 CFI_STARTPROC32 simple
Jan Beulichadf14232006-09-26 10:52:41 +0200493 CFI_SIGNAL_FRAME
Jan Beulich27651302006-01-11 22:41:59 +0100494 CFI_DEF_CFA rsp,SS+8-ARGOFFSET
495 CFI_REL_OFFSET rax,RAX-ARGOFFSET
496 CFI_REL_OFFSET rcx,RCX-ARGOFFSET
497 CFI_REL_OFFSET rdx,RDX-ARGOFFSET
498 CFI_REL_OFFSET rsi,RSI-ARGOFFSET
499 CFI_REL_OFFSET rdi,RDI-ARGOFFSET
500 CFI_REL_OFFSET rip,RIP-ARGOFFSET
501/* CFI_REL_OFFSET cs,CS-ARGOFFSET*/
502/* CFI_REL_OFFSET rflags,EFLAGS-ARGOFFSET*/
503 CFI_REL_OFFSET rsp,RSP-ARGOFFSET
504/* CFI_REL_OFFSET ss,SS-ARGOFFSET*/
Linus Torvalds1da177e2005-04-16 15:20:36 -0700505 SAVE_REST
506 call *%rax
507 RESTORE_REST
508 jmp ia32_sysret /* misbalances the return cache */
509 CFI_ENDPROC
Jan Beulich4b787e02006-06-26 13:56:55 +0200510END(ia32_ptregs_common)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700511
Arjan van de Venbb152f52006-01-06 00:12:05 -0800512 .section .rodata,"a"
Linus Torvalds1da177e2005-04-16 15:20:36 -0700513 .align 8
Linus Torvalds1da177e2005-04-16 15:20:36 -0700514ia32_sys_call_table:
515 .quad sys_restart_syscall
516 .quad sys_exit
517 .quad stub32_fork
518 .quad sys_read
519 .quad sys_write
Miklos Szeredie922efc2005-09-06 15:18:25 -0700520 .quad compat_sys_open /* 5 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700521 .quad sys_close
522 .quad sys32_waitpid
523 .quad sys_creat
524 .quad sys_link
525 .quad sys_unlink /* 10 */
526 .quad stub32_execve
527 .quad sys_chdir
528 .quad compat_sys_time
529 .quad sys_mknod
530 .quad sys_chmod /* 15 */
531 .quad sys_lchown16
532 .quad quiet_ni_syscall /* old break syscall holder */
533 .quad sys_stat
534 .quad sys32_lseek
535 .quad sys_getpid /* 20 */
536 .quad compat_sys_mount /* mount */
537 .quad sys_oldumount /* old_umount */
538 .quad sys_setuid16
539 .quad sys_getuid16
540 .quad compat_sys_stime /* stime */ /* 25 */
Roland McGrath562b80b2008-04-22 12:21:25 -0700541 .quad compat_sys_ptrace /* ptrace */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700542 .quad sys_alarm
543 .quad sys_fstat /* (old)fstat */
544 .quad sys_pause
545 .quad compat_sys_utime /* 30 */
546 .quad quiet_ni_syscall /* old stty syscall holder */
547 .quad quiet_ni_syscall /* old gtty syscall holder */
548 .quad sys_access
549 .quad sys_nice
550 .quad quiet_ni_syscall /* 35 */ /* old ftime syscall holder */
551 .quad sys_sync
552 .quad sys32_kill
553 .quad sys_rename
554 .quad sys_mkdir
555 .quad sys_rmdir /* 40 */
556 .quad sys_dup
Amerigo Wang4c711572009-08-06 15:58:12 -0700557 .quad sys_pipe
Linus Torvalds1da177e2005-04-16 15:20:36 -0700558 .quad compat_sys_times
559 .quad quiet_ni_syscall /* old prof syscall holder */
560 .quad sys_brk /* 45 */
561 .quad sys_setgid16
562 .quad sys_getgid16
563 .quad sys_signal
564 .quad sys_geteuid16
565 .quad sys_getegid16 /* 50 */
566 .quad sys_acct
567 .quad sys_umount /* new_umount */
568 .quad quiet_ni_syscall /* old lock syscall holder */
569 .quad compat_sys_ioctl
570 .quad compat_sys_fcntl64 /* 55 */
571 .quad quiet_ni_syscall /* old mpx syscall holder */
572 .quad sys_setpgid
573 .quad quiet_ni_syscall /* old ulimit syscall holder */
Christoph Hellwig5cacdb42010-03-10 15:21:21 -0800574 .quad sys_olduname
Linus Torvalds1da177e2005-04-16 15:20:36 -0700575 .quad sys_umask /* 60 */
576 .quad sys_chroot
Christoph Hellwig2b1c6bd2008-11-28 10:09:09 +0100577 .quad compat_sys_ustat
Linus Torvalds1da177e2005-04-16 15:20:36 -0700578 .quad sys_dup2
579 .quad sys_getppid
580 .quad sys_getpgrp /* 65 */
581 .quad sys_setsid
582 .quad sys32_sigaction
583 .quad sys_sgetmask
584 .quad sys_ssetmask
585 .quad sys_setreuid16 /* 70 */
586 .quad sys_setregid16
Jan Beulich5f0120b2008-06-18 12:42:11 +0100587 .quad sys32_sigsuspend
Linus Torvalds1da177e2005-04-16 15:20:36 -0700588 .quad compat_sys_sigpending
589 .quad sys_sethostname
590 .quad compat_sys_setrlimit /* 75 */
591 .quad compat_sys_old_getrlimit /* old_getrlimit */
592 .quad compat_sys_getrusage
Christoph Hellwigb418da12008-10-15 22:02:06 -0700593 .quad compat_sys_gettimeofday
594 .quad compat_sys_settimeofday
Linus Torvalds1da177e2005-04-16 15:20:36 -0700595 .quad sys_getgroups16 /* 80 */
596 .quad sys_setgroups16
Christoph Hellwig5d0e5282010-03-10 15:21:13 -0800597 .quad compat_sys_old_select
Linus Torvalds1da177e2005-04-16 15:20:36 -0700598 .quad sys_symlink
599 .quad sys_lstat
600 .quad sys_readlink /* 85 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700601 .quad sys_uselib
Linus Torvalds1da177e2005-04-16 15:20:36 -0700602 .quad sys_swapon
603 .quad sys_reboot
604 .quad compat_sys_old_readdir
605 .quad sys32_mmap /* 90 */
606 .quad sys_munmap
607 .quad sys_truncate
608 .quad sys_ftruncate
609 .quad sys_fchmod
610 .quad sys_fchown16 /* 95 */
611 .quad sys_getpriority
612 .quad sys_setpriority
613 .quad quiet_ni_syscall /* old profil syscall holder */
614 .quad compat_sys_statfs
615 .quad compat_sys_fstatfs /* 100 */
616 .quad sys_ioperm
617 .quad compat_sys_socketcall
618 .quad sys_syslog
619 .quad compat_sys_setitimer
620 .quad compat_sys_getitimer /* 105 */
621 .quad compat_sys_newstat
622 .quad compat_sys_newlstat
623 .quad compat_sys_newfstat
Christoph Hellwig5cacdb42010-03-10 15:21:21 -0800624 .quad sys_uname
Linus Torvalds1da177e2005-04-16 15:20:36 -0700625 .quad stub32_iopl /* 110 */
626 .quad sys_vhangup
627 .quad quiet_ni_syscall /* old "idle" system call */
628 .quad sys32_vm86_warning /* vm86old */
629 .quad compat_sys_wait4
630 .quad sys_swapoff /* 115 */
Kyle McMartind4d23ad2007-02-10 01:46:00 -0800631 .quad compat_sys_sysinfo
Linus Torvalds1da177e2005-04-16 15:20:36 -0700632 .quad sys32_ipc
633 .quad sys_fsync
634 .quad stub32_sigreturn
635 .quad stub32_clone /* 120 */
636 .quad sys_setdomainname
Christoph Hellwig4cecd932010-04-20 05:31:02 +0200637 .quad sys_newuname
Linus Torvalds1da177e2005-04-16 15:20:36 -0700638 .quad sys_modify_ldt
Stephen Rothwell3158e942006-03-26 01:37:29 -0800639 .quad compat_sys_adjtimex
Linus Torvalds1da177e2005-04-16 15:20:36 -0700640 .quad sys32_mprotect /* 125 */
641 .quad compat_sys_sigprocmask
642 .quad quiet_ni_syscall /* create_module */
643 .quad sys_init_module
644 .quad sys_delete_module
645 .quad quiet_ni_syscall /* 130 get_kernel_syms */
Vasily Tarasovb7163952007-07-15 23:41:12 -0700646 .quad sys32_quotactl
Linus Torvalds1da177e2005-04-16 15:20:36 -0700647 .quad sys_getpgid
648 .quad sys_fchdir
649 .quad quiet_ni_syscall /* bdflush */
650 .quad sys_sysfs /* 135 */
651 .quad sys_personality
652 .quad quiet_ni_syscall /* for afs_syscall */
653 .quad sys_setfsuid16
654 .quad sys_setfsgid16
655 .quad sys_llseek /* 140 */
656 .quad compat_sys_getdents
657 .quad compat_sys_select
658 .quad sys_flock
659 .quad sys_msync
660 .quad compat_sys_readv /* 145 */
661 .quad compat_sys_writev
662 .quad sys_getsid
663 .quad sys_fdatasync
Eric W. Biedermanc3359fb2009-04-03 00:59:52 -0700664 .quad compat_sys_sysctl /* sysctl */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700665 .quad sys_mlock /* 150 */
666 .quad sys_munlock
667 .quad sys_mlockall
668 .quad sys_munlockall
669 .quad sys_sched_setparam
670 .quad sys_sched_getparam /* 155 */
671 .quad sys_sched_setscheduler
672 .quad sys_sched_getscheduler
673 .quad sys_sched_yield
674 .quad sys_sched_get_priority_max
675 .quad sys_sched_get_priority_min /* 160 */
Alexandr Andreeva9bc3bf2007-03-16 21:07:36 +0100676 .quad sys32_sched_rr_get_interval
Linus Torvalds1da177e2005-04-16 15:20:36 -0700677 .quad compat_sys_nanosleep
678 .quad sys_mremap
679 .quad sys_setresuid16
680 .quad sys_getresuid16 /* 165 */
681 .quad sys32_vm86_warning /* vm86 */
682 .quad quiet_ni_syscall /* query_module */
683 .quad sys_poll
684 .quad compat_sys_nfsservctl
685 .quad sys_setresgid16 /* 170 */
686 .quad sys_getresgid16
687 .quad sys_prctl
688 .quad stub32_rt_sigreturn
689 .quad sys32_rt_sigaction
690 .quad sys32_rt_sigprocmask /* 175 */
691 .quad sys32_rt_sigpending
692 .quad compat_sys_rt_sigtimedwait
693 .quad sys32_rt_sigqueueinfo
Jan Beulich5f0120b2008-06-18 12:42:11 +0100694 .quad sys_rt_sigsuspend
Linus Torvalds1da177e2005-04-16 15:20:36 -0700695 .quad sys32_pread /* 180 */
696 .quad sys32_pwrite
697 .quad sys_chown16
698 .quad sys_getcwd
699 .quad sys_capget
700 .quad sys_capset
701 .quad stub32_sigaltstack
702 .quad sys32_sendfile
703 .quad quiet_ni_syscall /* streams1 */
704 .quad quiet_ni_syscall /* streams2 */
705 .quad stub32_vfork /* 190 */
706 .quad compat_sys_getrlimit
Al Virof8b72562009-11-30 17:37:04 -0500707 .quad sys_mmap_pgoff
Linus Torvalds1da177e2005-04-16 15:20:36 -0700708 .quad sys32_truncate64
709 .quad sys32_ftruncate64
710 .quad sys32_stat64 /* 195 */
711 .quad sys32_lstat64
712 .quad sys32_fstat64
713 .quad sys_lchown
714 .quad sys_getuid
715 .quad sys_getgid /* 200 */
716 .quad sys_geteuid
717 .quad sys_getegid
718 .quad sys_setreuid
719 .quad sys_setregid
720 .quad sys_getgroups /* 205 */
721 .quad sys_setgroups
722 .quad sys_fchown
723 .quad sys_setresuid
724 .quad sys_getresuid
725 .quad sys_setresgid /* 210 */
726 .quad sys_getresgid
727 .quad sys_chown
728 .quad sys_setuid
729 .quad sys_setgid
730 .quad sys_setfsuid /* 215 */
731 .quad sys_setfsgid
732 .quad sys_pivot_root
733 .quad sys_mincore
734 .quad sys_madvise
735 .quad compat_sys_getdents64 /* 220 getdents64 */
736 .quad compat_sys_fcntl64
737 .quad quiet_ni_syscall /* tux */
738 .quad quiet_ni_syscall /* security */
739 .quad sys_gettid
Andi Kleene412ac42007-06-20 12:23:30 +0200740 .quad sys32_readahead /* 225 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700741 .quad sys_setxattr
742 .quad sys_lsetxattr
743 .quad sys_fsetxattr
744 .quad sys_getxattr
745 .quad sys_lgetxattr /* 230 */
746 .quad sys_fgetxattr
747 .quad sys_listxattr
748 .quad sys_llistxattr
749 .quad sys_flistxattr
750 .quad sys_removexattr /* 235 */
751 .quad sys_lremovexattr
752 .quad sys_fremovexattr
753 .quad sys_tkill
754 .quad sys_sendfile64
755 .quad compat_sys_futex /* 240 */
756 .quad compat_sys_sched_setaffinity
757 .quad compat_sys_sched_getaffinity
Roland McGrathefd1ca52008-01-30 13:30:46 +0100758 .quad sys_set_thread_area
759 .quad sys_get_thread_area
Linus Torvalds1da177e2005-04-16 15:20:36 -0700760 .quad compat_sys_io_setup /* 245 */
761 .quad sys_io_destroy
762 .quad compat_sys_io_getevents
763 .quad compat_sys_io_submit
764 .quad sys_io_cancel
Andi Kleene412ac42007-06-20 12:23:30 +0200765 .quad sys32_fadvise64 /* 250 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700766 .quad quiet_ni_syscall /* free_huge_pages */
767 .quad sys_exit_group
768 .quad sys32_lookup_dcookie
769 .quad sys_epoll_create
770 .quad sys_epoll_ctl /* 255 */
771 .quad sys_epoll_wait
772 .quad sys_remap_file_pages
773 .quad sys_set_tid_address
Christoph Hellwig3a0f69d2006-01-09 20:52:08 -0800774 .quad compat_sys_timer_create
Linus Torvalds1da177e2005-04-16 15:20:36 -0700775 .quad compat_sys_timer_settime /* 260 */
776 .quad compat_sys_timer_gettime
777 .quad sys_timer_getoverrun
778 .quad sys_timer_delete
779 .quad compat_sys_clock_settime
780 .quad compat_sys_clock_gettime /* 265 */
781 .quad compat_sys_clock_getres
782 .quad compat_sys_clock_nanosleep
783 .quad compat_sys_statfs64
784 .quad compat_sys_fstatfs64
785 .quad sys_tgkill /* 270 */
786 .quad compat_sys_utimes
787 .quad sys32_fadvise64_64
788 .quad quiet_ni_syscall /* sys_vserver */
789 .quad sys_mbind
790 .quad compat_sys_get_mempolicy /* 275 */
791 .quad sys_set_mempolicy
792 .quad compat_sys_mq_open
793 .quad sys_mq_unlink
794 .quad compat_sys_mq_timedsend
795 .quad compat_sys_mq_timedreceive /* 280 */
796 .quad compat_sys_mq_notify
797 .quad compat_sys_mq_getsetattr
Eric W. Biederman5234f5e2005-06-25 14:58:02 -0700798 .quad compat_sys_kexec_load /* reserved for kexec */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700799 .quad compat_sys_waitid
Robert Love725b38ab2005-07-25 15:19:29 -0400800 .quad quiet_ni_syscall /* 285: sys_altroot */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700801 .quad sys_add_key
802 .quad sys_request_key
803 .quad sys_keyctl
Robert Love725b38ab2005-07-25 15:19:29 -0400804 .quad sys_ioprio_set
805 .quad sys_ioprio_get /* 290 */
806 .quad sys_inotify_init
807 .quad sys_inotify_add_watch
808 .quad sys_inotify_rm_watch
Christoph Lameter39743882006-01-08 01:00:51 -0800809 .quad sys_migrate_pages
Ulrich Dreppera60fc512006-01-18 17:43:56 -0800810 .quad compat_sys_openat /* 295 */
811 .quad sys_mkdirat
812 .quad sys_mknodat
813 .quad sys_fchownat
Andrew Morton3833a702006-02-01 03:04:32 -0800814 .quad compat_sys_futimesat
Ulrich Dreppercff2b762006-02-11 17:55:47 -0800815 .quad sys32_fstatat /* 300 */
Ulrich Dreppera60fc512006-01-18 17:43:56 -0800816 .quad sys_unlinkat
817 .quad sys_renameat
818 .quad sys_linkat
819 .quad sys_symlinkat
820 .quad sys_readlinkat /* 305 */
821 .quad sys_fchmodat
822 .quad sys_faccessat
Andi Kleen957dc872006-09-26 10:52:27 +0200823 .quad compat_sys_pselect6
824 .quad compat_sys_ppoll
Andi Kleen4b88f092006-02-09 00:35:50 +0100825 .quad sys_unshare /* 310 */
Ingo Molnar8fdd6c62006-03-27 01:16:26 -0800826 .quad compat_sys_set_robust_list
827 .quad compat_sys_get_robust_list
Andi Kleenb8feb472006-04-07 19:50:34 +0200828 .quad sys_splice
Andi Kleene412ac42007-06-20 12:23:30 +0200829 .quad sys32_sync_file_range
Ulrich Drepper1c710c82007-05-08 00:33:25 -0700830 .quad sys_tee /* 315 */
Andi Kleend2610202006-05-01 12:15:48 -0700831 .quad compat_sys_vmsplice
Christoph Lameter1b2db9f2006-06-23 02:03:56 -0700832 .quad compat_sys_move_pages
Andi Kleen3cfc3482006-09-26 10:52:28 +0200833 .quad sys_getcpu
Ralf Baechle9af3cf02007-02-13 13:26:26 +0100834 .quad sys_epoll_pwait
Ulrich Drepper1c710c82007-05-08 00:33:25 -0700835 .quad compat_sys_utimensat /* 320 */
Heiko Carstensae7d5c82007-05-12 17:27:41 +0200836 .quad compat_sys_signalfd
Davide Libenzicb9282e2008-02-04 22:27:28 -0800837 .quad sys_timerfd_create
Davide Libenzifdb902b2007-05-10 22:23:20 -0700838 .quad sys_eventfd
Amit Arora97ac7352007-07-17 21:42:44 -0400839 .quad sys32_fallocate
Davide Libenzicb9282e2008-02-04 22:27:28 -0800840 .quad compat_sys_timerfd_settime /* 325 */
841 .quad compat_sys_timerfd_gettime
Ulrich Drepper9deb27b2008-07-23 21:29:24 -0700842 .quad compat_sys_signalfd4
Ulrich Drepperb087498e2008-07-23 21:29:25 -0700843 .quad sys_eventfd2
Ulrich Drepper9fe5ad92008-07-23 21:29:43 -0700844 .quad sys_epoll_create1
Ingo Molnar241771e2008-12-03 10:39:53 +0100845 .quad sys_dup3 /* 330 */
Ulrich Dreppered8cae82008-07-23 21:29:30 -0700846 .quad sys_pipe2
Ulrich Drepper40065532008-07-23 21:29:32 -0700847 .quad sys_inotify_init1
Gerd Hoffmannf3554f42009-04-02 16:59:23 -0700848 .quad compat_sys_preadv
849 .quad compat_sys_pwritev
Thomas Gleixner12d16112009-04-04 21:01:10 +0000850 .quad compat_sys_rt_tgsigqueueinfo /* 335 */
Ingo Molnarcdd6c482009-09-21 12:02:48 +0200851 .quad sys_perf_event_open
Arnaldo Carvalho de Meloa2e27252009-10-12 23:40:10 -0700852 .quad compat_sys_recvmmsg
Eric Paris11637e42009-12-17 21:24:25 -0500853 .quad sys_fanotify_init
Eric Parisbbaa4162009-12-17 21:24:26 -0500854 .quad sys32_fanotify_mark
Linus Torvalds8cbd84f2010-08-10 15:35:10 -0700855 .quad sys_prlimit64 /* 340 */
Aneesh Kumar K.V6aae5f22011-01-29 18:43:37 +0530856 .quad sys_name_to_handle_at
857 .quad compat_sys_open_by_handle_at
Heiko Carstensae7d5c82007-05-12 17:27:41 +0200858ia32_syscall_end: