blob: a0e866d233eeb833ef9740e1247962d298cc5971 [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 */
Jan Beulich60cf6372011-02-28 15:54:40 +0000131 pushq_cfi $__USER32_DS
Jan Beulich7effaa82005-09-12 18:49:24 +0200132 /*CFI_REL_OFFSET ss,0*/
Jan Beulich60cf6372011-02-28 15:54:40 +0000133 pushq_cfi %rbp
Jan Beulich7effaa82005-09-12 18:49:24 +0200134 CFI_REL_OFFSET rsp,0
Jan Beulich60cf6372011-02-28 15:54:40 +0000135 pushfq_cfi
Jan Beulich7effaa82005-09-12 18:49:24 +0200136 /*CFI_REL_OFFSET rflags,0*/
Glauber Costa26ccb8a2008-06-24 11:19:35 -0300137 movl 8*3-THREAD_SIZE+TI_sysenter_return(%rsp), %r10d
Jan Beulich7effaa82005-09-12 18:49:24 +0200138 CFI_REGISTER rip,r10
Jan Beulich60cf6372011-02-28 15:54:40 +0000139 pushq_cfi $__USER32_CS
Jan Beulich7effaa82005-09-12 18:49:24 +0200140 /*CFI_REL_OFFSET cs,0*/
Linus Torvalds1da177e2005-04-16 15:20:36 -0700141 movl %eax, %eax
Jan Beulich60cf6372011-02-28 15:54:40 +0000142 pushq_cfi %r10
Jan Beulich7effaa82005-09-12 18:49:24 +0200143 CFI_REL_OFFSET rip,0
Jan Beulich60cf6372011-02-28 15:54:40 +0000144 pushq_cfi %rax
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145 cld
Borislav Petkovcac0e0a2011-05-31 22:21:52 +0200146 SAVE_ARGS 0,1,0
Linus Torvalds1da177e2005-04-16 15:20:36 -0700147 /* no need to do an access_ok check here because rbp has been
148 32bit zero extended */
Jan Beulich295286a2008-08-29 13:21:11 +01001491: movl (%rbp),%ebp
Linus Torvalds1da177e2005-04-16 15:20:36 -0700150 .section __ex_table,"a"
151 .quad 1b,ia32_badarg
152 .previous
153 GET_THREAD_INFO(%r10)
Glauber Costa26ccb8a2008-06-24 11:19:35 -0300154 orl $TS_COMPAT,TI_status(%r10)
Roland McGrathd4d67152008-07-09 02:38:07 -0700155 testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10)
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)
165 GET_THREAD_INFO(%r10)
Jeremy Fitzhardinge66804152008-06-25 00:19:29 -0400166 DISABLE_INTERRUPTS(CLBR_NONE)
Ingo Molnar2601e642006-07-03 00:24:45 -0700167 TRACE_IRQS_OFF
Glauber Costa26ccb8a2008-06-24 11:19:35 -0300168 testl $_TIF_ALLWORK_MASK,TI_flags(%r10)
Roland McGrath5cbf1562008-06-24 01:13:31 -0700169 jnz sysexit_audit
170sysexit_from_sys_call:
Glauber Costa26ccb8a2008-06-24 11:19:35 -0300171 andl $~TS_COMPAT,TI_status(%r10)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700172 /* clear IF, that popfq doesn't enable interrupts early */
173 andl $~0x200,EFLAGS-R11(%rsp)
Roland McGrath36197c92008-01-30 13:30:43 +0100174 movl RIP-R11(%rsp),%edx /* User %eip */
175 CFI_REGISTER rip,rdx
Borislav Petkov838feb42011-05-31 22:21:53 +0200176 RESTORE_ARGS 0,24,0,0,0,0
Jan Beulich24e35802009-09-30 11:22:11 +0100177 xorq %r8,%r8
178 xorq %r9,%r9
179 xorq %r10,%r10
180 xorq %r11,%r11
Jan Beulich60cf6372011-02-28 15:54:40 +0000181 popfq_cfi
Jan Beulich7effaa82005-09-12 18:49:24 +0200182 /*CFI_RESTORE rflags*/
Jan Beulich60cf6372011-02-28 15:54:40 +0000183 popq_cfi %rcx /* User %esp */
Jan Beulich7effaa82005-09-12 18:49:24 +0200184 CFI_REGISTER rsp,rcx
Ingo Molnar2601e642006-07-03 00:24:45 -0700185 TRACE_IRQS_ON
Jeremy Fitzhardinge2be29982008-06-25 00:19:28 -0400186 ENABLE_INTERRUPTS_SYSEXIT32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700187
Roland McGrath5cbf1562008-06-24 01:13:31 -0700188#ifdef CONFIG_AUDITSYSCALL
189 .macro auditsys_entry_common
190 movl %esi,%r9d /* 6th arg: 4th syscall arg */
191 movl %edx,%r8d /* 5th arg: 3rd syscall arg */
192 /* (already in %ecx) 4th arg: 2nd syscall arg */
193 movl %ebx,%edx /* 3rd arg: 1st syscall arg */
194 movl %eax,%esi /* 2nd arg: syscall number */
195 movl $AUDIT_ARCH_I386,%edi /* 1st arg: audit arch */
196 call audit_syscall_entry
197 movl RAX-ARGOFFSET(%rsp),%eax /* reload syscall number */
H. Peter Anvin36d001c2010-09-14 12:42:41 -0700198 cmpq $(IA32_NR_syscalls-1),%rax
Roland McGrath5cbf1562008-06-24 01:13:31 -0700199 ja ia32_badsys
200 movl %ebx,%edi /* reload 1st syscall arg */
201 movl RCX-ARGOFFSET(%rsp),%esi /* reload 2nd syscall arg */
202 movl RDX-ARGOFFSET(%rsp),%edx /* reload 3rd syscall arg */
203 movl RSI-ARGOFFSET(%rsp),%ecx /* reload 4th syscall arg */
204 movl RDI-ARGOFFSET(%rsp),%r8d /* reload 5th syscall arg */
205 .endm
206
Jan Beulich81766742009-10-26 15:20:29 +0000207 .macro auditsys_exit exit
Roland McGrath5cbf1562008-06-24 01:13:31 -0700208 testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10)
Jan Beulich24e35802009-09-30 11:22:11 +0100209 jnz ia32_ret_from_sys_call
Roland McGrath5cbf1562008-06-24 01:13:31 -0700210 TRACE_IRQS_ON
211 sti
212 movl %eax,%esi /* second arg, syscall return value */
213 cmpl $0,%eax /* is it < 0? */
214 setl %al /* 1 if so, 0 if not */
215 movzbl %al,%edi /* zero-extend that into %edi */
216 inc %edi /* first arg, 0->1(AUDITSC_SUCCESS), 1->2(AUDITSC_FAILURE) */
217 call audit_syscall_exit
218 GET_THREAD_INFO(%r10)
219 movl RAX-ARGOFFSET(%rsp),%eax /* reload syscall return value */
Roland McGrath5cbf1562008-06-24 01:13:31 -0700220 movl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),%edi
221 cli
222 TRACE_IRQS_OFF
223 testl %edi,TI_flags(%r10)
Jan Beulich24e35802009-09-30 11:22:11 +0100224 jz \exit
225 CLEAR_RREGS -ARGOFFSET
226 jmp int_with_check
Roland McGrath5cbf1562008-06-24 01:13:31 -0700227 .endm
228
229sysenter_auditsys:
Jan Beulich7effaa82005-09-12 18:49:24 +0200230 CFI_RESTORE_STATE
Roland McGrath5cbf1562008-06-24 01:13:31 -0700231 auditsys_entry_common
232 movl %ebp,%r9d /* reload 6th syscall arg */
233 jmp sysenter_dispatch
234
235sysexit_audit:
236 auditsys_exit sysexit_from_sys_call
237#endif
238
239sysenter_tracesys:
Roland McGrath5cbf1562008-06-24 01:13:31 -0700240#ifdef CONFIG_AUDITSYSCALL
241 testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10)
242 jz sysenter_auditsys
243#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700244 SAVE_REST
245 CLEAR_RREGS
Roland McGrath48ee6792008-03-18 18:23:50 -0700246 movq $-ENOSYS,RAX(%rsp)/* ptrace can change this for a bad syscall */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700247 movq %rsp,%rdi /* &pt_regs -> arg1 */
248 call syscall_trace_enter
Andi Kleen176df242007-09-21 16:16:18 +0200249 LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700250 RESTORE_REST
H. Peter Anvin36d001c2010-09-14 12:42:41 -0700251 cmpq $(IA32_NR_syscalls-1),%rax
Roland McGrath48ee6792008-03-18 18:23:50 -0700252 ja int_ret_from_sys_call /* sysenter_tracesys has set RAX(%rsp) */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700253 jmp sysenter_do_call
254 CFI_ENDPROC
Jan Beulich4b787e02006-06-26 13:56:55 +0200255ENDPROC(ia32_sysenter_target)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700256
257/*
258 * 32bit SYSCALL instruction entry.
259 *
260 * Arguments:
261 * %eax System call number.
262 * %ebx Arg1
263 * %ecx return EIP
264 * %edx Arg3
265 * %esi Arg4
266 * %edi Arg5
267 * %ebp Arg2 [note: not saved in the stack frame, should not be touched]
268 * %esp user stack
269 * 0(%esp) Arg6
270 *
271 * Interrupts off.
272 *
273 * This is purely a fast path. For anything complicated we use the int 0x80
274 * path below. Set up a complete hardware stack frame to share code
275 * with the int 0x80 path.
276 */
277ENTRY(ia32_cstar_target)
Jan Beulich27651302006-01-11 22:41:59 +0100278 CFI_STARTPROC32 simple
Jan Beulichadf14232006-09-26 10:52:41 +0200279 CFI_SIGNAL_FRAME
Brian Gerst9af45652009-01-19 00:38:58 +0900280 CFI_DEF_CFA rsp,KERNEL_STACK_OFFSET
Jan Beulich7effaa82005-09-12 18:49:24 +0200281 CFI_REGISTER rip,rcx
282 /*CFI_REGISTER rflags,r11*/
Jeremy Fitzhardinge457da702008-06-26 07:28:51 -0700283 SWAPGS_UNSAFE_STACK
Linus Torvalds1da177e2005-04-16 15:20:36 -0700284 movl %esp,%r8d
Jan Beulich7effaa82005-09-12 18:49:24 +0200285 CFI_REGISTER rsp,r8
Brian Gerst9af45652009-01-19 00:38:58 +0900286 movq PER_CPU_VAR(kernel_stack),%rsp
Ingo Molnar2601e642006-07-03 00:24:45 -0700287 /*
288 * No need to follow this irqs on/off section: the syscall
289 * disabled irqs and here we enable it straight after entry:
290 */
Jeremy Fitzhardinge66804152008-06-25 00:19:29 -0400291 ENABLE_INTERRUPTS(CLBR_NONE)
Borislav Petkovcac0e0a2011-05-31 22:21:52 +0200292 SAVE_ARGS 8,0,0
Linus Torvalds1da177e2005-04-16 15:20:36 -0700293 movl %eax,%eax /* zero extension */
294 movq %rax,ORIG_RAX-ARGOFFSET(%rsp)
295 movq %rcx,RIP-ARGOFFSET(%rsp)
Jan Beulich7effaa82005-09-12 18:49:24 +0200296 CFI_REL_OFFSET rip,RIP-ARGOFFSET
Linus Torvalds1da177e2005-04-16 15:20:36 -0700297 movq %rbp,RCX-ARGOFFSET(%rsp) /* this lies slightly to ptrace */
298 movl %ebp,%ecx
299 movq $__USER32_CS,CS-ARGOFFSET(%rsp)
300 movq $__USER32_DS,SS-ARGOFFSET(%rsp)
301 movq %r11,EFLAGS-ARGOFFSET(%rsp)
Jan Beulich7effaa82005-09-12 18:49:24 +0200302 /*CFI_REL_OFFSET rflags,EFLAGS-ARGOFFSET*/
Linus Torvalds1da177e2005-04-16 15:20:36 -0700303 movq %r8,RSP-ARGOFFSET(%rsp)
Jan Beulich7effaa82005-09-12 18:49:24 +0200304 CFI_REL_OFFSET rsp,RSP-ARGOFFSET
Linus Torvalds1da177e2005-04-16 15:20:36 -0700305 /* no need to do an access_ok check here because r8 has been
306 32bit zero extended */
307 /* hardware stack frame is complete now */
3081: movl (%r8),%r9d
309 .section __ex_table,"a"
310 .quad 1b,ia32_badarg
311 .previous
312 GET_THREAD_INFO(%r10)
Glauber Costa26ccb8a2008-06-24 11:19:35 -0300313 orl $TS_COMPAT,TI_status(%r10)
Roland McGrathd4d67152008-07-09 02:38:07 -0700314 testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10)
Jan Beulich7effaa82005-09-12 18:49:24 +0200315 CFI_REMEMBER_STATE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700316 jnz cstar_tracesys
H. Peter Anvin36d001c2010-09-14 12:42:41 -0700317 cmpq $IA32_NR_syscalls-1,%rax
Andi Kleen67d53ea2006-04-07 19:50:31 +0200318 ja ia32_badsys
Jan Beulich295286a2008-08-29 13:21:11 +0100319cstar_do_call:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700320 IA32_ARG_FIXUP 1
Roland McGrath5cbf1562008-06-24 01:13:31 -0700321cstar_dispatch:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700322 call *ia32_sys_call_table(,%rax,8)
323 movq %rax,RAX-ARGOFFSET(%rsp)
324 GET_THREAD_INFO(%r10)
Jeremy Fitzhardinge66804152008-06-25 00:19:29 -0400325 DISABLE_INTERRUPTS(CLBR_NONE)
Ingo Molnar2601e642006-07-03 00:24:45 -0700326 TRACE_IRQS_OFF
Glauber Costa26ccb8a2008-06-24 11:19:35 -0300327 testl $_TIF_ALLWORK_MASK,TI_flags(%r10)
Roland McGrath5cbf1562008-06-24 01:13:31 -0700328 jnz sysretl_audit
329sysretl_from_sys_call:
Glauber Costa26ccb8a2008-06-24 11:19:35 -0300330 andl $~TS_COMPAT,TI_status(%r10)
Borislav Petkov838feb42011-05-31 22:21:53 +0200331 RESTORE_ARGS 0,-ARG_SKIP,0,0,0
Linus Torvalds1da177e2005-04-16 15:20:36 -0700332 movl RIP-ARGOFFSET(%rsp),%ecx
Jan Beulich7effaa82005-09-12 18:49:24 +0200333 CFI_REGISTER rip,rcx
Linus Torvalds1da177e2005-04-16 15:20:36 -0700334 movl EFLAGS-ARGOFFSET(%rsp),%r11d
Jan Beulich7effaa82005-09-12 18:49:24 +0200335 /*CFI_REGISTER rflags,r11*/
Jan Beulich24e35802009-09-30 11:22:11 +0100336 xorq %r10,%r10
337 xorq %r9,%r9
338 xorq %r8,%r8
Ingo Molnar2601e642006-07-03 00:24:45 -0700339 TRACE_IRQS_ON
Linus Torvalds1da177e2005-04-16 15:20:36 -0700340 movl RSP-ARGOFFSET(%rsp),%esp
Jan Beulich7effaa82005-09-12 18:49:24 +0200341 CFI_RESTORE rsp
Jeremy Fitzhardinge2be29982008-06-25 00:19:28 -0400342 USERGS_SYSRET32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700343
Roland McGrath5cbf1562008-06-24 01:13:31 -0700344#ifdef CONFIG_AUDITSYSCALL
345cstar_auditsys:
Jan Beulich7effaa82005-09-12 18:49:24 +0200346 CFI_RESTORE_STATE
Roland McGrath5cbf1562008-06-24 01:13:31 -0700347 movl %r9d,R9-ARGOFFSET(%rsp) /* register to be clobbered by call */
348 auditsys_entry_common
349 movl R9-ARGOFFSET(%rsp),%r9d /* reload 6th syscall arg */
350 jmp cstar_dispatch
351
352sysretl_audit:
Jan Beulich81766742009-10-26 15:20:29 +0000353 auditsys_exit sysretl_from_sys_call
Roland McGrath5cbf1562008-06-24 01:13:31 -0700354#endif
355
356cstar_tracesys:
357#ifdef CONFIG_AUDITSYSCALL
358 testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10)
359 jz cstar_auditsys
360#endif
Chuck Ebbertecd744e2007-11-07 10:48:39 -0500361 xchgl %r9d,%ebp
Linus Torvalds1da177e2005-04-16 15:20:36 -0700362 SAVE_REST
Jan Beulich24e35802009-09-30 11:22:11 +0100363 CLEAR_RREGS 0, r9
Roland McGrath48ee6792008-03-18 18:23:50 -0700364 movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700365 movq %rsp,%rdi /* &pt_regs -> arg1 */
366 call syscall_trace_enter
Jan Beulich295286a2008-08-29 13:21:11 +0100367 LOAD_ARGS32 ARGOFFSET, 1 /* reload args from stack in case ptrace changed it */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700368 RESTORE_REST
Chuck Ebbertecd744e2007-11-07 10:48:39 -0500369 xchgl %ebp,%r9d
H. Peter Anvin36d001c2010-09-14 12:42:41 -0700370 cmpq $(IA32_NR_syscalls-1),%rax
Roland McGrath48ee6792008-03-18 18:23:50 -0700371 ja int_ret_from_sys_call /* cstar_tracesys has set RAX(%rsp) */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700372 jmp cstar_do_call
Jan Beulich4b787e02006-06-26 13:56:55 +0200373END(ia32_cstar_target)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700374
375ia32_badarg:
376 movq $-EFAULT,%rax
377 jmp ia32_sysret
378 CFI_ENDPROC
379
380/*
381 * Emulated IA32 system calls via int 0x80.
382 *
383 * Arguments:
384 * %eax System call number.
385 * %ebx Arg1
386 * %ecx Arg2
387 * %edx Arg3
388 * %esi Arg4
389 * %edi Arg5
390 * %ebp Arg6 [note: not saved in the stack frame, should not be touched]
391 *
392 * Notes:
393 * Uses the same stack frame as the x86-64 version.
394 * All registers except %eax must be saved (but ptrace may violate that)
395 * Arguments are zero extended. For system calls that want sign extension and
396 * take long arguments a wrapper is needed. Most calls can just be called
397 * directly.
398 * Assumes it is only called from user space and entered with interrupts off.
399 */
400
401ENTRY(ia32_syscall)
Jan Beulichcdc17932007-07-21 17:10:20 +0200402 CFI_STARTPROC32 simple
Jan Beulichadf14232006-09-26 10:52:41 +0200403 CFI_SIGNAL_FRAME
Jan Beulich7effaa82005-09-12 18:49:24 +0200404 CFI_DEF_CFA rsp,SS+8-RIP
405 /*CFI_REL_OFFSET ss,SS-RIP*/
406 CFI_REL_OFFSET rsp,RSP-RIP
407 /*CFI_REL_OFFSET rflags,EFLAGS-RIP*/
408 /*CFI_REL_OFFSET cs,CS-RIP*/
409 CFI_REL_OFFSET rip,RIP-RIP
Jeremy Fitzhardinge360c0442008-07-08 15:06:28 -0700410 PARAVIRT_ADJUST_EXCEPTION_FRAME
Jeremy Fitzhardinge66804152008-06-25 00:19:29 -0400411 SWAPGS
Ingo Molnar2601e642006-07-03 00:24:45 -0700412 /*
413 * No need to follow this irqs on/off section: the syscall
414 * disabled irqs and here we enable it straight after entry:
415 */
Jeremy Fitzhardinge66804152008-06-25 00:19:29 -0400416 ENABLE_INTERRUPTS(CLBR_NONE)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700417 movl %eax,%eax
Jan Beulich60cf6372011-02-28 15:54:40 +0000418 pushq_cfi %rax
Linus Torvalds1da177e2005-04-16 15:20:36 -0700419 cld
420 /* note the registers are not zero extended to the sf.
421 this could be a problem. */
Borislav Petkovcac0e0a2011-05-31 22:21:52 +0200422 SAVE_ARGS 0,1,0
Linus Torvalds1da177e2005-04-16 15:20:36 -0700423 GET_THREAD_INFO(%r10)
Glauber Costa26ccb8a2008-06-24 11:19:35 -0300424 orl $TS_COMPAT,TI_status(%r10)
Roland McGrathd4d67152008-07-09 02:38:07 -0700425 testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700426 jnz ia32_tracesys
H. Peter Anvin36d001c2010-09-14 12:42:41 -0700427 cmpq $(IA32_NR_syscalls-1),%rax
Roland McGrathc09249f2009-02-06 18:15:18 -0800428 ja ia32_badsys
429ia32_do_call:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700430 IA32_ARG_FIXUP
431 call *ia32_sys_call_table(,%rax,8) # xxx: rip relative
432ia32_sysret:
433 movq %rax,RAX-ARGOFFSET(%rsp)
Jan Beulich24e35802009-09-30 11:22:11 +0100434ia32_ret_from_sys_call:
435 CLEAR_RREGS -ARGOFFSET
Linus Torvalds1da177e2005-04-16 15:20:36 -0700436 jmp int_ret_from_sys_call
437
438ia32_tracesys:
439 SAVE_REST
Jan Beulichcdc17932007-07-21 17:10:20 +0200440 CLEAR_RREGS
Roland McGrath8ab32bb2008-03-16 21:57:41 -0700441 movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700442 movq %rsp,%rdi /* &pt_regs -> arg1 */
443 call syscall_trace_enter
Andi Kleen176df242007-09-21 16:16:18 +0200444 LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700445 RESTORE_REST
H. Peter Anvin36d001c2010-09-14 12:42:41 -0700446 cmpq $(IA32_NR_syscalls-1),%rax
Roland McGrathc09249f2009-02-06 18:15:18 -0800447 ja int_ret_from_sys_call /* ia32_tracesys has set RAX(%rsp) */
448 jmp ia32_do_call
Jan Beulich4b787e02006-06-26 13:56:55 +0200449END(ia32_syscall)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700450
451ia32_badsys:
452 movq $0,ORIG_RAX-ARGOFFSET(%rsp)
Jan Beulich24e35802009-09-30 11:22:11 +0100453 movq $-ENOSYS,%rax
454 jmp ia32_sysret
Linus Torvalds1da177e2005-04-16 15:20:36 -0700455
Linus Torvalds1da177e2005-04-16 15:20:36 -0700456quiet_ni_syscall:
457 movq $-ENOSYS,%rax
458 ret
459 CFI_ENDPROC
460
461 .macro PTREGSCALL label, func, arg
462 .globl \label
463\label:
464 leaq \func(%rip),%rax
465 leaq -ARGOFFSET+8(%rsp),\arg /* 8 for return address */
466 jmp ia32_ptregs_common
467 .endm
468
Jan Beulich27651302006-01-11 22:41:59 +0100469 CFI_STARTPROC32
Jan Beulich7effaa82005-09-12 18:49:24 +0200470
Linus Torvalds1da177e2005-04-16 15:20:36 -0700471 PTREGSCALL stub32_rt_sigreturn, sys32_rt_sigreturn, %rdi
472 PTREGSCALL stub32_sigreturn, sys32_sigreturn, %rdi
473 PTREGSCALL stub32_sigaltstack, sys32_sigaltstack, %rdx
Linus Torvalds1da177e2005-04-16 15:20:36 -0700474 PTREGSCALL stub32_execve, sys32_execve, %rcx
475 PTREGSCALL stub32_fork, sys_fork, %rdi
476 PTREGSCALL stub32_clone, sys32_clone, %rdx
477 PTREGSCALL stub32_vfork, sys_vfork, %rdi
478 PTREGSCALL stub32_iopl, sys_iopl, %rsi
Linus Torvalds1da177e2005-04-16 15:20:36 -0700479
480ENTRY(ia32_ptregs_common)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700481 popq %r11
Jan Beulich27651302006-01-11 22:41:59 +0100482 CFI_ENDPROC
483 CFI_STARTPROC32 simple
Jan Beulichadf14232006-09-26 10:52:41 +0200484 CFI_SIGNAL_FRAME
Jan Beulich27651302006-01-11 22:41:59 +0100485 CFI_DEF_CFA rsp,SS+8-ARGOFFSET
486 CFI_REL_OFFSET rax,RAX-ARGOFFSET
487 CFI_REL_OFFSET rcx,RCX-ARGOFFSET
488 CFI_REL_OFFSET rdx,RDX-ARGOFFSET
489 CFI_REL_OFFSET rsi,RSI-ARGOFFSET
490 CFI_REL_OFFSET rdi,RDI-ARGOFFSET
491 CFI_REL_OFFSET rip,RIP-ARGOFFSET
492/* CFI_REL_OFFSET cs,CS-ARGOFFSET*/
493/* CFI_REL_OFFSET rflags,EFLAGS-ARGOFFSET*/
494 CFI_REL_OFFSET rsp,RSP-ARGOFFSET
495/* CFI_REL_OFFSET ss,SS-ARGOFFSET*/
Linus Torvalds1da177e2005-04-16 15:20:36 -0700496 SAVE_REST
497 call *%rax
498 RESTORE_REST
499 jmp ia32_sysret /* misbalances the return cache */
500 CFI_ENDPROC
Jan Beulich4b787e02006-06-26 13:56:55 +0200501END(ia32_ptregs_common)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700502
Arjan van de Venbb152f52006-01-06 00:12:05 -0800503 .section .rodata,"a"
Linus Torvalds1da177e2005-04-16 15:20:36 -0700504 .align 8
Linus Torvalds1da177e2005-04-16 15:20:36 -0700505ia32_sys_call_table:
506 .quad sys_restart_syscall
507 .quad sys_exit
508 .quad stub32_fork
509 .quad sys_read
510 .quad sys_write
Miklos Szeredie922efc2005-09-06 15:18:25 -0700511 .quad compat_sys_open /* 5 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700512 .quad sys_close
513 .quad sys32_waitpid
514 .quad sys_creat
515 .quad sys_link
516 .quad sys_unlink /* 10 */
517 .quad stub32_execve
518 .quad sys_chdir
519 .quad compat_sys_time
520 .quad sys_mknod
521 .quad sys_chmod /* 15 */
522 .quad sys_lchown16
523 .quad quiet_ni_syscall /* old break syscall holder */
524 .quad sys_stat
525 .quad sys32_lseek
526 .quad sys_getpid /* 20 */
527 .quad compat_sys_mount /* mount */
528 .quad sys_oldumount /* old_umount */
529 .quad sys_setuid16
530 .quad sys_getuid16
531 .quad compat_sys_stime /* stime */ /* 25 */
Roland McGrath562b80b2008-04-22 12:21:25 -0700532 .quad compat_sys_ptrace /* ptrace */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700533 .quad sys_alarm
534 .quad sys_fstat /* (old)fstat */
535 .quad sys_pause
536 .quad compat_sys_utime /* 30 */
537 .quad quiet_ni_syscall /* old stty syscall holder */
538 .quad quiet_ni_syscall /* old gtty syscall holder */
539 .quad sys_access
540 .quad sys_nice
541 .quad quiet_ni_syscall /* 35 */ /* old ftime syscall holder */
542 .quad sys_sync
543 .quad sys32_kill
544 .quad sys_rename
545 .quad sys_mkdir
546 .quad sys_rmdir /* 40 */
547 .quad sys_dup
Amerigo Wang4c711572009-08-06 15:58:12 -0700548 .quad sys_pipe
Linus Torvalds1da177e2005-04-16 15:20:36 -0700549 .quad compat_sys_times
550 .quad quiet_ni_syscall /* old prof syscall holder */
551 .quad sys_brk /* 45 */
552 .quad sys_setgid16
553 .quad sys_getgid16
554 .quad sys_signal
555 .quad sys_geteuid16
556 .quad sys_getegid16 /* 50 */
557 .quad sys_acct
558 .quad sys_umount /* new_umount */
559 .quad quiet_ni_syscall /* old lock syscall holder */
560 .quad compat_sys_ioctl
561 .quad compat_sys_fcntl64 /* 55 */
562 .quad quiet_ni_syscall /* old mpx syscall holder */
563 .quad sys_setpgid
564 .quad quiet_ni_syscall /* old ulimit syscall holder */
Christoph Hellwig5cacdb42010-03-10 15:21:21 -0800565 .quad sys_olduname
Linus Torvalds1da177e2005-04-16 15:20:36 -0700566 .quad sys_umask /* 60 */
567 .quad sys_chroot
Christoph Hellwig2b1c6bd2008-11-28 10:09:09 +0100568 .quad compat_sys_ustat
Linus Torvalds1da177e2005-04-16 15:20:36 -0700569 .quad sys_dup2
570 .quad sys_getppid
571 .quad sys_getpgrp /* 65 */
572 .quad sys_setsid
573 .quad sys32_sigaction
574 .quad sys_sgetmask
575 .quad sys_ssetmask
576 .quad sys_setreuid16 /* 70 */
577 .quad sys_setregid16
Jan Beulich5f0120b2008-06-18 12:42:11 +0100578 .quad sys32_sigsuspend
Linus Torvalds1da177e2005-04-16 15:20:36 -0700579 .quad compat_sys_sigpending
580 .quad sys_sethostname
581 .quad compat_sys_setrlimit /* 75 */
582 .quad compat_sys_old_getrlimit /* old_getrlimit */
583 .quad compat_sys_getrusage
Christoph Hellwigb418da12008-10-15 22:02:06 -0700584 .quad compat_sys_gettimeofday
585 .quad compat_sys_settimeofday
Linus Torvalds1da177e2005-04-16 15:20:36 -0700586 .quad sys_getgroups16 /* 80 */
587 .quad sys_setgroups16
Christoph Hellwig5d0e5282010-03-10 15:21:13 -0800588 .quad compat_sys_old_select
Linus Torvalds1da177e2005-04-16 15:20:36 -0700589 .quad sys_symlink
590 .quad sys_lstat
591 .quad sys_readlink /* 85 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700592 .quad sys_uselib
Linus Torvalds1da177e2005-04-16 15:20:36 -0700593 .quad sys_swapon
594 .quad sys_reboot
595 .quad compat_sys_old_readdir
596 .quad sys32_mmap /* 90 */
597 .quad sys_munmap
598 .quad sys_truncate
599 .quad sys_ftruncate
600 .quad sys_fchmod
601 .quad sys_fchown16 /* 95 */
602 .quad sys_getpriority
603 .quad sys_setpriority
604 .quad quiet_ni_syscall /* old profil syscall holder */
605 .quad compat_sys_statfs
606 .quad compat_sys_fstatfs /* 100 */
607 .quad sys_ioperm
608 .quad compat_sys_socketcall
609 .quad sys_syslog
610 .quad compat_sys_setitimer
611 .quad compat_sys_getitimer /* 105 */
612 .quad compat_sys_newstat
613 .quad compat_sys_newlstat
614 .quad compat_sys_newfstat
Christoph Hellwig5cacdb42010-03-10 15:21:21 -0800615 .quad sys_uname
Linus Torvalds1da177e2005-04-16 15:20:36 -0700616 .quad stub32_iopl /* 110 */
617 .quad sys_vhangup
618 .quad quiet_ni_syscall /* old "idle" system call */
619 .quad sys32_vm86_warning /* vm86old */
620 .quad compat_sys_wait4
621 .quad sys_swapoff /* 115 */
Kyle McMartind4d23ad2007-02-10 01:46:00 -0800622 .quad compat_sys_sysinfo
Linus Torvalds1da177e2005-04-16 15:20:36 -0700623 .quad sys32_ipc
624 .quad sys_fsync
625 .quad stub32_sigreturn
626 .quad stub32_clone /* 120 */
627 .quad sys_setdomainname
Christoph Hellwig4cecd932010-04-20 05:31:02 +0200628 .quad sys_newuname
Linus Torvalds1da177e2005-04-16 15:20:36 -0700629 .quad sys_modify_ldt
Stephen Rothwell3158e942006-03-26 01:37:29 -0800630 .quad compat_sys_adjtimex
Linus Torvalds1da177e2005-04-16 15:20:36 -0700631 .quad sys32_mprotect /* 125 */
632 .quad compat_sys_sigprocmask
633 .quad quiet_ni_syscall /* create_module */
634 .quad sys_init_module
635 .quad sys_delete_module
636 .quad quiet_ni_syscall /* 130 get_kernel_syms */
Vasily Tarasovb7163952007-07-15 23:41:12 -0700637 .quad sys32_quotactl
Linus Torvalds1da177e2005-04-16 15:20:36 -0700638 .quad sys_getpgid
639 .quad sys_fchdir
640 .quad quiet_ni_syscall /* bdflush */
641 .quad sys_sysfs /* 135 */
642 .quad sys_personality
643 .quad quiet_ni_syscall /* for afs_syscall */
644 .quad sys_setfsuid16
645 .quad sys_setfsgid16
646 .quad sys_llseek /* 140 */
647 .quad compat_sys_getdents
648 .quad compat_sys_select
649 .quad sys_flock
650 .quad sys_msync
651 .quad compat_sys_readv /* 145 */
652 .quad compat_sys_writev
653 .quad sys_getsid
654 .quad sys_fdatasync
Eric W. Biedermanc3359fb2009-04-03 00:59:52 -0700655 .quad compat_sys_sysctl /* sysctl */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700656 .quad sys_mlock /* 150 */
657 .quad sys_munlock
658 .quad sys_mlockall
659 .quad sys_munlockall
660 .quad sys_sched_setparam
661 .quad sys_sched_getparam /* 155 */
662 .quad sys_sched_setscheduler
663 .quad sys_sched_getscheduler
664 .quad sys_sched_yield
665 .quad sys_sched_get_priority_max
666 .quad sys_sched_get_priority_min /* 160 */
Alexandr Andreeva9bc3bf2007-03-16 21:07:36 +0100667 .quad sys32_sched_rr_get_interval
Linus Torvalds1da177e2005-04-16 15:20:36 -0700668 .quad compat_sys_nanosleep
669 .quad sys_mremap
670 .quad sys_setresuid16
671 .quad sys_getresuid16 /* 165 */
672 .quad sys32_vm86_warning /* vm86 */
673 .quad quiet_ni_syscall /* query_module */
674 .quad sys_poll
675 .quad compat_sys_nfsservctl
676 .quad sys_setresgid16 /* 170 */
677 .quad sys_getresgid16
678 .quad sys_prctl
679 .quad stub32_rt_sigreturn
680 .quad sys32_rt_sigaction
681 .quad sys32_rt_sigprocmask /* 175 */
682 .quad sys32_rt_sigpending
683 .quad compat_sys_rt_sigtimedwait
684 .quad sys32_rt_sigqueueinfo
Jan Beulich5f0120b2008-06-18 12:42:11 +0100685 .quad sys_rt_sigsuspend
Linus Torvalds1da177e2005-04-16 15:20:36 -0700686 .quad sys32_pread /* 180 */
687 .quad sys32_pwrite
688 .quad sys_chown16
689 .quad sys_getcwd
690 .quad sys_capget
691 .quad sys_capset
692 .quad stub32_sigaltstack
693 .quad sys32_sendfile
694 .quad quiet_ni_syscall /* streams1 */
695 .quad quiet_ni_syscall /* streams2 */
696 .quad stub32_vfork /* 190 */
697 .quad compat_sys_getrlimit
Al Virof8b72562009-11-30 17:37:04 -0500698 .quad sys_mmap_pgoff
Linus Torvalds1da177e2005-04-16 15:20:36 -0700699 .quad sys32_truncate64
700 .quad sys32_ftruncate64
701 .quad sys32_stat64 /* 195 */
702 .quad sys32_lstat64
703 .quad sys32_fstat64
704 .quad sys_lchown
705 .quad sys_getuid
706 .quad sys_getgid /* 200 */
707 .quad sys_geteuid
708 .quad sys_getegid
709 .quad sys_setreuid
710 .quad sys_setregid
711 .quad sys_getgroups /* 205 */
712 .quad sys_setgroups
713 .quad sys_fchown
714 .quad sys_setresuid
715 .quad sys_getresuid
716 .quad sys_setresgid /* 210 */
717 .quad sys_getresgid
718 .quad sys_chown
719 .quad sys_setuid
720 .quad sys_setgid
721 .quad sys_setfsuid /* 215 */
722 .quad sys_setfsgid
723 .quad sys_pivot_root
724 .quad sys_mincore
725 .quad sys_madvise
726 .quad compat_sys_getdents64 /* 220 getdents64 */
727 .quad compat_sys_fcntl64
728 .quad quiet_ni_syscall /* tux */
729 .quad quiet_ni_syscall /* security */
730 .quad sys_gettid
Andi Kleene412ac42007-06-20 12:23:30 +0200731 .quad sys32_readahead /* 225 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700732 .quad sys_setxattr
733 .quad sys_lsetxattr
734 .quad sys_fsetxattr
735 .quad sys_getxattr
736 .quad sys_lgetxattr /* 230 */
737 .quad sys_fgetxattr
738 .quad sys_listxattr
739 .quad sys_llistxattr
740 .quad sys_flistxattr
741 .quad sys_removexattr /* 235 */
742 .quad sys_lremovexattr
743 .quad sys_fremovexattr
744 .quad sys_tkill
745 .quad sys_sendfile64
746 .quad compat_sys_futex /* 240 */
747 .quad compat_sys_sched_setaffinity
748 .quad compat_sys_sched_getaffinity
Roland McGrathefd1ca52008-01-30 13:30:46 +0100749 .quad sys_set_thread_area
750 .quad sys_get_thread_area
Linus Torvalds1da177e2005-04-16 15:20:36 -0700751 .quad compat_sys_io_setup /* 245 */
752 .quad sys_io_destroy
753 .quad compat_sys_io_getevents
754 .quad compat_sys_io_submit
755 .quad sys_io_cancel
Andi Kleene412ac42007-06-20 12:23:30 +0200756 .quad sys32_fadvise64 /* 250 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700757 .quad quiet_ni_syscall /* free_huge_pages */
758 .quad sys_exit_group
759 .quad sys32_lookup_dcookie
760 .quad sys_epoll_create
761 .quad sys_epoll_ctl /* 255 */
762 .quad sys_epoll_wait
763 .quad sys_remap_file_pages
764 .quad sys_set_tid_address
Christoph Hellwig3a0f69d2006-01-09 20:52:08 -0800765 .quad compat_sys_timer_create
Linus Torvalds1da177e2005-04-16 15:20:36 -0700766 .quad compat_sys_timer_settime /* 260 */
767 .quad compat_sys_timer_gettime
768 .quad sys_timer_getoverrun
769 .quad sys_timer_delete
770 .quad compat_sys_clock_settime
771 .quad compat_sys_clock_gettime /* 265 */
772 .quad compat_sys_clock_getres
773 .quad compat_sys_clock_nanosleep
774 .quad compat_sys_statfs64
775 .quad compat_sys_fstatfs64
776 .quad sys_tgkill /* 270 */
777 .quad compat_sys_utimes
778 .quad sys32_fadvise64_64
779 .quad quiet_ni_syscall /* sys_vserver */
780 .quad sys_mbind
781 .quad compat_sys_get_mempolicy /* 275 */
782 .quad sys_set_mempolicy
783 .quad compat_sys_mq_open
784 .quad sys_mq_unlink
785 .quad compat_sys_mq_timedsend
786 .quad compat_sys_mq_timedreceive /* 280 */
787 .quad compat_sys_mq_notify
788 .quad compat_sys_mq_getsetattr
Eric W. Biederman5234f5e2005-06-25 14:58:02 -0700789 .quad compat_sys_kexec_load /* reserved for kexec */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700790 .quad compat_sys_waitid
Robert Love725b38ab2005-07-25 15:19:29 -0400791 .quad quiet_ni_syscall /* 285: sys_altroot */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700792 .quad sys_add_key
793 .quad sys_request_key
794 .quad sys_keyctl
Robert Love725b38ab2005-07-25 15:19:29 -0400795 .quad sys_ioprio_set
796 .quad sys_ioprio_get /* 290 */
797 .quad sys_inotify_init
798 .quad sys_inotify_add_watch
799 .quad sys_inotify_rm_watch
Christoph Lameter39743882006-01-08 01:00:51 -0800800 .quad sys_migrate_pages
Ulrich Dreppera60fc512006-01-18 17:43:56 -0800801 .quad compat_sys_openat /* 295 */
802 .quad sys_mkdirat
803 .quad sys_mknodat
804 .quad sys_fchownat
Andrew Morton3833a702006-02-01 03:04:32 -0800805 .quad compat_sys_futimesat
Ulrich Dreppercff2b762006-02-11 17:55:47 -0800806 .quad sys32_fstatat /* 300 */
Ulrich Dreppera60fc512006-01-18 17:43:56 -0800807 .quad sys_unlinkat
808 .quad sys_renameat
809 .quad sys_linkat
810 .quad sys_symlinkat
811 .quad sys_readlinkat /* 305 */
812 .quad sys_fchmodat
813 .quad sys_faccessat
Andi Kleen957dc872006-09-26 10:52:27 +0200814 .quad compat_sys_pselect6
815 .quad compat_sys_ppoll
Andi Kleen4b88f092006-02-09 00:35:50 +0100816 .quad sys_unshare /* 310 */
Ingo Molnar8fdd6c62006-03-27 01:16:26 -0800817 .quad compat_sys_set_robust_list
818 .quad compat_sys_get_robust_list
Andi Kleenb8feb472006-04-07 19:50:34 +0200819 .quad sys_splice
Andi Kleene412ac42007-06-20 12:23:30 +0200820 .quad sys32_sync_file_range
Ulrich Drepper1c710c82007-05-08 00:33:25 -0700821 .quad sys_tee /* 315 */
Andi Kleend2610202006-05-01 12:15:48 -0700822 .quad compat_sys_vmsplice
Christoph Lameter1b2db9f2006-06-23 02:03:56 -0700823 .quad compat_sys_move_pages
Andi Kleen3cfc3482006-09-26 10:52:28 +0200824 .quad sys_getcpu
Ralf Baechle9af3cf02007-02-13 13:26:26 +0100825 .quad sys_epoll_pwait
Ulrich Drepper1c710c82007-05-08 00:33:25 -0700826 .quad compat_sys_utimensat /* 320 */
Heiko Carstensae7d5c82007-05-12 17:27:41 +0200827 .quad compat_sys_signalfd
Davide Libenzicb9282e2008-02-04 22:27:28 -0800828 .quad sys_timerfd_create
Davide Libenzifdb902b2007-05-10 22:23:20 -0700829 .quad sys_eventfd
Amit Arora97ac7352007-07-17 21:42:44 -0400830 .quad sys32_fallocate
Davide Libenzicb9282e2008-02-04 22:27:28 -0800831 .quad compat_sys_timerfd_settime /* 325 */
832 .quad compat_sys_timerfd_gettime
Ulrich Drepper9deb27b2008-07-23 21:29:24 -0700833 .quad compat_sys_signalfd4
Ulrich Drepperb087498e2008-07-23 21:29:25 -0700834 .quad sys_eventfd2
Ulrich Drepper9fe5ad92008-07-23 21:29:43 -0700835 .quad sys_epoll_create1
Ingo Molnar241771e2008-12-03 10:39:53 +0100836 .quad sys_dup3 /* 330 */
Ulrich Dreppered8cae82008-07-23 21:29:30 -0700837 .quad sys_pipe2
Ulrich Drepper40065532008-07-23 21:29:32 -0700838 .quad sys_inotify_init1
Gerd Hoffmannf3554f42009-04-02 16:59:23 -0700839 .quad compat_sys_preadv
840 .quad compat_sys_pwritev
Thomas Gleixner12d16112009-04-04 21:01:10 +0000841 .quad compat_sys_rt_tgsigqueueinfo /* 335 */
Ingo Molnarcdd6c482009-09-21 12:02:48 +0200842 .quad sys_perf_event_open
Arnaldo Carvalho de Meloa2e27252009-10-12 23:40:10 -0700843 .quad compat_sys_recvmmsg
Eric Paris11637e42009-12-17 21:24:25 -0500844 .quad sys_fanotify_init
Eric Parisbbaa4162009-12-17 21:24:26 -0500845 .quad sys32_fanotify_mark
Linus Torvalds8cbd84f2010-08-10 15:35:10 -0700846 .quad sys_prlimit64 /* 340 */
Aneesh Kumar K.V6aae5f22011-01-29 18:43:37 +0530847 .quad sys_name_to_handle_at
848 .quad compat_sys_open_by_handle_at
Richard Cochrance26efd2011-02-01 13:52:30 +0000849 .quad compat_sys_clock_adjtime
Sage Weilb7ed78f2011-03-10 11:31:30 -0800850 .quad sys_syncfs
Anton Blanchard228e5482011-05-02 20:21:35 +0000851 .quad compat_sys_sendmmsg /* 345 */
Eric W. Biederman7b21fdd2011-05-27 19:28:27 -0700852 .quad sys_setns
Heiko Carstensae7d5c82007-05-12 17:27:41 +0200853ia32_syscall_end: