Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 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 Ravnborg | e2d5df9 | 2005-09-09 21:28:48 +0200 | [diff] [blame] | 9 | #include <asm/asm-offsets.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | #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 Molnar | 2601e64 | 2006-07-03 00:24:45 -0700 | [diff] [blame] | 15 | #include <asm/irqflags.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | #include <linux/linkage.h> |
| 17 | |
Roland McGrath | 5cbf156 | 2008-06-24 01:13:31 -0700 | [diff] [blame] | 18 | /* 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 Beulich | 24e3580 | 2009-09-30 11:22:11 +0100 | [diff] [blame] | 24 | #define sysexit_audit ia32_ret_from_sys_call |
| 25 | #define sysretl_audit ia32_ret_from_sys_call |
Roland McGrath | 5cbf156 | 2008-06-24 01:13:31 -0700 | [diff] [blame] | 26 | #endif |
| 27 | |
Andi Kleen | 67d53ea | 2006-04-07 19:50:31 +0200 | [diff] [blame] | 28 | #define IA32_NR_syscalls ((ia32_syscall_end - ia32_sys_call_table)/8) |
| 29 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | .macro IA32_ARG_FIXUP noebp=0 |
| 31 | movl %edi,%r8d |
| 32 | .if \noebp |
| 33 | .else |
| 34 | movl %ebp,%r9d |
| 35 | .endif |
| 36 | xchg %ecx,%esi |
| 37 | movl %ebx,%edi |
| 38 | movl %edx,%edx /* zero extension */ |
| 39 | .endm |
| 40 | |
| 41 | /* clobbers %eax */ |
Jan Beulich | 24e3580 | 2009-09-30 11:22:11 +0100 | [diff] [blame] | 42 | .macro CLEAR_RREGS offset=0, _r9=rax |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | xorl %eax,%eax |
Jan Beulich | 24e3580 | 2009-09-30 11:22:11 +0100 | [diff] [blame] | 44 | movq %rax,\offset+R11(%rsp) |
| 45 | movq %rax,\offset+R10(%rsp) |
| 46 | movq %\_r9,\offset+R9(%rsp) |
| 47 | movq %rax,\offset+R8(%rsp) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | .endm |
| 49 | |
Roland McGrath | d4d6715 | 2008-07-09 02:38:07 -0700 | [diff] [blame] | 50 | /* |
| 51 | * Reload arg registers from stack in case ptrace changed them. |
| 52 | * We don't reload %eax because syscall_trace_enter() returned |
Roland McGrath | eefdca0 | 2010-09-14 12:22:58 -0700 | [diff] [blame] | 53 | * the %rax value we should see. Instead, we just truncate that |
| 54 | * value to 32 bits again as we did on entry from user mode. |
| 55 | * If it's a new value set by user_regset during entry tracing, |
| 56 | * this matches the normal truncation of the user-mode value. |
| 57 | * If it's -1 to make us punt the syscall, then (u32)-1 is still |
| 58 | * an appropriately invalid value. |
Roland McGrath | d4d6715 | 2008-07-09 02:38:07 -0700 | [diff] [blame] | 59 | */ |
Jan Beulich | 295286a | 2008-08-29 13:21:11 +0100 | [diff] [blame] | 60 | .macro LOAD_ARGS32 offset, _r9=0 |
| 61 | .if \_r9 |
Andi Kleen | 176df24 | 2007-09-21 16:16:18 +0200 | [diff] [blame] | 62 | movl \offset+16(%rsp),%r9d |
Jan Beulich | 295286a | 2008-08-29 13:21:11 +0100 | [diff] [blame] | 63 | .endif |
Andi Kleen | 176df24 | 2007-09-21 16:16:18 +0200 | [diff] [blame] | 64 | movl \offset+40(%rsp),%ecx |
| 65 | movl \offset+48(%rsp),%edx |
| 66 | movl \offset+56(%rsp),%esi |
| 67 | movl \offset+64(%rsp),%edi |
Roland McGrath | eefdca0 | 2010-09-14 12:22:58 -0700 | [diff] [blame] | 68 | movl %eax,%eax /* zero extension */ |
Andi Kleen | 176df24 | 2007-09-21 16:16:18 +0200 | [diff] [blame] | 69 | .endm |
| 70 | |
Jan Beulich | 2765130 | 2006-01-11 22:41:59 +0100 | [diff] [blame] | 71 | .macro CFI_STARTPROC32 simple |
| 72 | CFI_STARTPROC \simple |
| 73 | CFI_UNDEFINED r8 |
| 74 | CFI_UNDEFINED r9 |
| 75 | CFI_UNDEFINED r10 |
| 76 | CFI_UNDEFINED r11 |
| 77 | CFI_UNDEFINED r12 |
| 78 | CFI_UNDEFINED r13 |
| 79 | CFI_UNDEFINED r14 |
| 80 | CFI_UNDEFINED r15 |
| 81 | .endm |
| 82 | |
Jeremy Fitzhardinge | 2be2998 | 2008-06-25 00:19:28 -0400 | [diff] [blame] | 83 | #ifdef CONFIG_PARAVIRT |
| 84 | ENTRY(native_usergs_sysret32) |
| 85 | swapgs |
| 86 | sysretl |
| 87 | ENDPROC(native_usergs_sysret32) |
| 88 | |
| 89 | ENTRY(native_irq_enable_sysexit) |
| 90 | swapgs |
| 91 | sti |
| 92 | sysexit |
| 93 | ENDPROC(native_irq_enable_sysexit) |
| 94 | #endif |
| 95 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 96 | /* |
| 97 | * 32bit SYSENTER instruction entry. |
| 98 | * |
| 99 | * Arguments: |
| 100 | * %eax System call number. |
| 101 | * %ebx Arg1 |
| 102 | * %ecx Arg2 |
| 103 | * %edx Arg3 |
| 104 | * %esi Arg4 |
| 105 | * %edi Arg5 |
| 106 | * %ebp user stack |
| 107 | * 0(%ebp) Arg6 |
| 108 | * |
| 109 | * Interrupts off. |
| 110 | * |
| 111 | * This is purely a fast path. For anything complicated we use the int 0x80 |
| 112 | * path below. Set up a complete hardware stack frame to share code |
| 113 | * with the int 0x80 path. |
| 114 | */ |
| 115 | ENTRY(ia32_sysenter_target) |
Jan Beulich | 2765130 | 2006-01-11 22:41:59 +0100 | [diff] [blame] | 116 | CFI_STARTPROC32 simple |
Jan Beulich | adf1423 | 2006-09-26 10:52:41 +0200 | [diff] [blame] | 117 | CFI_SIGNAL_FRAME |
Jan Beulich | 7effaa8 | 2005-09-12 18:49:24 +0200 | [diff] [blame] | 118 | CFI_DEF_CFA rsp,0 |
| 119 | CFI_REGISTER rsp,rbp |
Jeremy Fitzhardinge | 457da70 | 2008-06-26 07:28:51 -0700 | [diff] [blame] | 120 | SWAPGS_UNSAFE_STACK |
Brian Gerst | 9af4565 | 2009-01-19 00:38:58 +0900 | [diff] [blame] | 121 | movq PER_CPU_VAR(kernel_stack), %rsp |
| 122 | addq $(KERNEL_STACK_OFFSET),%rsp |
Ingo Molnar | 2601e64 | 2006-07-03 00:24:45 -0700 | [diff] [blame] | 123 | /* |
| 124 | * No need to follow this irqs on/off section: the syscall |
| 125 | * disabled irqs, here we enable it straight after entry: |
| 126 | */ |
Jeremy Fitzhardinge | 6680415 | 2008-06-25 00:19:29 -0400 | [diff] [blame] | 127 | ENABLE_INTERRUPTS(CLBR_NONE) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 128 | movl %ebp,%ebp /* zero extension */ |
Jan Beulich | 60cf637 | 2011-02-28 15:54:40 +0000 | [diff] [blame^] | 129 | pushq_cfi $__USER32_DS |
Jan Beulich | 7effaa8 | 2005-09-12 18:49:24 +0200 | [diff] [blame] | 130 | /*CFI_REL_OFFSET ss,0*/ |
Jan Beulich | 60cf637 | 2011-02-28 15:54:40 +0000 | [diff] [blame^] | 131 | pushq_cfi %rbp |
Jan Beulich | 7effaa8 | 2005-09-12 18:49:24 +0200 | [diff] [blame] | 132 | CFI_REL_OFFSET rsp,0 |
Jan Beulich | 60cf637 | 2011-02-28 15:54:40 +0000 | [diff] [blame^] | 133 | pushfq_cfi |
Jan Beulich | 7effaa8 | 2005-09-12 18:49:24 +0200 | [diff] [blame] | 134 | /*CFI_REL_OFFSET rflags,0*/ |
Glauber Costa | 26ccb8a | 2008-06-24 11:19:35 -0300 | [diff] [blame] | 135 | movl 8*3-THREAD_SIZE+TI_sysenter_return(%rsp), %r10d |
Jan Beulich | 7effaa8 | 2005-09-12 18:49:24 +0200 | [diff] [blame] | 136 | CFI_REGISTER rip,r10 |
Jan Beulich | 60cf637 | 2011-02-28 15:54:40 +0000 | [diff] [blame^] | 137 | pushq_cfi $__USER32_CS |
Jan Beulich | 7effaa8 | 2005-09-12 18:49:24 +0200 | [diff] [blame] | 138 | /*CFI_REL_OFFSET cs,0*/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 139 | movl %eax, %eax |
Jan Beulich | 60cf637 | 2011-02-28 15:54:40 +0000 | [diff] [blame^] | 140 | pushq_cfi %r10 |
Jan Beulich | 7effaa8 | 2005-09-12 18:49:24 +0200 | [diff] [blame] | 141 | CFI_REL_OFFSET rip,0 |
Jan Beulich | 60cf637 | 2011-02-28 15:54:40 +0000 | [diff] [blame^] | 142 | pushq_cfi %rax |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 143 | cld |
Jan Beulich | cdc1793 | 2007-07-21 17:10:20 +0200 | [diff] [blame] | 144 | SAVE_ARGS 0,0,1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 145 | /* no need to do an access_ok check here because rbp has been |
| 146 | 32bit zero extended */ |
Jan Beulich | 295286a | 2008-08-29 13:21:11 +0100 | [diff] [blame] | 147 | 1: movl (%rbp),%ebp |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 148 | .section __ex_table,"a" |
| 149 | .quad 1b,ia32_badarg |
| 150 | .previous |
| 151 | GET_THREAD_INFO(%r10) |
Glauber Costa | 26ccb8a | 2008-06-24 11:19:35 -0300 | [diff] [blame] | 152 | orl $TS_COMPAT,TI_status(%r10) |
Roland McGrath | d4d6715 | 2008-07-09 02:38:07 -0700 | [diff] [blame] | 153 | testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10) |
Jan Beulich | 7effaa8 | 2005-09-12 18:49:24 +0200 | [diff] [blame] | 154 | CFI_REMEMBER_STATE |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 155 | jnz sysenter_tracesys |
H. Peter Anvin | 36d001c | 2010-09-14 12:42:41 -0700 | [diff] [blame] | 156 | cmpq $(IA32_NR_syscalls-1),%rax |
Andi Kleen | 67d53ea | 2006-04-07 19:50:31 +0200 | [diff] [blame] | 157 | ja ia32_badsys |
Roland McGrath | d4d6715 | 2008-07-09 02:38:07 -0700 | [diff] [blame] | 158 | sysenter_do_call: |
Jan Beulich | 295286a | 2008-08-29 13:21:11 +0100 | [diff] [blame] | 159 | IA32_ARG_FIXUP |
Roland McGrath | 5cbf156 | 2008-06-24 01:13:31 -0700 | [diff] [blame] | 160 | sysenter_dispatch: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 161 | call *ia32_sys_call_table(,%rax,8) |
| 162 | movq %rax,RAX-ARGOFFSET(%rsp) |
| 163 | GET_THREAD_INFO(%r10) |
Jeremy Fitzhardinge | 6680415 | 2008-06-25 00:19:29 -0400 | [diff] [blame] | 164 | DISABLE_INTERRUPTS(CLBR_NONE) |
Ingo Molnar | 2601e64 | 2006-07-03 00:24:45 -0700 | [diff] [blame] | 165 | TRACE_IRQS_OFF |
Glauber Costa | 26ccb8a | 2008-06-24 11:19:35 -0300 | [diff] [blame] | 166 | testl $_TIF_ALLWORK_MASK,TI_flags(%r10) |
Roland McGrath | 5cbf156 | 2008-06-24 01:13:31 -0700 | [diff] [blame] | 167 | jnz sysexit_audit |
| 168 | sysexit_from_sys_call: |
Glauber Costa | 26ccb8a | 2008-06-24 11:19:35 -0300 | [diff] [blame] | 169 | andl $~TS_COMPAT,TI_status(%r10) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 170 | /* clear IF, that popfq doesn't enable interrupts early */ |
| 171 | andl $~0x200,EFLAGS-R11(%rsp) |
Roland McGrath | 36197c9 | 2008-01-30 13:30:43 +0100 | [diff] [blame] | 172 | movl RIP-R11(%rsp),%edx /* User %eip */ |
| 173 | CFI_REGISTER rip,rdx |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 174 | RESTORE_ARGS 1,24,1,1,1,1 |
Jan Beulich | 24e3580 | 2009-09-30 11:22:11 +0100 | [diff] [blame] | 175 | xorq %r8,%r8 |
| 176 | xorq %r9,%r9 |
| 177 | xorq %r10,%r10 |
| 178 | xorq %r11,%r11 |
Jan Beulich | 60cf637 | 2011-02-28 15:54:40 +0000 | [diff] [blame^] | 179 | popfq_cfi |
Jan Beulich | 7effaa8 | 2005-09-12 18:49:24 +0200 | [diff] [blame] | 180 | /*CFI_RESTORE rflags*/ |
Jan Beulich | 60cf637 | 2011-02-28 15:54:40 +0000 | [diff] [blame^] | 181 | popq_cfi %rcx /* User %esp */ |
Jan Beulich | 7effaa8 | 2005-09-12 18:49:24 +0200 | [diff] [blame] | 182 | CFI_REGISTER rsp,rcx |
Ingo Molnar | 2601e64 | 2006-07-03 00:24:45 -0700 | [diff] [blame] | 183 | TRACE_IRQS_ON |
Jeremy Fitzhardinge | 2be2998 | 2008-06-25 00:19:28 -0400 | [diff] [blame] | 184 | ENABLE_INTERRUPTS_SYSEXIT32 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 185 | |
Roland McGrath | 5cbf156 | 2008-06-24 01:13:31 -0700 | [diff] [blame] | 186 | #ifdef CONFIG_AUDITSYSCALL |
| 187 | .macro auditsys_entry_common |
| 188 | movl %esi,%r9d /* 6th arg: 4th syscall arg */ |
| 189 | movl %edx,%r8d /* 5th arg: 3rd syscall arg */ |
| 190 | /* (already in %ecx) 4th arg: 2nd syscall arg */ |
| 191 | movl %ebx,%edx /* 3rd arg: 1st syscall arg */ |
| 192 | movl %eax,%esi /* 2nd arg: syscall number */ |
| 193 | movl $AUDIT_ARCH_I386,%edi /* 1st arg: audit arch */ |
| 194 | call audit_syscall_entry |
| 195 | movl RAX-ARGOFFSET(%rsp),%eax /* reload syscall number */ |
H. Peter Anvin | 36d001c | 2010-09-14 12:42:41 -0700 | [diff] [blame] | 196 | cmpq $(IA32_NR_syscalls-1),%rax |
Roland McGrath | 5cbf156 | 2008-06-24 01:13:31 -0700 | [diff] [blame] | 197 | ja ia32_badsys |
| 198 | movl %ebx,%edi /* reload 1st syscall arg */ |
| 199 | movl RCX-ARGOFFSET(%rsp),%esi /* reload 2nd syscall arg */ |
| 200 | movl RDX-ARGOFFSET(%rsp),%edx /* reload 3rd syscall arg */ |
| 201 | movl RSI-ARGOFFSET(%rsp),%ecx /* reload 4th syscall arg */ |
| 202 | movl RDI-ARGOFFSET(%rsp),%r8d /* reload 5th syscall arg */ |
| 203 | .endm |
| 204 | |
Jan Beulich | 8176674 | 2009-10-26 15:20:29 +0000 | [diff] [blame] | 205 | .macro auditsys_exit exit |
Roland McGrath | 5cbf156 | 2008-06-24 01:13:31 -0700 | [diff] [blame] | 206 | testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10) |
Jan Beulich | 24e3580 | 2009-09-30 11:22:11 +0100 | [diff] [blame] | 207 | jnz ia32_ret_from_sys_call |
Roland McGrath | 5cbf156 | 2008-06-24 01:13:31 -0700 | [diff] [blame] | 208 | TRACE_IRQS_ON |
| 209 | sti |
| 210 | movl %eax,%esi /* second arg, syscall return value */ |
| 211 | cmpl $0,%eax /* is it < 0? */ |
| 212 | setl %al /* 1 if so, 0 if not */ |
| 213 | movzbl %al,%edi /* zero-extend that into %edi */ |
| 214 | inc %edi /* first arg, 0->1(AUDITSC_SUCCESS), 1->2(AUDITSC_FAILURE) */ |
| 215 | call audit_syscall_exit |
| 216 | GET_THREAD_INFO(%r10) |
| 217 | movl RAX-ARGOFFSET(%rsp),%eax /* reload syscall return value */ |
Roland McGrath | 5cbf156 | 2008-06-24 01:13:31 -0700 | [diff] [blame] | 218 | movl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),%edi |
| 219 | cli |
| 220 | TRACE_IRQS_OFF |
| 221 | testl %edi,TI_flags(%r10) |
Jan Beulich | 24e3580 | 2009-09-30 11:22:11 +0100 | [diff] [blame] | 222 | jz \exit |
| 223 | CLEAR_RREGS -ARGOFFSET |
| 224 | jmp int_with_check |
Roland McGrath | 5cbf156 | 2008-06-24 01:13:31 -0700 | [diff] [blame] | 225 | .endm |
| 226 | |
| 227 | sysenter_auditsys: |
Jan Beulich | 7effaa8 | 2005-09-12 18:49:24 +0200 | [diff] [blame] | 228 | CFI_RESTORE_STATE |
Roland McGrath | 5cbf156 | 2008-06-24 01:13:31 -0700 | [diff] [blame] | 229 | auditsys_entry_common |
| 230 | movl %ebp,%r9d /* reload 6th syscall arg */ |
| 231 | jmp sysenter_dispatch |
| 232 | |
| 233 | sysexit_audit: |
| 234 | auditsys_exit sysexit_from_sys_call |
| 235 | #endif |
| 236 | |
| 237 | sysenter_tracesys: |
Roland McGrath | 5cbf156 | 2008-06-24 01:13:31 -0700 | [diff] [blame] | 238 | #ifdef CONFIG_AUDITSYSCALL |
| 239 | testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10) |
| 240 | jz sysenter_auditsys |
| 241 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 242 | SAVE_REST |
| 243 | CLEAR_RREGS |
Roland McGrath | 48ee679 | 2008-03-18 18:23:50 -0700 | [diff] [blame] | 244 | movq $-ENOSYS,RAX(%rsp)/* ptrace can change this for a bad syscall */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 245 | movq %rsp,%rdi /* &pt_regs -> arg1 */ |
| 246 | call syscall_trace_enter |
Andi Kleen | 176df24 | 2007-09-21 16:16:18 +0200 | [diff] [blame] | 247 | LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 248 | RESTORE_REST |
H. Peter Anvin | 36d001c | 2010-09-14 12:42:41 -0700 | [diff] [blame] | 249 | cmpq $(IA32_NR_syscalls-1),%rax |
Roland McGrath | 48ee679 | 2008-03-18 18:23:50 -0700 | [diff] [blame] | 250 | ja int_ret_from_sys_call /* sysenter_tracesys has set RAX(%rsp) */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 251 | jmp sysenter_do_call |
| 252 | CFI_ENDPROC |
Jan Beulich | 4b787e0 | 2006-06-26 13:56:55 +0200 | [diff] [blame] | 253 | ENDPROC(ia32_sysenter_target) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 254 | |
| 255 | /* |
| 256 | * 32bit SYSCALL instruction entry. |
| 257 | * |
| 258 | * Arguments: |
| 259 | * %eax System call number. |
| 260 | * %ebx Arg1 |
| 261 | * %ecx return EIP |
| 262 | * %edx Arg3 |
| 263 | * %esi Arg4 |
| 264 | * %edi Arg5 |
| 265 | * %ebp Arg2 [note: not saved in the stack frame, should not be touched] |
| 266 | * %esp user stack |
| 267 | * 0(%esp) Arg6 |
| 268 | * |
| 269 | * Interrupts off. |
| 270 | * |
| 271 | * This is purely a fast path. For anything complicated we use the int 0x80 |
| 272 | * path below. Set up a complete hardware stack frame to share code |
| 273 | * with the int 0x80 path. |
| 274 | */ |
| 275 | ENTRY(ia32_cstar_target) |
Jan Beulich | 2765130 | 2006-01-11 22:41:59 +0100 | [diff] [blame] | 276 | CFI_STARTPROC32 simple |
Jan Beulich | adf1423 | 2006-09-26 10:52:41 +0200 | [diff] [blame] | 277 | CFI_SIGNAL_FRAME |
Brian Gerst | 9af4565 | 2009-01-19 00:38:58 +0900 | [diff] [blame] | 278 | CFI_DEF_CFA rsp,KERNEL_STACK_OFFSET |
Jan Beulich | 7effaa8 | 2005-09-12 18:49:24 +0200 | [diff] [blame] | 279 | CFI_REGISTER rip,rcx |
| 280 | /*CFI_REGISTER rflags,r11*/ |
Jeremy Fitzhardinge | 457da70 | 2008-06-26 07:28:51 -0700 | [diff] [blame] | 281 | SWAPGS_UNSAFE_STACK |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 282 | movl %esp,%r8d |
Jan Beulich | 7effaa8 | 2005-09-12 18:49:24 +0200 | [diff] [blame] | 283 | CFI_REGISTER rsp,r8 |
Brian Gerst | 9af4565 | 2009-01-19 00:38:58 +0900 | [diff] [blame] | 284 | movq PER_CPU_VAR(kernel_stack),%rsp |
Ingo Molnar | 2601e64 | 2006-07-03 00:24:45 -0700 | [diff] [blame] | 285 | /* |
| 286 | * No need to follow this irqs on/off section: the syscall |
| 287 | * disabled irqs and here we enable it straight after entry: |
| 288 | */ |
Jeremy Fitzhardinge | 6680415 | 2008-06-25 00:19:29 -0400 | [diff] [blame] | 289 | ENABLE_INTERRUPTS(CLBR_NONE) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 290 | SAVE_ARGS 8,1,1 |
| 291 | movl %eax,%eax /* zero extension */ |
| 292 | movq %rax,ORIG_RAX-ARGOFFSET(%rsp) |
| 293 | movq %rcx,RIP-ARGOFFSET(%rsp) |
Jan Beulich | 7effaa8 | 2005-09-12 18:49:24 +0200 | [diff] [blame] | 294 | CFI_REL_OFFSET rip,RIP-ARGOFFSET |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 295 | movq %rbp,RCX-ARGOFFSET(%rsp) /* this lies slightly to ptrace */ |
| 296 | movl %ebp,%ecx |
| 297 | movq $__USER32_CS,CS-ARGOFFSET(%rsp) |
| 298 | movq $__USER32_DS,SS-ARGOFFSET(%rsp) |
| 299 | movq %r11,EFLAGS-ARGOFFSET(%rsp) |
Jan Beulich | 7effaa8 | 2005-09-12 18:49:24 +0200 | [diff] [blame] | 300 | /*CFI_REL_OFFSET rflags,EFLAGS-ARGOFFSET*/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 301 | movq %r8,RSP-ARGOFFSET(%rsp) |
Jan Beulich | 7effaa8 | 2005-09-12 18:49:24 +0200 | [diff] [blame] | 302 | CFI_REL_OFFSET rsp,RSP-ARGOFFSET |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 303 | /* no need to do an access_ok check here because r8 has been |
| 304 | 32bit zero extended */ |
| 305 | /* hardware stack frame is complete now */ |
| 306 | 1: movl (%r8),%r9d |
| 307 | .section __ex_table,"a" |
| 308 | .quad 1b,ia32_badarg |
| 309 | .previous |
| 310 | GET_THREAD_INFO(%r10) |
Glauber Costa | 26ccb8a | 2008-06-24 11:19:35 -0300 | [diff] [blame] | 311 | orl $TS_COMPAT,TI_status(%r10) |
Roland McGrath | d4d6715 | 2008-07-09 02:38:07 -0700 | [diff] [blame] | 312 | testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10) |
Jan Beulich | 7effaa8 | 2005-09-12 18:49:24 +0200 | [diff] [blame] | 313 | CFI_REMEMBER_STATE |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 314 | jnz cstar_tracesys |
H. Peter Anvin | 36d001c | 2010-09-14 12:42:41 -0700 | [diff] [blame] | 315 | cmpq $IA32_NR_syscalls-1,%rax |
Andi Kleen | 67d53ea | 2006-04-07 19:50:31 +0200 | [diff] [blame] | 316 | ja ia32_badsys |
Jan Beulich | 295286a | 2008-08-29 13:21:11 +0100 | [diff] [blame] | 317 | cstar_do_call: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 318 | IA32_ARG_FIXUP 1 |
Roland McGrath | 5cbf156 | 2008-06-24 01:13:31 -0700 | [diff] [blame] | 319 | cstar_dispatch: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 320 | call *ia32_sys_call_table(,%rax,8) |
| 321 | movq %rax,RAX-ARGOFFSET(%rsp) |
| 322 | GET_THREAD_INFO(%r10) |
Jeremy Fitzhardinge | 6680415 | 2008-06-25 00:19:29 -0400 | [diff] [blame] | 323 | DISABLE_INTERRUPTS(CLBR_NONE) |
Ingo Molnar | 2601e64 | 2006-07-03 00:24:45 -0700 | [diff] [blame] | 324 | TRACE_IRQS_OFF |
Glauber Costa | 26ccb8a | 2008-06-24 11:19:35 -0300 | [diff] [blame] | 325 | testl $_TIF_ALLWORK_MASK,TI_flags(%r10) |
Roland McGrath | 5cbf156 | 2008-06-24 01:13:31 -0700 | [diff] [blame] | 326 | jnz sysretl_audit |
| 327 | sysretl_from_sys_call: |
Glauber Costa | 26ccb8a | 2008-06-24 11:19:35 -0300 | [diff] [blame] | 328 | andl $~TS_COMPAT,TI_status(%r10) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 329 | RESTORE_ARGS 1,-ARG_SKIP,1,1,1 |
| 330 | movl RIP-ARGOFFSET(%rsp),%ecx |
Jan Beulich | 7effaa8 | 2005-09-12 18:49:24 +0200 | [diff] [blame] | 331 | CFI_REGISTER rip,rcx |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 332 | movl EFLAGS-ARGOFFSET(%rsp),%r11d |
Jan Beulich | 7effaa8 | 2005-09-12 18:49:24 +0200 | [diff] [blame] | 333 | /*CFI_REGISTER rflags,r11*/ |
Jan Beulich | 24e3580 | 2009-09-30 11:22:11 +0100 | [diff] [blame] | 334 | xorq %r10,%r10 |
| 335 | xorq %r9,%r9 |
| 336 | xorq %r8,%r8 |
Ingo Molnar | 2601e64 | 2006-07-03 00:24:45 -0700 | [diff] [blame] | 337 | TRACE_IRQS_ON |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 338 | movl RSP-ARGOFFSET(%rsp),%esp |
Jan Beulich | 7effaa8 | 2005-09-12 18:49:24 +0200 | [diff] [blame] | 339 | CFI_RESTORE rsp |
Jeremy Fitzhardinge | 2be2998 | 2008-06-25 00:19:28 -0400 | [diff] [blame] | 340 | USERGS_SYSRET32 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 341 | |
Roland McGrath | 5cbf156 | 2008-06-24 01:13:31 -0700 | [diff] [blame] | 342 | #ifdef CONFIG_AUDITSYSCALL |
| 343 | cstar_auditsys: |
Jan Beulich | 7effaa8 | 2005-09-12 18:49:24 +0200 | [diff] [blame] | 344 | CFI_RESTORE_STATE |
Roland McGrath | 5cbf156 | 2008-06-24 01:13:31 -0700 | [diff] [blame] | 345 | movl %r9d,R9-ARGOFFSET(%rsp) /* register to be clobbered by call */ |
| 346 | auditsys_entry_common |
| 347 | movl R9-ARGOFFSET(%rsp),%r9d /* reload 6th syscall arg */ |
| 348 | jmp cstar_dispatch |
| 349 | |
| 350 | sysretl_audit: |
Jan Beulich | 8176674 | 2009-10-26 15:20:29 +0000 | [diff] [blame] | 351 | auditsys_exit sysretl_from_sys_call |
Roland McGrath | 5cbf156 | 2008-06-24 01:13:31 -0700 | [diff] [blame] | 352 | #endif |
| 353 | |
| 354 | cstar_tracesys: |
| 355 | #ifdef CONFIG_AUDITSYSCALL |
| 356 | testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10) |
| 357 | jz cstar_auditsys |
| 358 | #endif |
Chuck Ebbert | ecd744e | 2007-11-07 10:48:39 -0500 | [diff] [blame] | 359 | xchgl %r9d,%ebp |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 360 | SAVE_REST |
Jan Beulich | 24e3580 | 2009-09-30 11:22:11 +0100 | [diff] [blame] | 361 | CLEAR_RREGS 0, r9 |
Roland McGrath | 48ee679 | 2008-03-18 18:23:50 -0700 | [diff] [blame] | 362 | movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 363 | movq %rsp,%rdi /* &pt_regs -> arg1 */ |
| 364 | call syscall_trace_enter |
Jan Beulich | 295286a | 2008-08-29 13:21:11 +0100 | [diff] [blame] | 365 | LOAD_ARGS32 ARGOFFSET, 1 /* reload args from stack in case ptrace changed it */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 366 | RESTORE_REST |
Chuck Ebbert | ecd744e | 2007-11-07 10:48:39 -0500 | [diff] [blame] | 367 | xchgl %ebp,%r9d |
H. Peter Anvin | 36d001c | 2010-09-14 12:42:41 -0700 | [diff] [blame] | 368 | cmpq $(IA32_NR_syscalls-1),%rax |
Roland McGrath | 48ee679 | 2008-03-18 18:23:50 -0700 | [diff] [blame] | 369 | ja int_ret_from_sys_call /* cstar_tracesys has set RAX(%rsp) */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 370 | jmp cstar_do_call |
Jan Beulich | 4b787e0 | 2006-06-26 13:56:55 +0200 | [diff] [blame] | 371 | END(ia32_cstar_target) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 372 | |
| 373 | ia32_badarg: |
| 374 | movq $-EFAULT,%rax |
| 375 | jmp ia32_sysret |
| 376 | CFI_ENDPROC |
| 377 | |
| 378 | /* |
| 379 | * Emulated IA32 system calls via int 0x80. |
| 380 | * |
| 381 | * Arguments: |
| 382 | * %eax System call number. |
| 383 | * %ebx Arg1 |
| 384 | * %ecx Arg2 |
| 385 | * %edx Arg3 |
| 386 | * %esi Arg4 |
| 387 | * %edi Arg5 |
| 388 | * %ebp Arg6 [note: not saved in the stack frame, should not be touched] |
| 389 | * |
| 390 | * Notes: |
| 391 | * Uses the same stack frame as the x86-64 version. |
| 392 | * All registers except %eax must be saved (but ptrace may violate that) |
| 393 | * Arguments are zero extended. For system calls that want sign extension and |
| 394 | * take long arguments a wrapper is needed. Most calls can just be called |
| 395 | * directly. |
| 396 | * Assumes it is only called from user space and entered with interrupts off. |
| 397 | */ |
| 398 | |
| 399 | ENTRY(ia32_syscall) |
Jan Beulich | cdc1793 | 2007-07-21 17:10:20 +0200 | [diff] [blame] | 400 | CFI_STARTPROC32 simple |
Jan Beulich | adf1423 | 2006-09-26 10:52:41 +0200 | [diff] [blame] | 401 | CFI_SIGNAL_FRAME |
Jan Beulich | 7effaa8 | 2005-09-12 18:49:24 +0200 | [diff] [blame] | 402 | CFI_DEF_CFA rsp,SS+8-RIP |
| 403 | /*CFI_REL_OFFSET ss,SS-RIP*/ |
| 404 | CFI_REL_OFFSET rsp,RSP-RIP |
| 405 | /*CFI_REL_OFFSET rflags,EFLAGS-RIP*/ |
| 406 | /*CFI_REL_OFFSET cs,CS-RIP*/ |
| 407 | CFI_REL_OFFSET rip,RIP-RIP |
Jeremy Fitzhardinge | 360c044 | 2008-07-08 15:06:28 -0700 | [diff] [blame] | 408 | PARAVIRT_ADJUST_EXCEPTION_FRAME |
Jeremy Fitzhardinge | 6680415 | 2008-06-25 00:19:29 -0400 | [diff] [blame] | 409 | SWAPGS |
Ingo Molnar | 2601e64 | 2006-07-03 00:24:45 -0700 | [diff] [blame] | 410 | /* |
| 411 | * No need to follow this irqs on/off section: the syscall |
| 412 | * disabled irqs and here we enable it straight after entry: |
| 413 | */ |
Jeremy Fitzhardinge | 6680415 | 2008-06-25 00:19:29 -0400 | [diff] [blame] | 414 | ENABLE_INTERRUPTS(CLBR_NONE) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 415 | movl %eax,%eax |
Jan Beulich | 60cf637 | 2011-02-28 15:54:40 +0000 | [diff] [blame^] | 416 | pushq_cfi %rax |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 417 | cld |
| 418 | /* note the registers are not zero extended to the sf. |
| 419 | this could be a problem. */ |
| 420 | SAVE_ARGS 0,0,1 |
| 421 | GET_THREAD_INFO(%r10) |
Glauber Costa | 26ccb8a | 2008-06-24 11:19:35 -0300 | [diff] [blame] | 422 | orl $TS_COMPAT,TI_status(%r10) |
Roland McGrath | d4d6715 | 2008-07-09 02:38:07 -0700 | [diff] [blame] | 423 | testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 424 | jnz ia32_tracesys |
H. Peter Anvin | 36d001c | 2010-09-14 12:42:41 -0700 | [diff] [blame] | 425 | cmpq $(IA32_NR_syscalls-1),%rax |
Roland McGrath | c09249f | 2009-02-06 18:15:18 -0800 | [diff] [blame] | 426 | ja ia32_badsys |
| 427 | ia32_do_call: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 428 | IA32_ARG_FIXUP |
| 429 | call *ia32_sys_call_table(,%rax,8) # xxx: rip relative |
| 430 | ia32_sysret: |
| 431 | movq %rax,RAX-ARGOFFSET(%rsp) |
Jan Beulich | 24e3580 | 2009-09-30 11:22:11 +0100 | [diff] [blame] | 432 | ia32_ret_from_sys_call: |
| 433 | CLEAR_RREGS -ARGOFFSET |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 434 | jmp int_ret_from_sys_call |
| 435 | |
| 436 | ia32_tracesys: |
| 437 | SAVE_REST |
Jan Beulich | cdc1793 | 2007-07-21 17:10:20 +0200 | [diff] [blame] | 438 | CLEAR_RREGS |
Roland McGrath | 8ab32bb | 2008-03-16 21:57:41 -0700 | [diff] [blame] | 439 | movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 440 | movq %rsp,%rdi /* &pt_regs -> arg1 */ |
| 441 | call syscall_trace_enter |
Andi Kleen | 176df24 | 2007-09-21 16:16:18 +0200 | [diff] [blame] | 442 | LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 443 | RESTORE_REST |
H. Peter Anvin | 36d001c | 2010-09-14 12:42:41 -0700 | [diff] [blame] | 444 | cmpq $(IA32_NR_syscalls-1),%rax |
Roland McGrath | c09249f | 2009-02-06 18:15:18 -0800 | [diff] [blame] | 445 | ja int_ret_from_sys_call /* ia32_tracesys has set RAX(%rsp) */ |
| 446 | jmp ia32_do_call |
Jan Beulich | 4b787e0 | 2006-06-26 13:56:55 +0200 | [diff] [blame] | 447 | END(ia32_syscall) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 448 | |
| 449 | ia32_badsys: |
| 450 | movq $0,ORIG_RAX-ARGOFFSET(%rsp) |
Jan Beulich | 24e3580 | 2009-09-30 11:22:11 +0100 | [diff] [blame] | 451 | movq $-ENOSYS,%rax |
| 452 | jmp ia32_sysret |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 453 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 454 | quiet_ni_syscall: |
| 455 | movq $-ENOSYS,%rax |
| 456 | ret |
| 457 | CFI_ENDPROC |
| 458 | |
| 459 | .macro PTREGSCALL label, func, arg |
| 460 | .globl \label |
| 461 | \label: |
| 462 | leaq \func(%rip),%rax |
| 463 | leaq -ARGOFFSET+8(%rsp),\arg /* 8 for return address */ |
| 464 | jmp ia32_ptregs_common |
| 465 | .endm |
| 466 | |
Jan Beulich | 2765130 | 2006-01-11 22:41:59 +0100 | [diff] [blame] | 467 | CFI_STARTPROC32 |
Jan Beulich | 7effaa8 | 2005-09-12 18:49:24 +0200 | [diff] [blame] | 468 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 469 | PTREGSCALL stub32_rt_sigreturn, sys32_rt_sigreturn, %rdi |
| 470 | PTREGSCALL stub32_sigreturn, sys32_sigreturn, %rdi |
| 471 | PTREGSCALL stub32_sigaltstack, sys32_sigaltstack, %rdx |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 472 | PTREGSCALL stub32_execve, sys32_execve, %rcx |
| 473 | PTREGSCALL stub32_fork, sys_fork, %rdi |
| 474 | PTREGSCALL stub32_clone, sys32_clone, %rdx |
| 475 | PTREGSCALL stub32_vfork, sys_vfork, %rdi |
| 476 | PTREGSCALL stub32_iopl, sys_iopl, %rsi |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 477 | |
| 478 | ENTRY(ia32_ptregs_common) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 479 | popq %r11 |
Jan Beulich | 2765130 | 2006-01-11 22:41:59 +0100 | [diff] [blame] | 480 | CFI_ENDPROC |
| 481 | CFI_STARTPROC32 simple |
Jan Beulich | adf1423 | 2006-09-26 10:52:41 +0200 | [diff] [blame] | 482 | CFI_SIGNAL_FRAME |
Jan Beulich | 2765130 | 2006-01-11 22:41:59 +0100 | [diff] [blame] | 483 | CFI_DEF_CFA rsp,SS+8-ARGOFFSET |
| 484 | CFI_REL_OFFSET rax,RAX-ARGOFFSET |
| 485 | CFI_REL_OFFSET rcx,RCX-ARGOFFSET |
| 486 | CFI_REL_OFFSET rdx,RDX-ARGOFFSET |
| 487 | CFI_REL_OFFSET rsi,RSI-ARGOFFSET |
| 488 | CFI_REL_OFFSET rdi,RDI-ARGOFFSET |
| 489 | CFI_REL_OFFSET rip,RIP-ARGOFFSET |
| 490 | /* CFI_REL_OFFSET cs,CS-ARGOFFSET*/ |
| 491 | /* CFI_REL_OFFSET rflags,EFLAGS-ARGOFFSET*/ |
| 492 | CFI_REL_OFFSET rsp,RSP-ARGOFFSET |
| 493 | /* CFI_REL_OFFSET ss,SS-ARGOFFSET*/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 494 | SAVE_REST |
| 495 | call *%rax |
| 496 | RESTORE_REST |
| 497 | jmp ia32_sysret /* misbalances the return cache */ |
| 498 | CFI_ENDPROC |
Jan Beulich | 4b787e0 | 2006-06-26 13:56:55 +0200 | [diff] [blame] | 499 | END(ia32_ptregs_common) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 500 | |
Arjan van de Ven | bb152f5 | 2006-01-06 00:12:05 -0800 | [diff] [blame] | 501 | .section .rodata,"a" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 502 | .align 8 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 503 | ia32_sys_call_table: |
| 504 | .quad sys_restart_syscall |
| 505 | .quad sys_exit |
| 506 | .quad stub32_fork |
| 507 | .quad sys_read |
| 508 | .quad sys_write |
Miklos Szeredi | e922efc | 2005-09-06 15:18:25 -0700 | [diff] [blame] | 509 | .quad compat_sys_open /* 5 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 510 | .quad sys_close |
| 511 | .quad sys32_waitpid |
| 512 | .quad sys_creat |
| 513 | .quad sys_link |
| 514 | .quad sys_unlink /* 10 */ |
| 515 | .quad stub32_execve |
| 516 | .quad sys_chdir |
| 517 | .quad compat_sys_time |
| 518 | .quad sys_mknod |
| 519 | .quad sys_chmod /* 15 */ |
| 520 | .quad sys_lchown16 |
| 521 | .quad quiet_ni_syscall /* old break syscall holder */ |
| 522 | .quad sys_stat |
| 523 | .quad sys32_lseek |
| 524 | .quad sys_getpid /* 20 */ |
| 525 | .quad compat_sys_mount /* mount */ |
| 526 | .quad sys_oldumount /* old_umount */ |
| 527 | .quad sys_setuid16 |
| 528 | .quad sys_getuid16 |
| 529 | .quad compat_sys_stime /* stime */ /* 25 */ |
Roland McGrath | 562b80b | 2008-04-22 12:21:25 -0700 | [diff] [blame] | 530 | .quad compat_sys_ptrace /* ptrace */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 531 | .quad sys_alarm |
| 532 | .quad sys_fstat /* (old)fstat */ |
| 533 | .quad sys_pause |
| 534 | .quad compat_sys_utime /* 30 */ |
| 535 | .quad quiet_ni_syscall /* old stty syscall holder */ |
| 536 | .quad quiet_ni_syscall /* old gtty syscall holder */ |
| 537 | .quad sys_access |
| 538 | .quad sys_nice |
| 539 | .quad quiet_ni_syscall /* 35 */ /* old ftime syscall holder */ |
| 540 | .quad sys_sync |
| 541 | .quad sys32_kill |
| 542 | .quad sys_rename |
| 543 | .quad sys_mkdir |
| 544 | .quad sys_rmdir /* 40 */ |
| 545 | .quad sys_dup |
Amerigo Wang | 4c71157 | 2009-08-06 15:58:12 -0700 | [diff] [blame] | 546 | .quad sys_pipe |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 547 | .quad compat_sys_times |
| 548 | .quad quiet_ni_syscall /* old prof syscall holder */ |
| 549 | .quad sys_brk /* 45 */ |
| 550 | .quad sys_setgid16 |
| 551 | .quad sys_getgid16 |
| 552 | .quad sys_signal |
| 553 | .quad sys_geteuid16 |
| 554 | .quad sys_getegid16 /* 50 */ |
| 555 | .quad sys_acct |
| 556 | .quad sys_umount /* new_umount */ |
| 557 | .quad quiet_ni_syscall /* old lock syscall holder */ |
| 558 | .quad compat_sys_ioctl |
| 559 | .quad compat_sys_fcntl64 /* 55 */ |
| 560 | .quad quiet_ni_syscall /* old mpx syscall holder */ |
| 561 | .quad sys_setpgid |
| 562 | .quad quiet_ni_syscall /* old ulimit syscall holder */ |
Christoph Hellwig | 5cacdb4 | 2010-03-10 15:21:21 -0800 | [diff] [blame] | 563 | .quad sys_olduname |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 564 | .quad sys_umask /* 60 */ |
| 565 | .quad sys_chroot |
Christoph Hellwig | 2b1c6bd | 2008-11-28 10:09:09 +0100 | [diff] [blame] | 566 | .quad compat_sys_ustat |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 567 | .quad sys_dup2 |
| 568 | .quad sys_getppid |
| 569 | .quad sys_getpgrp /* 65 */ |
| 570 | .quad sys_setsid |
| 571 | .quad sys32_sigaction |
| 572 | .quad sys_sgetmask |
| 573 | .quad sys_ssetmask |
| 574 | .quad sys_setreuid16 /* 70 */ |
| 575 | .quad sys_setregid16 |
Jan Beulich | 5f0120b | 2008-06-18 12:42:11 +0100 | [diff] [blame] | 576 | .quad sys32_sigsuspend |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 577 | .quad compat_sys_sigpending |
| 578 | .quad sys_sethostname |
| 579 | .quad compat_sys_setrlimit /* 75 */ |
| 580 | .quad compat_sys_old_getrlimit /* old_getrlimit */ |
| 581 | .quad compat_sys_getrusage |
Christoph Hellwig | b418da1 | 2008-10-15 22:02:06 -0700 | [diff] [blame] | 582 | .quad compat_sys_gettimeofday |
| 583 | .quad compat_sys_settimeofday |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 584 | .quad sys_getgroups16 /* 80 */ |
| 585 | .quad sys_setgroups16 |
Christoph Hellwig | 5d0e528 | 2010-03-10 15:21:13 -0800 | [diff] [blame] | 586 | .quad compat_sys_old_select |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 587 | .quad sys_symlink |
| 588 | .quad sys_lstat |
| 589 | .quad sys_readlink /* 85 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 590 | .quad sys_uselib |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 591 | .quad sys_swapon |
| 592 | .quad sys_reboot |
| 593 | .quad compat_sys_old_readdir |
| 594 | .quad sys32_mmap /* 90 */ |
| 595 | .quad sys_munmap |
| 596 | .quad sys_truncate |
| 597 | .quad sys_ftruncate |
| 598 | .quad sys_fchmod |
| 599 | .quad sys_fchown16 /* 95 */ |
| 600 | .quad sys_getpriority |
| 601 | .quad sys_setpriority |
| 602 | .quad quiet_ni_syscall /* old profil syscall holder */ |
| 603 | .quad compat_sys_statfs |
| 604 | .quad compat_sys_fstatfs /* 100 */ |
| 605 | .quad sys_ioperm |
| 606 | .quad compat_sys_socketcall |
| 607 | .quad sys_syslog |
| 608 | .quad compat_sys_setitimer |
| 609 | .quad compat_sys_getitimer /* 105 */ |
| 610 | .quad compat_sys_newstat |
| 611 | .quad compat_sys_newlstat |
| 612 | .quad compat_sys_newfstat |
Christoph Hellwig | 5cacdb4 | 2010-03-10 15:21:21 -0800 | [diff] [blame] | 613 | .quad sys_uname |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 614 | .quad stub32_iopl /* 110 */ |
| 615 | .quad sys_vhangup |
| 616 | .quad quiet_ni_syscall /* old "idle" system call */ |
| 617 | .quad sys32_vm86_warning /* vm86old */ |
| 618 | .quad compat_sys_wait4 |
| 619 | .quad sys_swapoff /* 115 */ |
Kyle McMartin | d4d23ad | 2007-02-10 01:46:00 -0800 | [diff] [blame] | 620 | .quad compat_sys_sysinfo |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 621 | .quad sys32_ipc |
| 622 | .quad sys_fsync |
| 623 | .quad stub32_sigreturn |
| 624 | .quad stub32_clone /* 120 */ |
| 625 | .quad sys_setdomainname |
Christoph Hellwig | 4cecd93 | 2010-04-20 05:31:02 +0200 | [diff] [blame] | 626 | .quad sys_newuname |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 627 | .quad sys_modify_ldt |
Stephen Rothwell | 3158e94 | 2006-03-26 01:37:29 -0800 | [diff] [blame] | 628 | .quad compat_sys_adjtimex |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 629 | .quad sys32_mprotect /* 125 */ |
| 630 | .quad compat_sys_sigprocmask |
| 631 | .quad quiet_ni_syscall /* create_module */ |
| 632 | .quad sys_init_module |
| 633 | .quad sys_delete_module |
| 634 | .quad quiet_ni_syscall /* 130 get_kernel_syms */ |
Vasily Tarasov | b716395 | 2007-07-15 23:41:12 -0700 | [diff] [blame] | 635 | .quad sys32_quotactl |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 636 | .quad sys_getpgid |
| 637 | .quad sys_fchdir |
| 638 | .quad quiet_ni_syscall /* bdflush */ |
| 639 | .quad sys_sysfs /* 135 */ |
| 640 | .quad sys_personality |
| 641 | .quad quiet_ni_syscall /* for afs_syscall */ |
| 642 | .quad sys_setfsuid16 |
| 643 | .quad sys_setfsgid16 |
| 644 | .quad sys_llseek /* 140 */ |
| 645 | .quad compat_sys_getdents |
| 646 | .quad compat_sys_select |
| 647 | .quad sys_flock |
| 648 | .quad sys_msync |
| 649 | .quad compat_sys_readv /* 145 */ |
| 650 | .quad compat_sys_writev |
| 651 | .quad sys_getsid |
| 652 | .quad sys_fdatasync |
Eric W. Biederman | c3359fb | 2009-04-03 00:59:52 -0700 | [diff] [blame] | 653 | .quad compat_sys_sysctl /* sysctl */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 654 | .quad sys_mlock /* 150 */ |
| 655 | .quad sys_munlock |
| 656 | .quad sys_mlockall |
| 657 | .quad sys_munlockall |
| 658 | .quad sys_sched_setparam |
| 659 | .quad sys_sched_getparam /* 155 */ |
| 660 | .quad sys_sched_setscheduler |
| 661 | .quad sys_sched_getscheduler |
| 662 | .quad sys_sched_yield |
| 663 | .quad sys_sched_get_priority_max |
| 664 | .quad sys_sched_get_priority_min /* 160 */ |
Alexandr Andreev | a9bc3bf | 2007-03-16 21:07:36 +0100 | [diff] [blame] | 665 | .quad sys32_sched_rr_get_interval |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 666 | .quad compat_sys_nanosleep |
| 667 | .quad sys_mremap |
| 668 | .quad sys_setresuid16 |
| 669 | .quad sys_getresuid16 /* 165 */ |
| 670 | .quad sys32_vm86_warning /* vm86 */ |
| 671 | .quad quiet_ni_syscall /* query_module */ |
| 672 | .quad sys_poll |
| 673 | .quad compat_sys_nfsservctl |
| 674 | .quad sys_setresgid16 /* 170 */ |
| 675 | .quad sys_getresgid16 |
| 676 | .quad sys_prctl |
| 677 | .quad stub32_rt_sigreturn |
| 678 | .quad sys32_rt_sigaction |
| 679 | .quad sys32_rt_sigprocmask /* 175 */ |
| 680 | .quad sys32_rt_sigpending |
| 681 | .quad compat_sys_rt_sigtimedwait |
| 682 | .quad sys32_rt_sigqueueinfo |
Jan Beulich | 5f0120b | 2008-06-18 12:42:11 +0100 | [diff] [blame] | 683 | .quad sys_rt_sigsuspend |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 684 | .quad sys32_pread /* 180 */ |
| 685 | .quad sys32_pwrite |
| 686 | .quad sys_chown16 |
| 687 | .quad sys_getcwd |
| 688 | .quad sys_capget |
| 689 | .quad sys_capset |
| 690 | .quad stub32_sigaltstack |
| 691 | .quad sys32_sendfile |
| 692 | .quad quiet_ni_syscall /* streams1 */ |
| 693 | .quad quiet_ni_syscall /* streams2 */ |
| 694 | .quad stub32_vfork /* 190 */ |
| 695 | .quad compat_sys_getrlimit |
Al Viro | f8b7256 | 2009-11-30 17:37:04 -0500 | [diff] [blame] | 696 | .quad sys_mmap_pgoff |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 697 | .quad sys32_truncate64 |
| 698 | .quad sys32_ftruncate64 |
| 699 | .quad sys32_stat64 /* 195 */ |
| 700 | .quad sys32_lstat64 |
| 701 | .quad sys32_fstat64 |
| 702 | .quad sys_lchown |
| 703 | .quad sys_getuid |
| 704 | .quad sys_getgid /* 200 */ |
| 705 | .quad sys_geteuid |
| 706 | .quad sys_getegid |
| 707 | .quad sys_setreuid |
| 708 | .quad sys_setregid |
| 709 | .quad sys_getgroups /* 205 */ |
| 710 | .quad sys_setgroups |
| 711 | .quad sys_fchown |
| 712 | .quad sys_setresuid |
| 713 | .quad sys_getresuid |
| 714 | .quad sys_setresgid /* 210 */ |
| 715 | .quad sys_getresgid |
| 716 | .quad sys_chown |
| 717 | .quad sys_setuid |
| 718 | .quad sys_setgid |
| 719 | .quad sys_setfsuid /* 215 */ |
| 720 | .quad sys_setfsgid |
| 721 | .quad sys_pivot_root |
| 722 | .quad sys_mincore |
| 723 | .quad sys_madvise |
| 724 | .quad compat_sys_getdents64 /* 220 getdents64 */ |
| 725 | .quad compat_sys_fcntl64 |
| 726 | .quad quiet_ni_syscall /* tux */ |
| 727 | .quad quiet_ni_syscall /* security */ |
| 728 | .quad sys_gettid |
Andi Kleen | e412ac4 | 2007-06-20 12:23:30 +0200 | [diff] [blame] | 729 | .quad sys32_readahead /* 225 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 730 | .quad sys_setxattr |
| 731 | .quad sys_lsetxattr |
| 732 | .quad sys_fsetxattr |
| 733 | .quad sys_getxattr |
| 734 | .quad sys_lgetxattr /* 230 */ |
| 735 | .quad sys_fgetxattr |
| 736 | .quad sys_listxattr |
| 737 | .quad sys_llistxattr |
| 738 | .quad sys_flistxattr |
| 739 | .quad sys_removexattr /* 235 */ |
| 740 | .quad sys_lremovexattr |
| 741 | .quad sys_fremovexattr |
| 742 | .quad sys_tkill |
| 743 | .quad sys_sendfile64 |
| 744 | .quad compat_sys_futex /* 240 */ |
| 745 | .quad compat_sys_sched_setaffinity |
| 746 | .quad compat_sys_sched_getaffinity |
Roland McGrath | efd1ca5 | 2008-01-30 13:30:46 +0100 | [diff] [blame] | 747 | .quad sys_set_thread_area |
| 748 | .quad sys_get_thread_area |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 749 | .quad compat_sys_io_setup /* 245 */ |
| 750 | .quad sys_io_destroy |
| 751 | .quad compat_sys_io_getevents |
| 752 | .quad compat_sys_io_submit |
| 753 | .quad sys_io_cancel |
Andi Kleen | e412ac4 | 2007-06-20 12:23:30 +0200 | [diff] [blame] | 754 | .quad sys32_fadvise64 /* 250 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 755 | .quad quiet_ni_syscall /* free_huge_pages */ |
| 756 | .quad sys_exit_group |
| 757 | .quad sys32_lookup_dcookie |
| 758 | .quad sys_epoll_create |
| 759 | .quad sys_epoll_ctl /* 255 */ |
| 760 | .quad sys_epoll_wait |
| 761 | .quad sys_remap_file_pages |
| 762 | .quad sys_set_tid_address |
Christoph Hellwig | 3a0f69d | 2006-01-09 20:52:08 -0800 | [diff] [blame] | 763 | .quad compat_sys_timer_create |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 764 | .quad compat_sys_timer_settime /* 260 */ |
| 765 | .quad compat_sys_timer_gettime |
| 766 | .quad sys_timer_getoverrun |
| 767 | .quad sys_timer_delete |
| 768 | .quad compat_sys_clock_settime |
| 769 | .quad compat_sys_clock_gettime /* 265 */ |
| 770 | .quad compat_sys_clock_getres |
| 771 | .quad compat_sys_clock_nanosleep |
| 772 | .quad compat_sys_statfs64 |
| 773 | .quad compat_sys_fstatfs64 |
| 774 | .quad sys_tgkill /* 270 */ |
| 775 | .quad compat_sys_utimes |
| 776 | .quad sys32_fadvise64_64 |
| 777 | .quad quiet_ni_syscall /* sys_vserver */ |
| 778 | .quad sys_mbind |
| 779 | .quad compat_sys_get_mempolicy /* 275 */ |
| 780 | .quad sys_set_mempolicy |
| 781 | .quad compat_sys_mq_open |
| 782 | .quad sys_mq_unlink |
| 783 | .quad compat_sys_mq_timedsend |
| 784 | .quad compat_sys_mq_timedreceive /* 280 */ |
| 785 | .quad compat_sys_mq_notify |
| 786 | .quad compat_sys_mq_getsetattr |
Eric W. Biederman | 5234f5e | 2005-06-25 14:58:02 -0700 | [diff] [blame] | 787 | .quad compat_sys_kexec_load /* reserved for kexec */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 788 | .quad compat_sys_waitid |
Robert Love | 725b38ab | 2005-07-25 15:19:29 -0400 | [diff] [blame] | 789 | .quad quiet_ni_syscall /* 285: sys_altroot */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 790 | .quad sys_add_key |
| 791 | .quad sys_request_key |
| 792 | .quad sys_keyctl |
Robert Love | 725b38ab | 2005-07-25 15:19:29 -0400 | [diff] [blame] | 793 | .quad sys_ioprio_set |
| 794 | .quad sys_ioprio_get /* 290 */ |
| 795 | .quad sys_inotify_init |
| 796 | .quad sys_inotify_add_watch |
| 797 | .quad sys_inotify_rm_watch |
Christoph Lameter | 3974388 | 2006-01-08 01:00:51 -0800 | [diff] [blame] | 798 | .quad sys_migrate_pages |
Ulrich Drepper | a60fc51 | 2006-01-18 17:43:56 -0800 | [diff] [blame] | 799 | .quad compat_sys_openat /* 295 */ |
| 800 | .quad sys_mkdirat |
| 801 | .quad sys_mknodat |
| 802 | .quad sys_fchownat |
Andrew Morton | 3833a70 | 2006-02-01 03:04:32 -0800 | [diff] [blame] | 803 | .quad compat_sys_futimesat |
Ulrich Drepper | cff2b76 | 2006-02-11 17:55:47 -0800 | [diff] [blame] | 804 | .quad sys32_fstatat /* 300 */ |
Ulrich Drepper | a60fc51 | 2006-01-18 17:43:56 -0800 | [diff] [blame] | 805 | .quad sys_unlinkat |
| 806 | .quad sys_renameat |
| 807 | .quad sys_linkat |
| 808 | .quad sys_symlinkat |
| 809 | .quad sys_readlinkat /* 305 */ |
| 810 | .quad sys_fchmodat |
| 811 | .quad sys_faccessat |
Andi Kleen | 957dc87 | 2006-09-26 10:52:27 +0200 | [diff] [blame] | 812 | .quad compat_sys_pselect6 |
| 813 | .quad compat_sys_ppoll |
Andi Kleen | 4b88f09 | 2006-02-09 00:35:50 +0100 | [diff] [blame] | 814 | .quad sys_unshare /* 310 */ |
Ingo Molnar | 8fdd6c6 | 2006-03-27 01:16:26 -0800 | [diff] [blame] | 815 | .quad compat_sys_set_robust_list |
| 816 | .quad compat_sys_get_robust_list |
Andi Kleen | b8feb47 | 2006-04-07 19:50:34 +0200 | [diff] [blame] | 817 | .quad sys_splice |
Andi Kleen | e412ac4 | 2007-06-20 12:23:30 +0200 | [diff] [blame] | 818 | .quad sys32_sync_file_range |
Ulrich Drepper | 1c710c8 | 2007-05-08 00:33:25 -0700 | [diff] [blame] | 819 | .quad sys_tee /* 315 */ |
Andi Kleen | d261020 | 2006-05-01 12:15:48 -0700 | [diff] [blame] | 820 | .quad compat_sys_vmsplice |
Christoph Lameter | 1b2db9f | 2006-06-23 02:03:56 -0700 | [diff] [blame] | 821 | .quad compat_sys_move_pages |
Andi Kleen | 3cfc348 | 2006-09-26 10:52:28 +0200 | [diff] [blame] | 822 | .quad sys_getcpu |
Ralf Baechle | 9af3cf0 | 2007-02-13 13:26:26 +0100 | [diff] [blame] | 823 | .quad sys_epoll_pwait |
Ulrich Drepper | 1c710c8 | 2007-05-08 00:33:25 -0700 | [diff] [blame] | 824 | .quad compat_sys_utimensat /* 320 */ |
Heiko Carstens | ae7d5c8 | 2007-05-12 17:27:41 +0200 | [diff] [blame] | 825 | .quad compat_sys_signalfd |
Davide Libenzi | cb9282e | 2008-02-04 22:27:28 -0800 | [diff] [blame] | 826 | .quad sys_timerfd_create |
Davide Libenzi | fdb902b1 | 2007-05-10 22:23:20 -0700 | [diff] [blame] | 827 | .quad sys_eventfd |
Amit Arora | 97ac735 | 2007-07-17 21:42:44 -0400 | [diff] [blame] | 828 | .quad sys32_fallocate |
Davide Libenzi | cb9282e | 2008-02-04 22:27:28 -0800 | [diff] [blame] | 829 | .quad compat_sys_timerfd_settime /* 325 */ |
| 830 | .quad compat_sys_timerfd_gettime |
Ulrich Drepper | 9deb27b | 2008-07-23 21:29:24 -0700 | [diff] [blame] | 831 | .quad compat_sys_signalfd4 |
Ulrich Drepper | b087498e | 2008-07-23 21:29:25 -0700 | [diff] [blame] | 832 | .quad sys_eventfd2 |
Ulrich Drepper | 9fe5ad9 | 2008-07-23 21:29:43 -0700 | [diff] [blame] | 833 | .quad sys_epoll_create1 |
Ingo Molnar | 241771e | 2008-12-03 10:39:53 +0100 | [diff] [blame] | 834 | .quad sys_dup3 /* 330 */ |
Ulrich Drepper | ed8cae8 | 2008-07-23 21:29:30 -0700 | [diff] [blame] | 835 | .quad sys_pipe2 |
Ulrich Drepper | 4006553 | 2008-07-23 21:29:32 -0700 | [diff] [blame] | 836 | .quad sys_inotify_init1 |
Gerd Hoffmann | f3554f4 | 2009-04-02 16:59:23 -0700 | [diff] [blame] | 837 | .quad compat_sys_preadv |
| 838 | .quad compat_sys_pwritev |
Thomas Gleixner | 12d1611 | 2009-04-04 21:01:10 +0000 | [diff] [blame] | 839 | .quad compat_sys_rt_tgsigqueueinfo /* 335 */ |
Ingo Molnar | cdd6c48 | 2009-09-21 12:02:48 +0200 | [diff] [blame] | 840 | .quad sys_perf_event_open |
Arnaldo Carvalho de Melo | a2e2725 | 2009-10-12 23:40:10 -0700 | [diff] [blame] | 841 | .quad compat_sys_recvmmsg |
Eric Paris | 11637e4 | 2009-12-17 21:24:25 -0500 | [diff] [blame] | 842 | .quad sys_fanotify_init |
Eric Paris | bbaa416 | 2009-12-17 21:24:26 -0500 | [diff] [blame] | 843 | .quad sys32_fanotify_mark |
Linus Torvalds | 8cbd84f | 2010-08-10 15:35:10 -0700 | [diff] [blame] | 844 | .quad sys_prlimit64 /* 340 */ |
Heiko Carstens | ae7d5c8 | 2007-05-12 17:27:41 +0200 | [diff] [blame] | 845 | ia32_syscall_end: |