ia32entry.S 22 KB

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