blob: 64ced0b8f8fd822edf9d8ebdce56bfd83e6c513c [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>
Eric Parisd7e75282012-01-03 14:23:06 -050017#include <linux/err.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070018
Roland McGrath5cbf1562008-06-24 01:13:31 -070019/* Avoid __ASSEMBLER__'ifying <linux/audit.h> just for this. */
20#include <linux/elf-em.h>
21#define AUDIT_ARCH_I386 (EM_386|__AUDIT_ARCH_LE)
22#define __AUDIT_ARCH_LE 0x40000000
23
24#ifndef CONFIG_AUDITSYSCALL
Jan Beulich24e35802009-09-30 11:22:11 +010025#define sysexit_audit ia32_ret_from_sys_call
26#define sysretl_audit ia32_ret_from_sys_call
Roland McGrath5cbf1562008-06-24 01:13:31 -070027#endif
28
Jiri Olsaea714542011-03-07 19:10:39 +010029 .section .entry.text, "ax"
30
Andi Kleen67d53ea2006-04-07 19:50:31 +020031#define IA32_NR_syscalls ((ia32_syscall_end - ia32_sys_call_table)/8)
32
Linus Torvalds1da177e2005-04-16 15:20:36 -070033 .macro IA32_ARG_FIXUP noebp=0
34 movl %edi,%r8d
35 .if \noebp
36 .else
37 movl %ebp,%r9d
38 .endif
39 xchg %ecx,%esi
40 movl %ebx,%edi
41 movl %edx,%edx /* zero extension */
42 .endm
43
44 /* clobbers %eax */
Jan Beulich24e35802009-09-30 11:22:11 +010045 .macro CLEAR_RREGS offset=0, _r9=rax
Linus Torvalds1da177e2005-04-16 15:20:36 -070046 xorl %eax,%eax
Jan Beulich24e35802009-09-30 11:22:11 +010047 movq %rax,\offset+R11(%rsp)
48 movq %rax,\offset+R10(%rsp)
49 movq %\_r9,\offset+R9(%rsp)
50 movq %rax,\offset+R8(%rsp)
Linus Torvalds1da177e2005-04-16 15:20:36 -070051 .endm
52
Roland McGrathd4d67152008-07-09 02:38:07 -070053 /*
54 * Reload arg registers from stack in case ptrace changed them.
55 * We don't reload %eax because syscall_trace_enter() returned
Roland McGratheefdca02010-09-14 12:22:58 -070056 * the %rax value we should see. Instead, we just truncate that
57 * value to 32 bits again as we did on entry from user mode.
58 * If it's a new value set by user_regset during entry tracing,
59 * this matches the normal truncation of the user-mode value.
60 * If it's -1 to make us punt the syscall, then (u32)-1 is still
61 * an appropriately invalid value.
Roland McGrathd4d67152008-07-09 02:38:07 -070062 */
Jan Beulich295286a2008-08-29 13:21:11 +010063 .macro LOAD_ARGS32 offset, _r9=0
64 .if \_r9
Andi Kleen176df242007-09-21 16:16:18 +020065 movl \offset+16(%rsp),%r9d
Jan Beulich295286a2008-08-29 13:21:11 +010066 .endif
Andi Kleen176df242007-09-21 16:16:18 +020067 movl \offset+40(%rsp),%ecx
68 movl \offset+48(%rsp),%edx
69 movl \offset+56(%rsp),%esi
70 movl \offset+64(%rsp),%edi
Roland McGratheefdca02010-09-14 12:22:58 -070071 movl %eax,%eax /* zero extension */
Andi Kleen176df242007-09-21 16:16:18 +020072 .endm
73
Jan Beulich27651302006-01-11 22:41:59 +010074 .macro CFI_STARTPROC32 simple
75 CFI_STARTPROC \simple
76 CFI_UNDEFINED r8
77 CFI_UNDEFINED r9
78 CFI_UNDEFINED r10
79 CFI_UNDEFINED r11
80 CFI_UNDEFINED r12
81 CFI_UNDEFINED r13
82 CFI_UNDEFINED r14
83 CFI_UNDEFINED r15
84 .endm
85
Jeremy Fitzhardinge2be29982008-06-25 00:19:28 -040086#ifdef CONFIG_PARAVIRT
87ENTRY(native_usergs_sysret32)
88 swapgs
89 sysretl
90ENDPROC(native_usergs_sysret32)
91
92ENTRY(native_irq_enable_sysexit)
93 swapgs
94 sti
95 sysexit
96ENDPROC(native_irq_enable_sysexit)
97#endif
98
Linus Torvalds1da177e2005-04-16 15:20:36 -070099/*
100 * 32bit SYSENTER instruction entry.
101 *
102 * Arguments:
103 * %eax System call number.
104 * %ebx Arg1
105 * %ecx Arg2
106 * %edx Arg3
107 * %esi Arg4
108 * %edi Arg5
109 * %ebp user stack
110 * 0(%ebp) Arg6
111 *
112 * Interrupts off.
113 *
114 * This is purely a fast path. For anything complicated we use the int 0x80
115 * path below. Set up a complete hardware stack frame to share code
116 * with the int 0x80 path.
117 */
118ENTRY(ia32_sysenter_target)
Jan Beulich27651302006-01-11 22:41:59 +0100119 CFI_STARTPROC32 simple
Jan Beulichadf14232006-09-26 10:52:41 +0200120 CFI_SIGNAL_FRAME
Jan Beulich7effaa82005-09-12 18:49:24 +0200121 CFI_DEF_CFA rsp,0
122 CFI_REGISTER rsp,rbp
Jeremy Fitzhardinge457da702008-06-26 07:28:51 -0700123 SWAPGS_UNSAFE_STACK
Brian Gerst9af45652009-01-19 00:38:58 +0900124 movq PER_CPU_VAR(kernel_stack), %rsp
125 addq $(KERNEL_STACK_OFFSET),%rsp
Ingo Molnar2601e642006-07-03 00:24:45 -0700126 /*
127 * No need to follow this irqs on/off section: the syscall
128 * disabled irqs, here we enable it straight after entry:
129 */
Jeremy Fitzhardinge66804152008-06-25 00:19:29 -0400130 ENABLE_INTERRUPTS(CLBR_NONE)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700131 movl %ebp,%ebp /* zero extension */
Jan Beulich60cf6372011-02-28 15:54:40 +0000132 pushq_cfi $__USER32_DS
Jan Beulich7effaa82005-09-12 18:49:24 +0200133 /*CFI_REL_OFFSET ss,0*/
Jan Beulich60cf6372011-02-28 15:54:40 +0000134 pushq_cfi %rbp
Jan Beulich7effaa82005-09-12 18:49:24 +0200135 CFI_REL_OFFSET rsp,0
Jan Beulich60cf6372011-02-28 15:54:40 +0000136 pushfq_cfi
Jan Beulich7effaa82005-09-12 18:49:24 +0200137 /*CFI_REL_OFFSET rflags,0*/
Jan Beulich46db09d2011-11-29 11:17:45 +0000138 movl TI_sysenter_return+THREAD_INFO(%rsp,3*8-KERNEL_STACK_OFFSET),%r10d
Jan Beulich7effaa82005-09-12 18:49:24 +0200139 CFI_REGISTER rip,r10
Jan Beulich60cf6372011-02-28 15:54:40 +0000140 pushq_cfi $__USER32_CS
Jan Beulich7effaa82005-09-12 18:49:24 +0200141 /*CFI_REL_OFFSET cs,0*/
Linus Torvalds1da177e2005-04-16 15:20:36 -0700142 movl %eax, %eax
Jan Beulich60cf6372011-02-28 15:54:40 +0000143 pushq_cfi %r10
Jan Beulich7effaa82005-09-12 18:49:24 +0200144 CFI_REL_OFFSET rip,0
Jan Beulich60cf6372011-02-28 15:54:40 +0000145 pushq_cfi %rax
Linus Torvalds1da177e2005-04-16 15:20:36 -0700146 cld
Borislav Petkovcac0e0a2011-05-31 22:21:52 +0200147 SAVE_ARGS 0,1,0
Linus Torvalds1da177e2005-04-16 15:20:36 -0700148 /* no need to do an access_ok check here because rbp has been
149 32bit zero extended */
Jan Beulich295286a2008-08-29 13:21:11 +01001501: movl (%rbp),%ebp
Linus Torvalds1da177e2005-04-16 15:20:36 -0700151 .section __ex_table,"a"
152 .quad 1b,ia32_badarg
153 .previous
Jan Beulich46db09d2011-11-29 11:17:45 +0000154 orl $TS_COMPAT,TI_status+THREAD_INFO(%rsp,RIP-ARGOFFSET)
155 testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
Jan Beulich7effaa82005-09-12 18:49:24 +0200156 CFI_REMEMBER_STATE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700157 jnz sysenter_tracesys
H. Peter Anvin36d001c2010-09-14 12:42:41 -0700158 cmpq $(IA32_NR_syscalls-1),%rax
Andi Kleen67d53ea2006-04-07 19:50:31 +0200159 ja ia32_badsys
Roland McGrathd4d67152008-07-09 02:38:07 -0700160sysenter_do_call:
Jan Beulich295286a2008-08-29 13:21:11 +0100161 IA32_ARG_FIXUP
Roland McGrath5cbf1562008-06-24 01:13:31 -0700162sysenter_dispatch:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700163 call *ia32_sys_call_table(,%rax,8)
164 movq %rax,RAX-ARGOFFSET(%rsp)
Jeremy Fitzhardinge66804152008-06-25 00:19:29 -0400165 DISABLE_INTERRUPTS(CLBR_NONE)
Ingo Molnar2601e642006-07-03 00:24:45 -0700166 TRACE_IRQS_OFF
Jan Beulich46db09d2011-11-29 11:17:45 +0000167 testl $_TIF_ALLWORK_MASK,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
Roland McGrath5cbf1562008-06-24 01:13:31 -0700168 jnz sysexit_audit
169sysexit_from_sys_call:
Jan Beulich46db09d2011-11-29 11:17:45 +0000170 andl $~TS_COMPAT,TI_status+THREAD_INFO(%rsp,RIP-ARGOFFSET)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700171 /* clear IF, that popfq doesn't enable interrupts early */
172 andl $~0x200,EFLAGS-R11(%rsp)
Roland McGrath36197c92008-01-30 13:30:43 +0100173 movl RIP-R11(%rsp),%edx /* User %eip */
174 CFI_REGISTER rip,rdx
Borislav Petkov838feb42011-05-31 22:21:53 +0200175 RESTORE_ARGS 0,24,0,0,0,0
Jan Beulich24e35802009-09-30 11:22:11 +0100176 xorq %r8,%r8
177 xorq %r9,%r9
178 xorq %r10,%r10
179 xorq %r11,%r11
Jan Beulich60cf6372011-02-28 15:54:40 +0000180 popfq_cfi
Jan Beulich7effaa82005-09-12 18:49:24 +0200181 /*CFI_RESTORE rflags*/
Jan Beulich60cf6372011-02-28 15:54:40 +0000182 popq_cfi %rcx /* User %esp */
Jan Beulich7effaa82005-09-12 18:49:24 +0200183 CFI_REGISTER rsp,rcx
Ingo Molnar2601e642006-07-03 00:24:45 -0700184 TRACE_IRQS_ON
Jeremy Fitzhardinge2be29982008-06-25 00:19:28 -0400185 ENABLE_INTERRUPTS_SYSEXIT32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700186
Roland McGrath5cbf1562008-06-24 01:13:31 -0700187#ifdef CONFIG_AUDITSYSCALL
188 .macro auditsys_entry_common
189 movl %esi,%r9d /* 6th arg: 4th syscall arg */
190 movl %edx,%r8d /* 5th arg: 3rd syscall arg */
191 /* (already in %ecx) 4th arg: 2nd syscall arg */
192 movl %ebx,%edx /* 3rd arg: 1st syscall arg */
193 movl %eax,%esi /* 2nd arg: syscall number */
194 movl $AUDIT_ARCH_I386,%edi /* 1st arg: audit arch */
195 call audit_syscall_entry
196 movl RAX-ARGOFFSET(%rsp),%eax /* reload syscall number */
H. Peter Anvin36d001c2010-09-14 12:42:41 -0700197 cmpq $(IA32_NR_syscalls-1),%rax
Roland McGrath5cbf1562008-06-24 01:13:31 -0700198 ja ia32_badsys
199 movl %ebx,%edi /* reload 1st syscall arg */
200 movl RCX-ARGOFFSET(%rsp),%esi /* reload 2nd syscall arg */
201 movl RDX-ARGOFFSET(%rsp),%edx /* reload 3rd syscall arg */
202 movl RSI-ARGOFFSET(%rsp),%ecx /* reload 4th syscall arg */
203 movl RDI-ARGOFFSET(%rsp),%r8d /* reload 5th syscall arg */
204 .endm
205
Jan Beulich81766742009-10-26 15:20:29 +0000206 .macro auditsys_exit exit
Jan Beulich46db09d2011-11-29 11:17:45 +0000207 testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
Jan Beulich24e35802009-09-30 11:22:11 +0100208 jnz ia32_ret_from_sys_call
Roland McGrath5cbf1562008-06-24 01:13:31 -0700209 TRACE_IRQS_ON
210 sti
211 movl %eax,%esi /* second arg, syscall return value */
Eric Parisd7e75282012-01-03 14:23:06 -0500212 cmpl $-MAX_ERRNO,%eax /* is it an error ? */
213 setbe %al /* 1 if so, 0 if not */
Roland McGrath5cbf1562008-06-24 01:13:31 -0700214 movzbl %al,%edi /* zero-extend that into %edi */
Eric Parisd7e75282012-01-03 14:23:06 -0500215 call __audit_syscall_exit
216 movq RAX-ARGOFFSET(%rsp),%rax /* reload syscall return value */
Roland McGrath5cbf1562008-06-24 01:13:31 -0700217 movl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),%edi
218 cli
219 TRACE_IRQS_OFF
Jan Beulich46db09d2011-11-29 11:17:45 +0000220 testl %edi,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
Jan Beulich24e35802009-09-30 11:22:11 +0100221 jz \exit
222 CLEAR_RREGS -ARGOFFSET
223 jmp int_with_check
Roland McGrath5cbf1562008-06-24 01:13:31 -0700224 .endm
225
226sysenter_auditsys:
Jan Beulich7effaa82005-09-12 18:49:24 +0200227 CFI_RESTORE_STATE
Roland McGrath5cbf1562008-06-24 01:13:31 -0700228 auditsys_entry_common
229 movl %ebp,%r9d /* reload 6th syscall arg */
230 jmp sysenter_dispatch
231
232sysexit_audit:
233 auditsys_exit sysexit_from_sys_call
234#endif
235
236sysenter_tracesys:
Roland McGrath5cbf1562008-06-24 01:13:31 -0700237#ifdef CONFIG_AUDITSYSCALL
Jan Beulich46db09d2011-11-29 11:17:45 +0000238 testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
Roland McGrath5cbf1562008-06-24 01:13:31 -0700239 jz sysenter_auditsys
240#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700241 SAVE_REST
242 CLEAR_RREGS
Roland McGrath48ee6792008-03-18 18:23:50 -0700243 movq $-ENOSYS,RAX(%rsp)/* ptrace can change this for a bad syscall */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700244 movq %rsp,%rdi /* &pt_regs -> arg1 */
245 call syscall_trace_enter
Andi Kleen176df242007-09-21 16:16:18 +0200246 LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700247 RESTORE_REST
H. Peter Anvin36d001c2010-09-14 12:42:41 -0700248 cmpq $(IA32_NR_syscalls-1),%rax
Roland McGrath48ee6792008-03-18 18:23:50 -0700249 ja int_ret_from_sys_call /* sysenter_tracesys has set RAX(%rsp) */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700250 jmp sysenter_do_call
251 CFI_ENDPROC
Jan Beulich4b787e02006-06-26 13:56:55 +0200252ENDPROC(ia32_sysenter_target)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700253
254/*
255 * 32bit SYSCALL instruction entry.
256 *
257 * Arguments:
258 * %eax System call number.
259 * %ebx Arg1
260 * %ecx return EIP
261 * %edx Arg3
262 * %esi Arg4
263 * %edi Arg5
264 * %ebp Arg2 [note: not saved in the stack frame, should not be touched]
265 * %esp user stack
266 * 0(%esp) Arg6
267 *
268 * Interrupts off.
269 *
270 * This is purely a fast path. For anything complicated we use the int 0x80
271 * path below. Set up a complete hardware stack frame to share code
272 * with the int 0x80 path.
273 */
274ENTRY(ia32_cstar_target)
Jan Beulich27651302006-01-11 22:41:59 +0100275 CFI_STARTPROC32 simple
Jan Beulichadf14232006-09-26 10:52:41 +0200276 CFI_SIGNAL_FRAME
Brian Gerst9af45652009-01-19 00:38:58 +0900277 CFI_DEF_CFA rsp,KERNEL_STACK_OFFSET
Jan Beulich7effaa82005-09-12 18:49:24 +0200278 CFI_REGISTER rip,rcx
279 /*CFI_REGISTER rflags,r11*/
Jeremy Fitzhardinge457da702008-06-26 07:28:51 -0700280 SWAPGS_UNSAFE_STACK
Linus Torvalds1da177e2005-04-16 15:20:36 -0700281 movl %esp,%r8d
Jan Beulich7effaa82005-09-12 18:49:24 +0200282 CFI_REGISTER rsp,r8
Brian Gerst9af45652009-01-19 00:38:58 +0900283 movq PER_CPU_VAR(kernel_stack),%rsp
Ingo Molnar2601e642006-07-03 00:24:45 -0700284 /*
285 * No need to follow this irqs on/off section: the syscall
286 * disabled irqs and here we enable it straight after entry:
287 */
Jeremy Fitzhardinge66804152008-06-25 00:19:29 -0400288 ENABLE_INTERRUPTS(CLBR_NONE)
Borislav Petkovcac0e0a2011-05-31 22:21:52 +0200289 SAVE_ARGS 8,0,0
Linus Torvalds1da177e2005-04-16 15:20:36 -0700290 movl %eax,%eax /* zero extension */
291 movq %rax,ORIG_RAX-ARGOFFSET(%rsp)
292 movq %rcx,RIP-ARGOFFSET(%rsp)
Jan Beulich7effaa82005-09-12 18:49:24 +0200293 CFI_REL_OFFSET rip,RIP-ARGOFFSET
Linus Torvalds1da177e2005-04-16 15:20:36 -0700294 movq %rbp,RCX-ARGOFFSET(%rsp) /* this lies slightly to ptrace */
295 movl %ebp,%ecx
296 movq $__USER32_CS,CS-ARGOFFSET(%rsp)
297 movq $__USER32_DS,SS-ARGOFFSET(%rsp)
298 movq %r11,EFLAGS-ARGOFFSET(%rsp)
Jan Beulich7effaa82005-09-12 18:49:24 +0200299 /*CFI_REL_OFFSET rflags,EFLAGS-ARGOFFSET*/
Linus Torvalds1da177e2005-04-16 15:20:36 -0700300 movq %r8,RSP-ARGOFFSET(%rsp)
Jan Beulich7effaa82005-09-12 18:49:24 +0200301 CFI_REL_OFFSET rsp,RSP-ARGOFFSET
Linus Torvalds1da177e2005-04-16 15:20:36 -0700302 /* no need to do an access_ok check here because r8 has been
303 32bit zero extended */
304 /* hardware stack frame is complete now */
3051: movl (%r8),%r9d
306 .section __ex_table,"a"
307 .quad 1b,ia32_badarg
308 .previous
Jan Beulich46db09d2011-11-29 11:17:45 +0000309 orl $TS_COMPAT,TI_status+THREAD_INFO(%rsp,RIP-ARGOFFSET)
310 testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
Jan Beulich7effaa82005-09-12 18:49:24 +0200311 CFI_REMEMBER_STATE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700312 jnz cstar_tracesys
H. Peter Anvin36d001c2010-09-14 12:42:41 -0700313 cmpq $IA32_NR_syscalls-1,%rax
Andi Kleen67d53ea2006-04-07 19:50:31 +0200314 ja ia32_badsys
Jan Beulich295286a2008-08-29 13:21:11 +0100315cstar_do_call:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700316 IA32_ARG_FIXUP 1
Roland McGrath5cbf1562008-06-24 01:13:31 -0700317cstar_dispatch:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700318 call *ia32_sys_call_table(,%rax,8)
319 movq %rax,RAX-ARGOFFSET(%rsp)
Jeremy Fitzhardinge66804152008-06-25 00:19:29 -0400320 DISABLE_INTERRUPTS(CLBR_NONE)
Ingo Molnar2601e642006-07-03 00:24:45 -0700321 TRACE_IRQS_OFF
Jan Beulich46db09d2011-11-29 11:17:45 +0000322 testl $_TIF_ALLWORK_MASK,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
Roland McGrath5cbf1562008-06-24 01:13:31 -0700323 jnz sysretl_audit
324sysretl_from_sys_call:
Jan Beulich46db09d2011-11-29 11:17:45 +0000325 andl $~TS_COMPAT,TI_status+THREAD_INFO(%rsp,RIP-ARGOFFSET)
Borislav Petkov838feb42011-05-31 22:21:53 +0200326 RESTORE_ARGS 0,-ARG_SKIP,0,0,0
Linus Torvalds1da177e2005-04-16 15:20:36 -0700327 movl RIP-ARGOFFSET(%rsp),%ecx
Jan Beulich7effaa82005-09-12 18:49:24 +0200328 CFI_REGISTER rip,rcx
Linus Torvalds1da177e2005-04-16 15:20:36 -0700329 movl EFLAGS-ARGOFFSET(%rsp),%r11d
Jan Beulich7effaa82005-09-12 18:49:24 +0200330 /*CFI_REGISTER rflags,r11*/
Jan Beulich24e35802009-09-30 11:22:11 +0100331 xorq %r10,%r10
332 xorq %r9,%r9
333 xorq %r8,%r8
Ingo Molnar2601e642006-07-03 00:24:45 -0700334 TRACE_IRQS_ON
Linus Torvalds1da177e2005-04-16 15:20:36 -0700335 movl RSP-ARGOFFSET(%rsp),%esp
Jan Beulich7effaa82005-09-12 18:49:24 +0200336 CFI_RESTORE rsp
Jeremy Fitzhardinge2be29982008-06-25 00:19:28 -0400337 USERGS_SYSRET32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700338
Roland McGrath5cbf1562008-06-24 01:13:31 -0700339#ifdef CONFIG_AUDITSYSCALL
340cstar_auditsys:
Jan Beulich7effaa82005-09-12 18:49:24 +0200341 CFI_RESTORE_STATE
Roland McGrath5cbf1562008-06-24 01:13:31 -0700342 movl %r9d,R9-ARGOFFSET(%rsp) /* register to be clobbered by call */
343 auditsys_entry_common
344 movl R9-ARGOFFSET(%rsp),%r9d /* reload 6th syscall arg */
345 jmp cstar_dispatch
346
347sysretl_audit:
Jan Beulich81766742009-10-26 15:20:29 +0000348 auditsys_exit sysretl_from_sys_call
Roland McGrath5cbf1562008-06-24 01:13:31 -0700349#endif
350
351cstar_tracesys:
352#ifdef CONFIG_AUDITSYSCALL
Jan Beulich46db09d2011-11-29 11:17:45 +0000353 testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
Roland McGrath5cbf1562008-06-24 01:13:31 -0700354 jz cstar_auditsys
355#endif
Chuck Ebbertecd744e2007-11-07 10:48:39 -0500356 xchgl %r9d,%ebp
Linus Torvalds1da177e2005-04-16 15:20:36 -0700357 SAVE_REST
Jan Beulich24e35802009-09-30 11:22:11 +0100358 CLEAR_RREGS 0, r9
Roland McGrath48ee6792008-03-18 18:23:50 -0700359 movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700360 movq %rsp,%rdi /* &pt_regs -> arg1 */
361 call syscall_trace_enter
Jan Beulich295286a2008-08-29 13:21:11 +0100362 LOAD_ARGS32 ARGOFFSET, 1 /* reload args from stack in case ptrace changed it */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700363 RESTORE_REST
Chuck Ebbertecd744e2007-11-07 10:48:39 -0500364 xchgl %ebp,%r9d
H. Peter Anvin36d001c2010-09-14 12:42:41 -0700365 cmpq $(IA32_NR_syscalls-1),%rax
Roland McGrath48ee6792008-03-18 18:23:50 -0700366 ja int_ret_from_sys_call /* cstar_tracesys has set RAX(%rsp) */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700367 jmp cstar_do_call
Jan Beulich4b787e02006-06-26 13:56:55 +0200368END(ia32_cstar_target)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700369
370ia32_badarg:
371 movq $-EFAULT,%rax
372 jmp ia32_sysret
373 CFI_ENDPROC
374
375/*
376 * Emulated IA32 system calls via int 0x80.
377 *
378 * Arguments:
379 * %eax System call number.
380 * %ebx Arg1
381 * %ecx Arg2
382 * %edx Arg3
383 * %esi Arg4
384 * %edi Arg5
385 * %ebp Arg6 [note: not saved in the stack frame, should not be touched]
386 *
387 * Notes:
388 * Uses the same stack frame as the x86-64 version.
389 * All registers except %eax must be saved (but ptrace may violate that)
390 * Arguments are zero extended. For system calls that want sign extension and
391 * take long arguments a wrapper is needed. Most calls can just be called
392 * directly.
393 * Assumes it is only called from user space and entered with interrupts off.
394 */
395
396ENTRY(ia32_syscall)
Jan Beulichcdc17932007-07-21 17:10:20 +0200397 CFI_STARTPROC32 simple
Jan Beulichadf14232006-09-26 10:52:41 +0200398 CFI_SIGNAL_FRAME
Jan Beulich7effaa82005-09-12 18:49:24 +0200399 CFI_DEF_CFA rsp,SS+8-RIP
400 /*CFI_REL_OFFSET ss,SS-RIP*/
401 CFI_REL_OFFSET rsp,RSP-RIP
402 /*CFI_REL_OFFSET rflags,EFLAGS-RIP*/
403 /*CFI_REL_OFFSET cs,CS-RIP*/
404 CFI_REL_OFFSET rip,RIP-RIP
Jeremy Fitzhardinge360c0442008-07-08 15:06:28 -0700405 PARAVIRT_ADJUST_EXCEPTION_FRAME
Jeremy Fitzhardinge66804152008-06-25 00:19:29 -0400406 SWAPGS
Ingo Molnar2601e642006-07-03 00:24:45 -0700407 /*
408 * No need to follow this irqs on/off section: the syscall
409 * disabled irqs and here we enable it straight after entry:
410 */
Jeremy Fitzhardinge66804152008-06-25 00:19:29 -0400411 ENABLE_INTERRUPTS(CLBR_NONE)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700412 movl %eax,%eax
Jan Beulich60cf6372011-02-28 15:54:40 +0000413 pushq_cfi %rax
Linus Torvalds1da177e2005-04-16 15:20:36 -0700414 cld
415 /* note the registers are not zero extended to the sf.
416 this could be a problem. */
Borislav Petkovcac0e0a2011-05-31 22:21:52 +0200417 SAVE_ARGS 0,1,0
Jan Beulich46db09d2011-11-29 11:17:45 +0000418 orl $TS_COMPAT,TI_status+THREAD_INFO(%rsp,RIP-ARGOFFSET)
419 testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700420 jnz ia32_tracesys
H. Peter Anvin36d001c2010-09-14 12:42:41 -0700421 cmpq $(IA32_NR_syscalls-1),%rax
Roland McGrathc09249f2009-02-06 18:15:18 -0800422 ja ia32_badsys
423ia32_do_call:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700424 IA32_ARG_FIXUP
425 call *ia32_sys_call_table(,%rax,8) # xxx: rip relative
426ia32_sysret:
427 movq %rax,RAX-ARGOFFSET(%rsp)
Jan Beulich24e35802009-09-30 11:22:11 +0100428ia32_ret_from_sys_call:
429 CLEAR_RREGS -ARGOFFSET
Linus Torvalds1da177e2005-04-16 15:20:36 -0700430 jmp int_ret_from_sys_call
431
432ia32_tracesys:
433 SAVE_REST
Jan Beulichcdc17932007-07-21 17:10:20 +0200434 CLEAR_RREGS
Roland McGrath8ab32bb2008-03-16 21:57:41 -0700435 movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700436 movq %rsp,%rdi /* &pt_regs -> arg1 */
437 call syscall_trace_enter
Andi Kleen176df242007-09-21 16:16:18 +0200438 LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700439 RESTORE_REST
H. Peter Anvin36d001c2010-09-14 12:42:41 -0700440 cmpq $(IA32_NR_syscalls-1),%rax
Roland McGrathc09249f2009-02-06 18:15:18 -0800441 ja int_ret_from_sys_call /* ia32_tracesys has set RAX(%rsp) */
442 jmp ia32_do_call
Jan Beulich4b787e02006-06-26 13:56:55 +0200443END(ia32_syscall)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700444
445ia32_badsys:
446 movq $0,ORIG_RAX-ARGOFFSET(%rsp)
Jan Beulich24e35802009-09-30 11:22:11 +0100447 movq $-ENOSYS,%rax
448 jmp ia32_sysret
Linus Torvalds1da177e2005-04-16 15:20:36 -0700449
Linus Torvalds1da177e2005-04-16 15:20:36 -0700450quiet_ni_syscall:
451 movq $-ENOSYS,%rax
452 ret
453 CFI_ENDPROC
454
455 .macro PTREGSCALL label, func, arg
Jan Beulichf6b2bc82011-11-29 11:24:10 +0000456 ALIGN
457GLOBAL(\label)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700458 leaq \func(%rip),%rax
459 leaq -ARGOFFSET+8(%rsp),\arg /* 8 for return address */
460 jmp ia32_ptregs_common
461 .endm
462
Jan Beulich27651302006-01-11 22:41:59 +0100463 CFI_STARTPROC32
Jan Beulich7effaa82005-09-12 18:49:24 +0200464
Linus Torvalds1da177e2005-04-16 15:20:36 -0700465 PTREGSCALL stub32_rt_sigreturn, sys32_rt_sigreturn, %rdi
466 PTREGSCALL stub32_sigreturn, sys32_sigreturn, %rdi
467 PTREGSCALL stub32_sigaltstack, sys32_sigaltstack, %rdx
Linus Torvalds1da177e2005-04-16 15:20:36 -0700468 PTREGSCALL stub32_execve, sys32_execve, %rcx
469 PTREGSCALL stub32_fork, sys_fork, %rdi
470 PTREGSCALL stub32_clone, sys32_clone, %rdx
471 PTREGSCALL stub32_vfork, sys_vfork, %rdi
472 PTREGSCALL stub32_iopl, sys_iopl, %rsi
Linus Torvalds1da177e2005-04-16 15:20:36 -0700473
Jan Beulichf6b2bc82011-11-29 11:24:10 +0000474 ALIGN
475ia32_ptregs_common:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700476 popq %r11
Jan Beulich27651302006-01-11 22:41:59 +0100477 CFI_ENDPROC
478 CFI_STARTPROC32 simple
Jan Beulichadf14232006-09-26 10:52:41 +0200479 CFI_SIGNAL_FRAME
Jan Beulich27651302006-01-11 22:41:59 +0100480 CFI_DEF_CFA rsp,SS+8-ARGOFFSET
481 CFI_REL_OFFSET rax,RAX-ARGOFFSET
482 CFI_REL_OFFSET rcx,RCX-ARGOFFSET
483 CFI_REL_OFFSET rdx,RDX-ARGOFFSET
484 CFI_REL_OFFSET rsi,RSI-ARGOFFSET
485 CFI_REL_OFFSET rdi,RDI-ARGOFFSET
486 CFI_REL_OFFSET rip,RIP-ARGOFFSET
487/* CFI_REL_OFFSET cs,CS-ARGOFFSET*/
488/* CFI_REL_OFFSET rflags,EFLAGS-ARGOFFSET*/
489 CFI_REL_OFFSET rsp,RSP-ARGOFFSET
490/* CFI_REL_OFFSET ss,SS-ARGOFFSET*/
Linus Torvalds1da177e2005-04-16 15:20:36 -0700491 SAVE_REST
492 call *%rax
493 RESTORE_REST
494 jmp ia32_sysret /* misbalances the return cache */
495 CFI_ENDPROC
Jan Beulich4b787e02006-06-26 13:56:55 +0200496END(ia32_ptregs_common)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700497
Arjan van de Venbb152f52006-01-06 00:12:05 -0800498 .section .rodata,"a"
Linus Torvalds1da177e2005-04-16 15:20:36 -0700499 .align 8
Linus Torvalds1da177e2005-04-16 15:20:36 -0700500ia32_sys_call_table:
501 .quad sys_restart_syscall
502 .quad sys_exit
503 .quad stub32_fork
504 .quad sys_read
505 .quad sys_write
Miklos Szeredie922efc2005-09-06 15:18:25 -0700506 .quad compat_sys_open /* 5 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700507 .quad sys_close
508 .quad sys32_waitpid
509 .quad sys_creat
510 .quad sys_link
511 .quad sys_unlink /* 10 */
512 .quad stub32_execve
513 .quad sys_chdir
514 .quad compat_sys_time
515 .quad sys_mknod
516 .quad sys_chmod /* 15 */
517 .quad sys_lchown16
518 .quad quiet_ni_syscall /* old break syscall holder */
519 .quad sys_stat
520 .quad sys32_lseek
521 .quad sys_getpid /* 20 */
522 .quad compat_sys_mount /* mount */
523 .quad sys_oldumount /* old_umount */
524 .quad sys_setuid16
525 .quad sys_getuid16
526 .quad compat_sys_stime /* stime */ /* 25 */
Roland McGrath562b80b2008-04-22 12:21:25 -0700527 .quad compat_sys_ptrace /* ptrace */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700528 .quad sys_alarm
529 .quad sys_fstat /* (old)fstat */
530 .quad sys_pause
531 .quad compat_sys_utime /* 30 */
532 .quad quiet_ni_syscall /* old stty syscall holder */
533 .quad quiet_ni_syscall /* old gtty syscall holder */
534 .quad sys_access
535 .quad sys_nice
536 .quad quiet_ni_syscall /* 35 */ /* old ftime syscall holder */
537 .quad sys_sync
538 .quad sys32_kill
539 .quad sys_rename
540 .quad sys_mkdir
541 .quad sys_rmdir /* 40 */
542 .quad sys_dup
Amerigo Wang4c711572009-08-06 15:58:12 -0700543 .quad sys_pipe
Linus Torvalds1da177e2005-04-16 15:20:36 -0700544 .quad compat_sys_times
545 .quad quiet_ni_syscall /* old prof syscall holder */
546 .quad sys_brk /* 45 */
547 .quad sys_setgid16
548 .quad sys_getgid16
549 .quad sys_signal
550 .quad sys_geteuid16
551 .quad sys_getegid16 /* 50 */
552 .quad sys_acct
553 .quad sys_umount /* new_umount */
554 .quad quiet_ni_syscall /* old lock syscall holder */
555 .quad compat_sys_ioctl
556 .quad compat_sys_fcntl64 /* 55 */
557 .quad quiet_ni_syscall /* old mpx syscall holder */
558 .quad sys_setpgid
559 .quad quiet_ni_syscall /* old ulimit syscall holder */
Christoph Hellwig5cacdb42010-03-10 15:21:21 -0800560 .quad sys_olduname
Linus Torvalds1da177e2005-04-16 15:20:36 -0700561 .quad sys_umask /* 60 */
562 .quad sys_chroot
Christoph Hellwig2b1c6bd2008-11-28 10:09:09 +0100563 .quad compat_sys_ustat
Linus Torvalds1da177e2005-04-16 15:20:36 -0700564 .quad sys_dup2
565 .quad sys_getppid
566 .quad sys_getpgrp /* 65 */
567 .quad sys_setsid
568 .quad sys32_sigaction
569 .quad sys_sgetmask
570 .quad sys_ssetmask
571 .quad sys_setreuid16 /* 70 */
572 .quad sys_setregid16
Jan Beulich5f0120b2008-06-18 12:42:11 +0100573 .quad sys32_sigsuspend
Linus Torvalds1da177e2005-04-16 15:20:36 -0700574 .quad compat_sys_sigpending
575 .quad sys_sethostname
576 .quad compat_sys_setrlimit /* 75 */
577 .quad compat_sys_old_getrlimit /* old_getrlimit */
578 .quad compat_sys_getrusage
Christoph Hellwigb418da12008-10-15 22:02:06 -0700579 .quad compat_sys_gettimeofday
580 .quad compat_sys_settimeofday
Linus Torvalds1da177e2005-04-16 15:20:36 -0700581 .quad sys_getgroups16 /* 80 */
582 .quad sys_setgroups16
Christoph Hellwig5d0e5282010-03-10 15:21:13 -0800583 .quad compat_sys_old_select
Linus Torvalds1da177e2005-04-16 15:20:36 -0700584 .quad sys_symlink
585 .quad sys_lstat
586 .quad sys_readlink /* 85 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700587 .quad sys_uselib
Linus Torvalds1da177e2005-04-16 15:20:36 -0700588 .quad sys_swapon
589 .quad sys_reboot
590 .quad compat_sys_old_readdir
591 .quad sys32_mmap /* 90 */
592 .quad sys_munmap
593 .quad sys_truncate
594 .quad sys_ftruncate
595 .quad sys_fchmod
596 .quad sys_fchown16 /* 95 */
597 .quad sys_getpriority
598 .quad sys_setpriority
599 .quad quiet_ni_syscall /* old profil syscall holder */
600 .quad compat_sys_statfs
601 .quad compat_sys_fstatfs /* 100 */
602 .quad sys_ioperm
603 .quad compat_sys_socketcall
604 .quad sys_syslog
605 .quad compat_sys_setitimer
606 .quad compat_sys_getitimer /* 105 */
607 .quad compat_sys_newstat
608 .quad compat_sys_newlstat
609 .quad compat_sys_newfstat
Christoph Hellwig5cacdb42010-03-10 15:21:21 -0800610 .quad sys_uname
Linus Torvalds1da177e2005-04-16 15:20:36 -0700611 .quad stub32_iopl /* 110 */
612 .quad sys_vhangup
613 .quad quiet_ni_syscall /* old "idle" system call */
614 .quad sys32_vm86_warning /* vm86old */
615 .quad compat_sys_wait4
616 .quad sys_swapoff /* 115 */
Kyle McMartind4d23ad2007-02-10 01:46:00 -0800617 .quad compat_sys_sysinfo
Linus Torvalds1da177e2005-04-16 15:20:36 -0700618 .quad sys32_ipc
619 .quad sys_fsync
620 .quad stub32_sigreturn
621 .quad stub32_clone /* 120 */
622 .quad sys_setdomainname
Christoph Hellwig4cecd932010-04-20 05:31:02 +0200623 .quad sys_newuname
Linus Torvalds1da177e2005-04-16 15:20:36 -0700624 .quad sys_modify_ldt
Stephen Rothwell3158e942006-03-26 01:37:29 -0800625 .quad compat_sys_adjtimex
Linus Torvalds1da177e2005-04-16 15:20:36 -0700626 .quad sys32_mprotect /* 125 */
627 .quad compat_sys_sigprocmask
628 .quad quiet_ni_syscall /* create_module */
629 .quad sys_init_module
630 .quad sys_delete_module
631 .quad quiet_ni_syscall /* 130 get_kernel_syms */
Vasily Tarasovb7163952007-07-15 23:41:12 -0700632 .quad sys32_quotactl
Linus Torvalds1da177e2005-04-16 15:20:36 -0700633 .quad sys_getpgid
634 .quad sys_fchdir
635 .quad quiet_ni_syscall /* bdflush */
636 .quad sys_sysfs /* 135 */
637 .quad sys_personality
638 .quad quiet_ni_syscall /* for afs_syscall */
639 .quad sys_setfsuid16
640 .quad sys_setfsgid16
641 .quad sys_llseek /* 140 */
642 .quad compat_sys_getdents
643 .quad compat_sys_select
644 .quad sys_flock
645 .quad sys_msync
646 .quad compat_sys_readv /* 145 */
647 .quad compat_sys_writev
648 .quad sys_getsid
649 .quad sys_fdatasync
Eric W. Biedermanc3359fb2009-04-03 00:59:52 -0700650 .quad compat_sys_sysctl /* sysctl */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700651 .quad sys_mlock /* 150 */
652 .quad sys_munlock
653 .quad sys_mlockall
654 .quad sys_munlockall
655 .quad sys_sched_setparam
656 .quad sys_sched_getparam /* 155 */
657 .quad sys_sched_setscheduler
658 .quad sys_sched_getscheduler
659 .quad sys_sched_yield
660 .quad sys_sched_get_priority_max
661 .quad sys_sched_get_priority_min /* 160 */
Alexandr Andreeva9bc3bf2007-03-16 21:07:36 +0100662 .quad sys32_sched_rr_get_interval
Linus Torvalds1da177e2005-04-16 15:20:36 -0700663 .quad compat_sys_nanosleep
664 .quad sys_mremap
665 .quad sys_setresuid16
666 .quad sys_getresuid16 /* 165 */
667 .quad sys32_vm86_warning /* vm86 */
668 .quad quiet_ni_syscall /* query_module */
669 .quad sys_poll
NeilBrownf5b94092011-08-26 18:03:11 -0400670 .quad quiet_ni_syscall /* old nfsservctl */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700671 .quad sys_setresgid16 /* 170 */
672 .quad sys_getresgid16
673 .quad sys_prctl
674 .quad stub32_rt_sigreturn
675 .quad sys32_rt_sigaction
676 .quad sys32_rt_sigprocmask /* 175 */
677 .quad sys32_rt_sigpending
678 .quad compat_sys_rt_sigtimedwait
679 .quad sys32_rt_sigqueueinfo
Jan Beulich5f0120b2008-06-18 12:42:11 +0100680 .quad sys_rt_sigsuspend
Linus Torvalds1da177e2005-04-16 15:20:36 -0700681 .quad sys32_pread /* 180 */
682 .quad sys32_pwrite
683 .quad sys_chown16
684 .quad sys_getcwd
685 .quad sys_capget
686 .quad sys_capset
687 .quad stub32_sigaltstack
688 .quad sys32_sendfile
689 .quad quiet_ni_syscall /* streams1 */
690 .quad quiet_ni_syscall /* streams2 */
691 .quad stub32_vfork /* 190 */
692 .quad compat_sys_getrlimit
Al Virof8b72562009-11-30 17:37:04 -0500693 .quad sys_mmap_pgoff
Linus Torvalds1da177e2005-04-16 15:20:36 -0700694 .quad sys32_truncate64
695 .quad sys32_ftruncate64
696 .quad sys32_stat64 /* 195 */
697 .quad sys32_lstat64
698 .quad sys32_fstat64
699 .quad sys_lchown
700 .quad sys_getuid
701 .quad sys_getgid /* 200 */
702 .quad sys_geteuid
703 .quad sys_getegid
704 .quad sys_setreuid
705 .quad sys_setregid
706 .quad sys_getgroups /* 205 */
707 .quad sys_setgroups
708 .quad sys_fchown
709 .quad sys_setresuid
710 .quad sys_getresuid
711 .quad sys_setresgid /* 210 */
712 .quad sys_getresgid
713 .quad sys_chown
714 .quad sys_setuid
715 .quad sys_setgid
716 .quad sys_setfsuid /* 215 */
717 .quad sys_setfsgid
718 .quad sys_pivot_root
719 .quad sys_mincore
720 .quad sys_madvise
721 .quad compat_sys_getdents64 /* 220 getdents64 */
722 .quad compat_sys_fcntl64
723 .quad quiet_ni_syscall /* tux */
724 .quad quiet_ni_syscall /* security */
725 .quad sys_gettid
Andi Kleene412ac42007-06-20 12:23:30 +0200726 .quad sys32_readahead /* 225 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700727 .quad sys_setxattr
728 .quad sys_lsetxattr
729 .quad sys_fsetxattr
730 .quad sys_getxattr
731 .quad sys_lgetxattr /* 230 */
732 .quad sys_fgetxattr
733 .quad sys_listxattr
734 .quad sys_llistxattr
735 .quad sys_flistxattr
736 .quad sys_removexattr /* 235 */
737 .quad sys_lremovexattr
738 .quad sys_fremovexattr
739 .quad sys_tkill
740 .quad sys_sendfile64
741 .quad compat_sys_futex /* 240 */
742 .quad compat_sys_sched_setaffinity
743 .quad compat_sys_sched_getaffinity
Roland McGrathefd1ca52008-01-30 13:30:46 +0100744 .quad sys_set_thread_area
745 .quad sys_get_thread_area
Linus Torvalds1da177e2005-04-16 15:20:36 -0700746 .quad compat_sys_io_setup /* 245 */
747 .quad sys_io_destroy
748 .quad compat_sys_io_getevents
749 .quad compat_sys_io_submit
750 .quad sys_io_cancel
Andi Kleene412ac42007-06-20 12:23:30 +0200751 .quad sys32_fadvise64 /* 250 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700752 .quad quiet_ni_syscall /* free_huge_pages */
753 .quad sys_exit_group
754 .quad sys32_lookup_dcookie
755 .quad sys_epoll_create
756 .quad sys_epoll_ctl /* 255 */
757 .quad sys_epoll_wait
758 .quad sys_remap_file_pages
759 .quad sys_set_tid_address
Christoph Hellwig3a0f69d2006-01-09 20:52:08 -0800760 .quad compat_sys_timer_create
Linus Torvalds1da177e2005-04-16 15:20:36 -0700761 .quad compat_sys_timer_settime /* 260 */
762 .quad compat_sys_timer_gettime
763 .quad sys_timer_getoverrun
764 .quad sys_timer_delete
765 .quad compat_sys_clock_settime
766 .quad compat_sys_clock_gettime /* 265 */
767 .quad compat_sys_clock_getres
768 .quad compat_sys_clock_nanosleep
769 .quad compat_sys_statfs64
770 .quad compat_sys_fstatfs64
771 .quad sys_tgkill /* 270 */
772 .quad compat_sys_utimes
773 .quad sys32_fadvise64_64
774 .quad quiet_ni_syscall /* sys_vserver */
775 .quad sys_mbind
776 .quad compat_sys_get_mempolicy /* 275 */
777 .quad sys_set_mempolicy
778 .quad compat_sys_mq_open
779 .quad sys_mq_unlink
780 .quad compat_sys_mq_timedsend
781 .quad compat_sys_mq_timedreceive /* 280 */
782 .quad compat_sys_mq_notify
783 .quad compat_sys_mq_getsetattr
Eric W. Biederman5234f5e2005-06-25 14:58:02 -0700784 .quad compat_sys_kexec_load /* reserved for kexec */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700785 .quad compat_sys_waitid
Robert Love725b38ab2005-07-25 15:19:29 -0400786 .quad quiet_ni_syscall /* 285: sys_altroot */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700787 .quad sys_add_key
788 .quad sys_request_key
789 .quad sys_keyctl
Robert Love725b38ab2005-07-25 15:19:29 -0400790 .quad sys_ioprio_set
791 .quad sys_ioprio_get /* 290 */
792 .quad sys_inotify_init
793 .quad sys_inotify_add_watch
794 .quad sys_inotify_rm_watch
Christoph Lameter39743882006-01-08 01:00:51 -0800795 .quad sys_migrate_pages
Ulrich Dreppera60fc512006-01-18 17:43:56 -0800796 .quad compat_sys_openat /* 295 */
797 .quad sys_mkdirat
798 .quad sys_mknodat
799 .quad sys_fchownat
Andrew Morton3833a702006-02-01 03:04:32 -0800800 .quad compat_sys_futimesat
Ulrich Dreppercff2b762006-02-11 17:55:47 -0800801 .quad sys32_fstatat /* 300 */
Ulrich Dreppera60fc512006-01-18 17:43:56 -0800802 .quad sys_unlinkat
803 .quad sys_renameat
804 .quad sys_linkat
805 .quad sys_symlinkat
806 .quad sys_readlinkat /* 305 */
807 .quad sys_fchmodat
808 .quad sys_faccessat
Andi Kleen957dc872006-09-26 10:52:27 +0200809 .quad compat_sys_pselect6
810 .quad compat_sys_ppoll
Andi Kleen4b88f092006-02-09 00:35:50 +0100811 .quad sys_unshare /* 310 */
Ingo Molnar8fdd6c62006-03-27 01:16:26 -0800812 .quad compat_sys_set_robust_list
813 .quad compat_sys_get_robust_list
Andi Kleenb8feb472006-04-07 19:50:34 +0200814 .quad sys_splice
Andi Kleene412ac42007-06-20 12:23:30 +0200815 .quad sys32_sync_file_range
Ulrich Drepper1c710c82007-05-08 00:33:25 -0700816 .quad sys_tee /* 315 */
Andi Kleend2610202006-05-01 12:15:48 -0700817 .quad compat_sys_vmsplice
Christoph Lameter1b2db9f2006-06-23 02:03:56 -0700818 .quad compat_sys_move_pages
Andi Kleen3cfc3482006-09-26 10:52:28 +0200819 .quad sys_getcpu
Ralf Baechle9af3cf02007-02-13 13:26:26 +0100820 .quad sys_epoll_pwait
Ulrich Drepper1c710c82007-05-08 00:33:25 -0700821 .quad compat_sys_utimensat /* 320 */
Heiko Carstensae7d5c82007-05-12 17:27:41 +0200822 .quad compat_sys_signalfd
Davide Libenzicb9282e2008-02-04 22:27:28 -0800823 .quad sys_timerfd_create
Davide Libenzifdb902b12007-05-10 22:23:20 -0700824 .quad sys_eventfd
Amit Arora97ac7352007-07-17 21:42:44 -0400825 .quad sys32_fallocate
Davide Libenzicb9282e2008-02-04 22:27:28 -0800826 .quad compat_sys_timerfd_settime /* 325 */
827 .quad compat_sys_timerfd_gettime
Ulrich Drepper9deb27b2008-07-23 21:29:24 -0700828 .quad compat_sys_signalfd4
Ulrich Drepperb087498e2008-07-23 21:29:25 -0700829 .quad sys_eventfd2
Ulrich Drepper9fe5ad92008-07-23 21:29:43 -0700830 .quad sys_epoll_create1
Ingo Molnar241771e2008-12-03 10:39:53 +0100831 .quad sys_dup3 /* 330 */
Ulrich Dreppered8cae82008-07-23 21:29:30 -0700832 .quad sys_pipe2
Ulrich Drepper40065532008-07-23 21:29:32 -0700833 .quad sys_inotify_init1
Gerd Hoffmannf3554f42009-04-02 16:59:23 -0700834 .quad compat_sys_preadv
835 .quad compat_sys_pwritev
Thomas Gleixner12d16112009-04-04 21:01:10 +0000836 .quad compat_sys_rt_tgsigqueueinfo /* 335 */
Ingo Molnarcdd6c482009-09-21 12:02:48 +0200837 .quad sys_perf_event_open
Arnaldo Carvalho de Meloa2e27252009-10-12 23:40:10 -0700838 .quad compat_sys_recvmmsg
Eric Paris11637e42009-12-17 21:24:25 -0500839 .quad sys_fanotify_init
Eric Parisbbaa4162009-12-17 21:24:26 -0500840 .quad sys32_fanotify_mark
Linus Torvalds8cbd84f2010-08-10 15:35:10 -0700841 .quad sys_prlimit64 /* 340 */
Aneesh Kumar K.V6aae5f22011-01-29 18:43:37 +0530842 .quad sys_name_to_handle_at
843 .quad compat_sys_open_by_handle_at
Richard Cochrance26efd2011-02-01 13:52:30 +0000844 .quad compat_sys_clock_adjtime
Sage Weilb7ed78f2011-03-10 11:31:30 -0800845 .quad sys_syncfs
Anton Blanchard228e5482011-05-02 20:21:35 +0000846 .quad compat_sys_sendmmsg /* 345 */
Eric W. Biederman7b21fdd2011-05-27 19:28:27 -0700847 .quad sys_setns
Christopher Yeohfcf63402011-10-31 17:06:39 -0700848 .quad compat_sys_process_vm_readv
849 .quad compat_sys_process_vm_writev
Heiko Carstensae7d5c82007-05-12 17:27:41 +0200850ia32_syscall_end: