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