entry_32.S 26 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180
  1. /*
  2. *
  3. * Copyright (C) 1991, 1992 Linus Torvalds
  4. */
  5. /*
  6. * entry.S contains the system-call and fault low-level handling routines.
  7. * This also contains the timer-interrupt handler, as well as all interrupts
  8. * and faults that can result in a task-switch.
  9. *
  10. * NOTE: This code handles signal-recognition, which happens every time
  11. * after a timer-interrupt and after each system call.
  12. *
  13. * I changed all the .align's to 4 (16 byte alignment), as that's faster
  14. * on a 486.
  15. *
  16. * Stack layout in 'syscall_exit':
  17. * ptrace needs to have all regs on the stack.
  18. * if the order here is changed, it needs to be
  19. * updated in fork.c:copy_process, signal.c:do_signal,
  20. * ptrace.c and ptrace.h
  21. *
  22. * 0(%esp) - %ebx
  23. * 4(%esp) - %ecx
  24. * 8(%esp) - %edx
  25. * C(%esp) - %esi
  26. * 10(%esp) - %edi
  27. * 14(%esp) - %ebp
  28. * 18(%esp) - %eax
  29. * 1C(%esp) - %ds
  30. * 20(%esp) - %es
  31. * 24(%esp) - %fs
  32. * 28(%esp) - orig_eax
  33. * 2C(%esp) - %eip
  34. * 30(%esp) - %cs
  35. * 34(%esp) - %eflags
  36. * 38(%esp) - %oldesp
  37. * 3C(%esp) - %oldss
  38. *
  39. * "current" is in register %ebx during any slow entries.
  40. */
  41. #include <linux/linkage.h>
  42. #include <asm/thread_info.h>
  43. #include <asm/irqflags.h>
  44. #include <asm/errno.h>
  45. #include <asm/segment.h>
  46. #include <asm/smp.h>
  47. #include <asm/page.h>
  48. #include <asm/desc.h>
  49. #include <asm/percpu.h>
  50. #include <asm/dwarf2.h>
  51. #include <asm/processor-flags.h>
  52. #include <asm/ftrace.h>
  53. #include <asm/irq_vectors.h>
  54. /*
  55. * We use macros for low-level operations which need to be overridden
  56. * for paravirtualization. The following will never clobber any registers:
  57. * INTERRUPT_RETURN (aka. "iret")
  58. * GET_CR0_INTO_EAX (aka. "movl %cr0, %eax")
  59. * ENABLE_INTERRUPTS_SYSEXIT (aka "sti; sysexit").
  60. *
  61. * For DISABLE_INTERRUPTS/ENABLE_INTERRUPTS (aka "cli"/"sti"), you must
  62. * specify what registers can be overwritten (CLBR_NONE, CLBR_EAX/EDX/ECX/ANY).
  63. * Allowing a register to be clobbered can shrink the paravirt replacement
  64. * enough to patch inline, increasing performance.
  65. */
  66. #define nr_syscalls ((syscall_table_size)/4)
  67. #ifdef CONFIG_PREEMPT
  68. #define preempt_stop(clobbers) DISABLE_INTERRUPTS(clobbers); TRACE_IRQS_OFF
  69. #else
  70. #define preempt_stop(clobbers)
  71. #define resume_kernel restore_nocheck
  72. #endif
  73. .macro TRACE_IRQS_IRET
  74. #ifdef CONFIG_TRACE_IRQFLAGS
  75. testl $X86_EFLAGS_IF,PT_EFLAGS(%esp) # interrupts off?
  76. jz 1f
  77. TRACE_IRQS_ON
  78. 1:
  79. #endif
  80. .endm
  81. #ifdef CONFIG_VM86
  82. #define resume_userspace_sig check_userspace
  83. #else
  84. #define resume_userspace_sig resume_userspace
  85. #endif
  86. #define SAVE_ALL \
  87. cld; \
  88. pushl %fs; \
  89. CFI_ADJUST_CFA_OFFSET 4;\
  90. /*CFI_REL_OFFSET fs, 0;*/\
  91. pushl %es; \
  92. CFI_ADJUST_CFA_OFFSET 4;\
  93. /*CFI_REL_OFFSET es, 0;*/\
  94. pushl %ds; \
  95. CFI_ADJUST_CFA_OFFSET 4;\
  96. /*CFI_REL_OFFSET ds, 0;*/\
  97. pushl %eax; \
  98. CFI_ADJUST_CFA_OFFSET 4;\
  99. CFI_REL_OFFSET eax, 0;\
  100. pushl %ebp; \
  101. CFI_ADJUST_CFA_OFFSET 4;\
  102. CFI_REL_OFFSET ebp, 0;\
  103. pushl %edi; \
  104. CFI_ADJUST_CFA_OFFSET 4;\
  105. CFI_REL_OFFSET edi, 0;\
  106. pushl %esi; \
  107. CFI_ADJUST_CFA_OFFSET 4;\
  108. CFI_REL_OFFSET esi, 0;\
  109. pushl %edx; \
  110. CFI_ADJUST_CFA_OFFSET 4;\
  111. CFI_REL_OFFSET edx, 0;\
  112. pushl %ecx; \
  113. CFI_ADJUST_CFA_OFFSET 4;\
  114. CFI_REL_OFFSET ecx, 0;\
  115. pushl %ebx; \
  116. CFI_ADJUST_CFA_OFFSET 4;\
  117. CFI_REL_OFFSET ebx, 0;\
  118. movl $(__USER_DS), %edx; \
  119. movl %edx, %ds; \
  120. movl %edx, %es; \
  121. movl $(__KERNEL_PERCPU), %edx; \
  122. movl %edx, %fs
  123. #define RESTORE_INT_REGS \
  124. popl %ebx; \
  125. CFI_ADJUST_CFA_OFFSET -4;\
  126. CFI_RESTORE ebx;\
  127. popl %ecx; \
  128. CFI_ADJUST_CFA_OFFSET -4;\
  129. CFI_RESTORE ecx;\
  130. popl %edx; \
  131. CFI_ADJUST_CFA_OFFSET -4;\
  132. CFI_RESTORE edx;\
  133. popl %esi; \
  134. CFI_ADJUST_CFA_OFFSET -4;\
  135. CFI_RESTORE esi;\
  136. popl %edi; \
  137. CFI_ADJUST_CFA_OFFSET -4;\
  138. CFI_RESTORE edi;\
  139. popl %ebp; \
  140. CFI_ADJUST_CFA_OFFSET -4;\
  141. CFI_RESTORE ebp;\
  142. popl %eax; \
  143. CFI_ADJUST_CFA_OFFSET -4;\
  144. CFI_RESTORE eax
  145. #define RESTORE_REGS \
  146. RESTORE_INT_REGS; \
  147. 1: popl %ds; \
  148. CFI_ADJUST_CFA_OFFSET -4;\
  149. /*CFI_RESTORE ds;*/\
  150. 2: popl %es; \
  151. CFI_ADJUST_CFA_OFFSET -4;\
  152. /*CFI_RESTORE es;*/\
  153. 3: popl %fs; \
  154. CFI_ADJUST_CFA_OFFSET -4;\
  155. /*CFI_RESTORE fs;*/\
  156. .pushsection .fixup,"ax"; \
  157. 4: movl $0,(%esp); \
  158. jmp 1b; \
  159. 5: movl $0,(%esp); \
  160. jmp 2b; \
  161. 6: movl $0,(%esp); \
  162. jmp 3b; \
  163. .section __ex_table,"a";\
  164. .align 4; \
  165. .long 1b,4b; \
  166. .long 2b,5b; \
  167. .long 3b,6b; \
  168. .popsection
  169. #define RING0_INT_FRAME \
  170. CFI_STARTPROC simple;\
  171. CFI_SIGNAL_FRAME;\
  172. CFI_DEF_CFA esp, 3*4;\
  173. /*CFI_OFFSET cs, -2*4;*/\
  174. CFI_OFFSET eip, -3*4
  175. #define RING0_EC_FRAME \
  176. CFI_STARTPROC simple;\
  177. CFI_SIGNAL_FRAME;\
  178. CFI_DEF_CFA esp, 4*4;\
  179. /*CFI_OFFSET cs, -2*4;*/\
  180. CFI_OFFSET eip, -3*4
  181. #define RING0_PTREGS_FRAME \
  182. CFI_STARTPROC simple;\
  183. CFI_SIGNAL_FRAME;\
  184. CFI_DEF_CFA esp, PT_OLDESP-PT_EBX;\
  185. /*CFI_OFFSET cs, PT_CS-PT_OLDESP;*/\
  186. CFI_OFFSET eip, PT_EIP-PT_OLDESP;\
  187. /*CFI_OFFSET es, PT_ES-PT_OLDESP;*/\
  188. /*CFI_OFFSET ds, PT_DS-PT_OLDESP;*/\
  189. CFI_OFFSET eax, PT_EAX-PT_OLDESP;\
  190. CFI_OFFSET ebp, PT_EBP-PT_OLDESP;\
  191. CFI_OFFSET edi, PT_EDI-PT_OLDESP;\
  192. CFI_OFFSET esi, PT_ESI-PT_OLDESP;\
  193. CFI_OFFSET edx, PT_EDX-PT_OLDESP;\
  194. CFI_OFFSET ecx, PT_ECX-PT_OLDESP;\
  195. CFI_OFFSET ebx, PT_EBX-PT_OLDESP
  196. ENTRY(ret_from_fork)
  197. CFI_STARTPROC
  198. pushl %eax
  199. CFI_ADJUST_CFA_OFFSET 4
  200. call schedule_tail
  201. GET_THREAD_INFO(%ebp)
  202. popl %eax
  203. CFI_ADJUST_CFA_OFFSET -4
  204. pushl $0x0202 # Reset kernel eflags
  205. CFI_ADJUST_CFA_OFFSET 4
  206. popfl
  207. CFI_ADJUST_CFA_OFFSET -4
  208. jmp syscall_exit
  209. CFI_ENDPROC
  210. END(ret_from_fork)
  211. /*
  212. * Return to user mode is not as complex as all this looks,
  213. * but we want the default path for a system call return to
  214. * go as quickly as possible which is why some of this is
  215. * less clear than it otherwise should be.
  216. */
  217. # userspace resumption stub bypassing syscall exit tracing
  218. ALIGN
  219. RING0_PTREGS_FRAME
  220. ret_from_exception:
  221. preempt_stop(CLBR_ANY)
  222. ret_from_intr:
  223. GET_THREAD_INFO(%ebp)
  224. check_userspace:
  225. movl PT_EFLAGS(%esp), %eax # mix EFLAGS and CS
  226. movb PT_CS(%esp), %al
  227. andl $(X86_EFLAGS_VM | SEGMENT_RPL_MASK), %eax
  228. cmpl $USER_RPL, %eax
  229. jb resume_kernel # not returning to v8086 or userspace
  230. ENTRY(resume_userspace)
  231. LOCKDEP_SYS_EXIT
  232. DISABLE_INTERRUPTS(CLBR_ANY) # make sure we don't miss an interrupt
  233. # setting need_resched or sigpending
  234. # between sampling and the iret
  235. TRACE_IRQS_OFF
  236. movl TI_flags(%ebp), %ecx
  237. andl $_TIF_WORK_MASK, %ecx # is there any work to be done on
  238. # int/exception return?
  239. jne work_pending
  240. jmp restore_all
  241. END(ret_from_exception)
  242. #ifdef CONFIG_PREEMPT
  243. ENTRY(resume_kernel)
  244. DISABLE_INTERRUPTS(CLBR_ANY)
  245. cmpl $0,TI_preempt_count(%ebp) # non-zero preempt_count ?
  246. jnz restore_nocheck
  247. need_resched:
  248. movl TI_flags(%ebp), %ecx # need_resched set ?
  249. testb $_TIF_NEED_RESCHED, %cl
  250. jz restore_all
  251. testl $X86_EFLAGS_IF,PT_EFLAGS(%esp) # interrupts off (exception path) ?
  252. jz restore_all
  253. call preempt_schedule_irq
  254. jmp need_resched
  255. END(resume_kernel)
  256. #endif
  257. CFI_ENDPROC
  258. /* SYSENTER_RETURN points to after the "sysenter" instruction in
  259. the vsyscall page. See vsyscall-sysentry.S, which defines the symbol. */
  260. # sysenter call handler stub
  261. ENTRY(ia32_sysenter_target)
  262. CFI_STARTPROC simple
  263. CFI_SIGNAL_FRAME
  264. CFI_DEF_CFA esp, 0
  265. CFI_REGISTER esp, ebp
  266. movl TSS_sysenter_sp0(%esp),%esp
  267. sysenter_past_esp:
  268. /*
  269. * Interrupts are disabled here, but we can't trace it until
  270. * enough kernel state to call TRACE_IRQS_OFF can be called - but
  271. * we immediately enable interrupts at that point anyway.
  272. */
  273. pushl $(__USER_DS)
  274. CFI_ADJUST_CFA_OFFSET 4
  275. /*CFI_REL_OFFSET ss, 0*/
  276. pushl %ebp
  277. CFI_ADJUST_CFA_OFFSET 4
  278. CFI_REL_OFFSET esp, 0
  279. pushfl
  280. orl $X86_EFLAGS_IF, (%esp)
  281. CFI_ADJUST_CFA_OFFSET 4
  282. pushl $(__USER_CS)
  283. CFI_ADJUST_CFA_OFFSET 4
  284. /*CFI_REL_OFFSET cs, 0*/
  285. /*
  286. * Push current_thread_info()->sysenter_return to the stack.
  287. * A tiny bit of offset fixup is necessary - 4*4 means the 4 words
  288. * pushed above; +8 corresponds to copy_thread's esp0 setting.
  289. */
  290. pushl (TI_sysenter_return-THREAD_SIZE+8+4*4)(%esp)
  291. CFI_ADJUST_CFA_OFFSET 4
  292. CFI_REL_OFFSET eip, 0
  293. pushl %eax
  294. CFI_ADJUST_CFA_OFFSET 4
  295. SAVE_ALL
  296. ENABLE_INTERRUPTS(CLBR_NONE)
  297. /*
  298. * Load the potential sixth argument from user stack.
  299. * Careful about security.
  300. */
  301. cmpl $__PAGE_OFFSET-3,%ebp
  302. jae syscall_fault
  303. 1: movl (%ebp),%ebp
  304. movl %ebp,PT_EBP(%esp)
  305. .section __ex_table,"a"
  306. .align 4
  307. .long 1b,syscall_fault
  308. .previous
  309. GET_THREAD_INFO(%ebp)
  310. /* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */
  311. testw $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%ebp)
  312. jnz syscall_trace_entry
  313. cmpl $(nr_syscalls), %eax
  314. jae syscall_badsys
  315. call *sys_call_table(,%eax,4)
  316. movl %eax,PT_EAX(%esp)
  317. LOCKDEP_SYS_EXIT
  318. DISABLE_INTERRUPTS(CLBR_ANY)
  319. TRACE_IRQS_OFF
  320. movl TI_flags(%ebp), %ecx
  321. testw $_TIF_ALLWORK_MASK, %cx
  322. jne syscall_exit_work
  323. /* if something modifies registers it must also disable sysexit */
  324. movl PT_EIP(%esp), %edx
  325. movl PT_OLDESP(%esp), %ecx
  326. xorl %ebp,%ebp
  327. TRACE_IRQS_ON
  328. 1: mov PT_FS(%esp), %fs
  329. ENABLE_INTERRUPTS_SYSEXIT
  330. CFI_ENDPROC
  331. .pushsection .fixup,"ax"
  332. 2: movl $0,PT_FS(%esp)
  333. jmp 1b
  334. .section __ex_table,"a"
  335. .align 4
  336. .long 1b,2b
  337. .popsection
  338. ENDPROC(ia32_sysenter_target)
  339. # system call handler stub
  340. ENTRY(system_call)
  341. RING0_INT_FRAME # can't unwind into user space anyway
  342. pushl %eax # save orig_eax
  343. CFI_ADJUST_CFA_OFFSET 4
  344. SAVE_ALL
  345. GET_THREAD_INFO(%ebp)
  346. # system call tracing in operation / emulation
  347. /* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */
  348. testw $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%ebp)
  349. jnz syscall_trace_entry
  350. cmpl $(nr_syscalls), %eax
  351. jae syscall_badsys
  352. syscall_call:
  353. call *sys_call_table(,%eax,4)
  354. movl %eax,PT_EAX(%esp) # store the return value
  355. syscall_exit:
  356. LOCKDEP_SYS_EXIT
  357. DISABLE_INTERRUPTS(CLBR_ANY) # make sure we don't miss an interrupt
  358. # setting need_resched or sigpending
  359. # between sampling and the iret
  360. TRACE_IRQS_OFF
  361. movl TI_flags(%ebp), %ecx
  362. testw $_TIF_ALLWORK_MASK, %cx # current->work
  363. jne syscall_exit_work
  364. restore_all:
  365. movl PT_EFLAGS(%esp), %eax # mix EFLAGS, SS and CS
  366. # Warning: PT_OLDSS(%esp) contains the wrong/random values if we
  367. # are returning to the kernel.
  368. # See comments in process.c:copy_thread() for details.
  369. movb PT_OLDSS(%esp), %ah
  370. movb PT_CS(%esp), %al
  371. andl $(X86_EFLAGS_VM | (SEGMENT_TI_MASK << 8) | SEGMENT_RPL_MASK), %eax
  372. cmpl $((SEGMENT_LDT << 8) | USER_RPL), %eax
  373. CFI_REMEMBER_STATE
  374. je ldt_ss # returning to user-space with LDT SS
  375. restore_nocheck:
  376. TRACE_IRQS_IRET
  377. restore_nocheck_notrace:
  378. RESTORE_REGS
  379. addl $4, %esp # skip orig_eax/error_code
  380. CFI_ADJUST_CFA_OFFSET -4
  381. irq_return:
  382. INTERRUPT_RETURN
  383. .section .fixup,"ax"
  384. ENTRY(iret_exc)
  385. pushl $0 # no error code
  386. pushl $do_iret_error
  387. jmp error_code
  388. .previous
  389. .section __ex_table,"a"
  390. .align 4
  391. .long irq_return,iret_exc
  392. .previous
  393. CFI_RESTORE_STATE
  394. ldt_ss:
  395. larl PT_OLDSS(%esp), %eax
  396. jnz restore_nocheck
  397. testl $0x00400000, %eax # returning to 32bit stack?
  398. jnz restore_nocheck # allright, normal return
  399. #ifdef CONFIG_PARAVIRT
  400. /*
  401. * The kernel can't run on a non-flat stack if paravirt mode
  402. * is active. Rather than try to fixup the high bits of
  403. * ESP, bypass this code entirely. This may break DOSemu
  404. * and/or Wine support in a paravirt VM, although the option
  405. * is still available to implement the setting of the high
  406. * 16-bits in the INTERRUPT_RETURN paravirt-op.
  407. */
  408. cmpl $0, pv_info+PARAVIRT_enabled
  409. jne restore_nocheck
  410. #endif
  411. /* If returning to userspace with 16bit stack,
  412. * try to fix the higher word of ESP, as the CPU
  413. * won't restore it.
  414. * This is an "official" bug of all the x86-compatible
  415. * CPUs, which we can try to work around to make
  416. * dosemu and wine happy. */
  417. movl PT_OLDESP(%esp), %eax
  418. movl %esp, %edx
  419. call patch_espfix_desc
  420. pushl $__ESPFIX_SS
  421. CFI_ADJUST_CFA_OFFSET 4
  422. pushl %eax
  423. CFI_ADJUST_CFA_OFFSET 4
  424. DISABLE_INTERRUPTS(CLBR_EAX)
  425. TRACE_IRQS_OFF
  426. lss (%esp), %esp
  427. CFI_ADJUST_CFA_OFFSET -8
  428. jmp restore_nocheck
  429. CFI_ENDPROC
  430. ENDPROC(system_call)
  431. # perform work that needs to be done immediately before resumption
  432. ALIGN
  433. RING0_PTREGS_FRAME # can't unwind into user space anyway
  434. work_pending:
  435. testb $_TIF_NEED_RESCHED, %cl
  436. jz work_notifysig
  437. work_resched:
  438. call schedule
  439. LOCKDEP_SYS_EXIT
  440. DISABLE_INTERRUPTS(CLBR_ANY) # make sure we don't miss an interrupt
  441. # setting need_resched or sigpending
  442. # between sampling and the iret
  443. TRACE_IRQS_OFF
  444. movl TI_flags(%ebp), %ecx
  445. andl $_TIF_WORK_MASK, %ecx # is there any work to be done other
  446. # than syscall tracing?
  447. jz restore_all
  448. testb $_TIF_NEED_RESCHED, %cl
  449. jnz work_resched
  450. work_notifysig: # deal with pending signals and
  451. # notify-resume requests
  452. #ifdef CONFIG_VM86
  453. testl $X86_EFLAGS_VM, PT_EFLAGS(%esp)
  454. movl %esp, %eax
  455. jne work_notifysig_v86 # returning to kernel-space or
  456. # vm86-space
  457. xorl %edx, %edx
  458. call do_notify_resume
  459. jmp resume_userspace_sig
  460. ALIGN
  461. work_notifysig_v86:
  462. pushl %ecx # save ti_flags for do_notify_resume
  463. CFI_ADJUST_CFA_OFFSET 4
  464. call save_v86_state # %eax contains pt_regs pointer
  465. popl %ecx
  466. CFI_ADJUST_CFA_OFFSET -4
  467. movl %eax, %esp
  468. #else
  469. movl %esp, %eax
  470. #endif
  471. xorl %edx, %edx
  472. call do_notify_resume
  473. jmp resume_userspace_sig
  474. END(work_pending)
  475. # perform syscall exit tracing
  476. ALIGN
  477. syscall_trace_entry:
  478. movl $-ENOSYS,PT_EAX(%esp)
  479. movl %esp, %eax
  480. call syscall_trace_enter
  481. /* What it returned is what we'll actually use. */
  482. cmpl $(nr_syscalls), %eax
  483. jnae syscall_call
  484. jmp syscall_exit
  485. END(syscall_trace_entry)
  486. # perform syscall exit tracing
  487. ALIGN
  488. syscall_exit_work:
  489. testb $_TIF_WORK_SYSCALL_EXIT, %cl
  490. jz work_pending
  491. TRACE_IRQS_ON
  492. ENABLE_INTERRUPTS(CLBR_ANY) # could let syscall_trace_leave() call
  493. # schedule() instead
  494. movl %esp, %eax
  495. call syscall_trace_leave
  496. jmp resume_userspace
  497. END(syscall_exit_work)
  498. CFI_ENDPROC
  499. RING0_INT_FRAME # can't unwind into user space anyway
  500. syscall_fault:
  501. GET_THREAD_INFO(%ebp)
  502. movl $-EFAULT,PT_EAX(%esp)
  503. jmp resume_userspace
  504. END(syscall_fault)
  505. syscall_badsys:
  506. movl $-ENOSYS,PT_EAX(%esp)
  507. jmp resume_userspace
  508. END(syscall_badsys)
  509. CFI_ENDPROC
  510. #define FIXUP_ESPFIX_STACK \
  511. /* since we are on a wrong stack, we cant make it a C code :( */ \
  512. PER_CPU(gdt_page, %ebx); \
  513. GET_DESC_BASE(GDT_ENTRY_ESPFIX_SS, %ebx, %eax, %ax, %al, %ah); \
  514. addl %esp, %eax; \
  515. pushl $__KERNEL_DS; \
  516. CFI_ADJUST_CFA_OFFSET 4; \
  517. pushl %eax; \
  518. CFI_ADJUST_CFA_OFFSET 4; \
  519. lss (%esp), %esp; \
  520. CFI_ADJUST_CFA_OFFSET -8;
  521. #define UNWIND_ESPFIX_STACK \
  522. movl %ss, %eax; \
  523. /* see if on espfix stack */ \
  524. cmpw $__ESPFIX_SS, %ax; \
  525. jne 27f; \
  526. movl $__KERNEL_DS, %eax; \
  527. movl %eax, %ds; \
  528. movl %eax, %es; \
  529. /* switch to normal stack */ \
  530. FIXUP_ESPFIX_STACK; \
  531. 27:;
  532. /*
  533. * Build the entry stubs and pointer table with
  534. * some assembler magic.
  535. */
  536. .section .rodata,"a"
  537. ENTRY(interrupt)
  538. .text
  539. ENTRY(irq_entries_start)
  540. RING0_INT_FRAME
  541. vector=0
  542. .rept NR_IRQS
  543. ALIGN
  544. .if vector
  545. CFI_ADJUST_CFA_OFFSET -4
  546. .endif
  547. 1: pushl $~(vector)
  548. CFI_ADJUST_CFA_OFFSET 4
  549. jmp common_interrupt
  550. .previous
  551. .long 1b
  552. .text
  553. vector=vector+1
  554. .endr
  555. END(irq_entries_start)
  556. .previous
  557. END(interrupt)
  558. .previous
  559. /*
  560. * the CPU automatically disables interrupts when executing an IRQ vector,
  561. * so IRQ-flags tracing has to follow that:
  562. */
  563. ALIGN
  564. common_interrupt:
  565. SAVE_ALL
  566. TRACE_IRQS_OFF
  567. movl %esp,%eax
  568. call do_IRQ
  569. jmp ret_from_intr
  570. ENDPROC(common_interrupt)
  571. CFI_ENDPROC
  572. #define BUILD_INTERRUPT(name, nr) \
  573. ENTRY(name) \
  574. RING0_INT_FRAME; \
  575. pushl $~(nr); \
  576. CFI_ADJUST_CFA_OFFSET 4; \
  577. SAVE_ALL; \
  578. TRACE_IRQS_OFF \
  579. movl %esp,%eax; \
  580. call smp_##name; \
  581. jmp ret_from_intr; \
  582. CFI_ENDPROC; \
  583. ENDPROC(name)
  584. /* The include is where all of the SMP etc. interrupts come from */
  585. #include "entry_arch.h"
  586. KPROBE_ENTRY(page_fault)
  587. RING0_EC_FRAME
  588. pushl $do_page_fault
  589. CFI_ADJUST_CFA_OFFSET 4
  590. ALIGN
  591. error_code:
  592. /* the function address is in %fs's slot on the stack */
  593. pushl %es
  594. CFI_ADJUST_CFA_OFFSET 4
  595. /*CFI_REL_OFFSET es, 0*/
  596. pushl %ds
  597. CFI_ADJUST_CFA_OFFSET 4
  598. /*CFI_REL_OFFSET ds, 0*/
  599. pushl %eax
  600. CFI_ADJUST_CFA_OFFSET 4
  601. CFI_REL_OFFSET eax, 0
  602. pushl %ebp
  603. CFI_ADJUST_CFA_OFFSET 4
  604. CFI_REL_OFFSET ebp, 0
  605. pushl %edi
  606. CFI_ADJUST_CFA_OFFSET 4
  607. CFI_REL_OFFSET edi, 0
  608. pushl %esi
  609. CFI_ADJUST_CFA_OFFSET 4
  610. CFI_REL_OFFSET esi, 0
  611. pushl %edx
  612. CFI_ADJUST_CFA_OFFSET 4
  613. CFI_REL_OFFSET edx, 0
  614. pushl %ecx
  615. CFI_ADJUST_CFA_OFFSET 4
  616. CFI_REL_OFFSET ecx, 0
  617. pushl %ebx
  618. CFI_ADJUST_CFA_OFFSET 4
  619. CFI_REL_OFFSET ebx, 0
  620. cld
  621. pushl %fs
  622. CFI_ADJUST_CFA_OFFSET 4
  623. /*CFI_REL_OFFSET fs, 0*/
  624. movl $(__KERNEL_PERCPU), %ecx
  625. movl %ecx, %fs
  626. UNWIND_ESPFIX_STACK
  627. popl %ecx
  628. CFI_ADJUST_CFA_OFFSET -4
  629. /*CFI_REGISTER es, ecx*/
  630. movl PT_FS(%esp), %edi # get the function address
  631. movl PT_ORIG_EAX(%esp), %edx # get the error code
  632. movl $-1, PT_ORIG_EAX(%esp) # no syscall to restart
  633. mov %ecx, PT_FS(%esp)
  634. /*CFI_REL_OFFSET fs, ES*/
  635. movl $(__USER_DS), %ecx
  636. movl %ecx, %ds
  637. movl %ecx, %es
  638. movl %esp,%eax # pt_regs pointer
  639. call *%edi
  640. jmp ret_from_exception
  641. CFI_ENDPROC
  642. KPROBE_END(page_fault)
  643. ENTRY(coprocessor_error)
  644. RING0_INT_FRAME
  645. pushl $0
  646. CFI_ADJUST_CFA_OFFSET 4
  647. pushl $do_coprocessor_error
  648. CFI_ADJUST_CFA_OFFSET 4
  649. jmp error_code
  650. CFI_ENDPROC
  651. END(coprocessor_error)
  652. ENTRY(simd_coprocessor_error)
  653. RING0_INT_FRAME
  654. pushl $0
  655. CFI_ADJUST_CFA_OFFSET 4
  656. pushl $do_simd_coprocessor_error
  657. CFI_ADJUST_CFA_OFFSET 4
  658. jmp error_code
  659. CFI_ENDPROC
  660. END(simd_coprocessor_error)
  661. ENTRY(device_not_available)
  662. RING0_INT_FRAME
  663. pushl $-1 # mark this as an int
  664. CFI_ADJUST_CFA_OFFSET 4
  665. SAVE_ALL
  666. GET_CR0_INTO_EAX
  667. testl $0x4, %eax # EM (math emulation bit)
  668. jne device_not_available_emulate
  669. preempt_stop(CLBR_ANY)
  670. call math_state_restore
  671. jmp ret_from_exception
  672. device_not_available_emulate:
  673. pushl $0 # temporary storage for ORIG_EIP
  674. CFI_ADJUST_CFA_OFFSET 4
  675. call math_emulate
  676. addl $4, %esp
  677. CFI_ADJUST_CFA_OFFSET -4
  678. jmp ret_from_exception
  679. CFI_ENDPROC
  680. END(device_not_available)
  681. /*
  682. * Debug traps and NMI can happen at the one SYSENTER instruction
  683. * that sets up the real kernel stack. Check here, since we can't
  684. * allow the wrong stack to be used.
  685. *
  686. * "TSS_sysenter_sp0+12" is because the NMI/debug handler will have
  687. * already pushed 3 words if it hits on the sysenter instruction:
  688. * eflags, cs and eip.
  689. *
  690. * We just load the right stack, and push the three (known) values
  691. * by hand onto the new stack - while updating the return eip past
  692. * the instruction that would have done it for sysenter.
  693. */
  694. #define FIX_STACK(offset, ok, label) \
  695. cmpw $__KERNEL_CS,4(%esp); \
  696. jne ok; \
  697. label: \
  698. movl TSS_sysenter_sp0+offset(%esp),%esp; \
  699. CFI_DEF_CFA esp, 0; \
  700. CFI_UNDEFINED eip; \
  701. pushfl; \
  702. CFI_ADJUST_CFA_OFFSET 4; \
  703. pushl $__KERNEL_CS; \
  704. CFI_ADJUST_CFA_OFFSET 4; \
  705. pushl $sysenter_past_esp; \
  706. CFI_ADJUST_CFA_OFFSET 4; \
  707. CFI_REL_OFFSET eip, 0
  708. KPROBE_ENTRY(debug)
  709. RING0_INT_FRAME
  710. cmpl $ia32_sysenter_target,(%esp)
  711. jne debug_stack_correct
  712. FIX_STACK(12, debug_stack_correct, debug_esp_fix_insn)
  713. debug_stack_correct:
  714. pushl $-1 # mark this as an int
  715. CFI_ADJUST_CFA_OFFSET 4
  716. SAVE_ALL
  717. xorl %edx,%edx # error code 0
  718. movl %esp,%eax # pt_regs pointer
  719. call do_debug
  720. jmp ret_from_exception
  721. CFI_ENDPROC
  722. KPROBE_END(debug)
  723. /*
  724. * NMI is doubly nasty. It can happen _while_ we're handling
  725. * a debug fault, and the debug fault hasn't yet been able to
  726. * clear up the stack. So we first check whether we got an
  727. * NMI on the sysenter entry path, but after that we need to
  728. * check whether we got an NMI on the debug path where the debug
  729. * fault happened on the sysenter path.
  730. */
  731. KPROBE_ENTRY(nmi)
  732. RING0_INT_FRAME
  733. pushl %eax
  734. CFI_ADJUST_CFA_OFFSET 4
  735. movl %ss, %eax
  736. cmpw $__ESPFIX_SS, %ax
  737. popl %eax
  738. CFI_ADJUST_CFA_OFFSET -4
  739. je nmi_espfix_stack
  740. cmpl $ia32_sysenter_target,(%esp)
  741. je nmi_stack_fixup
  742. pushl %eax
  743. CFI_ADJUST_CFA_OFFSET 4
  744. movl %esp,%eax
  745. /* Do not access memory above the end of our stack page,
  746. * it might not exist.
  747. */
  748. andl $(THREAD_SIZE-1),%eax
  749. cmpl $(THREAD_SIZE-20),%eax
  750. popl %eax
  751. CFI_ADJUST_CFA_OFFSET -4
  752. jae nmi_stack_correct
  753. cmpl $ia32_sysenter_target,12(%esp)
  754. je nmi_debug_stack_check
  755. nmi_stack_correct:
  756. /* We have a RING0_INT_FRAME here */
  757. pushl %eax
  758. CFI_ADJUST_CFA_OFFSET 4
  759. SAVE_ALL
  760. xorl %edx,%edx # zero error code
  761. movl %esp,%eax # pt_regs pointer
  762. call do_nmi
  763. jmp restore_nocheck_notrace
  764. CFI_ENDPROC
  765. nmi_stack_fixup:
  766. RING0_INT_FRAME
  767. FIX_STACK(12,nmi_stack_correct, 1)
  768. jmp nmi_stack_correct
  769. nmi_debug_stack_check:
  770. /* We have a RING0_INT_FRAME here */
  771. cmpw $__KERNEL_CS,16(%esp)
  772. jne nmi_stack_correct
  773. cmpl $debug,(%esp)
  774. jb nmi_stack_correct
  775. cmpl $debug_esp_fix_insn,(%esp)
  776. ja nmi_stack_correct
  777. FIX_STACK(24,nmi_stack_correct, 1)
  778. jmp nmi_stack_correct
  779. nmi_espfix_stack:
  780. /* We have a RING0_INT_FRAME here.
  781. *
  782. * create the pointer to lss back
  783. */
  784. pushl %ss
  785. CFI_ADJUST_CFA_OFFSET 4
  786. pushl %esp
  787. CFI_ADJUST_CFA_OFFSET 4
  788. addw $4, (%esp)
  789. /* copy the iret frame of 12 bytes */
  790. .rept 3
  791. pushl 16(%esp)
  792. CFI_ADJUST_CFA_OFFSET 4
  793. .endr
  794. pushl %eax
  795. CFI_ADJUST_CFA_OFFSET 4
  796. SAVE_ALL
  797. FIXUP_ESPFIX_STACK # %eax == %esp
  798. xorl %edx,%edx # zero error code
  799. call do_nmi
  800. RESTORE_REGS
  801. lss 12+4(%esp), %esp # back to espfix stack
  802. CFI_ADJUST_CFA_OFFSET -24
  803. jmp irq_return
  804. CFI_ENDPROC
  805. KPROBE_END(nmi)
  806. #ifdef CONFIG_PARAVIRT
  807. ENTRY(native_iret)
  808. iret
  809. .section __ex_table,"a"
  810. .align 4
  811. .long native_iret, iret_exc
  812. .previous
  813. END(native_iret)
  814. ENTRY(native_irq_enable_sysexit)
  815. sti
  816. sysexit
  817. END(native_irq_enable_sysexit)
  818. #endif
  819. KPROBE_ENTRY(int3)
  820. RING0_INT_FRAME
  821. pushl $-1 # mark this as an int
  822. CFI_ADJUST_CFA_OFFSET 4
  823. SAVE_ALL
  824. xorl %edx,%edx # zero error code
  825. movl %esp,%eax # pt_regs pointer
  826. call do_int3
  827. jmp ret_from_exception
  828. CFI_ENDPROC
  829. KPROBE_END(int3)
  830. ENTRY(overflow)
  831. RING0_INT_FRAME
  832. pushl $0
  833. CFI_ADJUST_CFA_OFFSET 4
  834. pushl $do_overflow
  835. CFI_ADJUST_CFA_OFFSET 4
  836. jmp error_code
  837. CFI_ENDPROC
  838. END(overflow)
  839. ENTRY(bounds)
  840. RING0_INT_FRAME
  841. pushl $0
  842. CFI_ADJUST_CFA_OFFSET 4
  843. pushl $do_bounds
  844. CFI_ADJUST_CFA_OFFSET 4
  845. jmp error_code
  846. CFI_ENDPROC
  847. END(bounds)
  848. ENTRY(invalid_op)
  849. RING0_INT_FRAME
  850. pushl $0
  851. CFI_ADJUST_CFA_OFFSET 4
  852. pushl $do_invalid_op
  853. CFI_ADJUST_CFA_OFFSET 4
  854. jmp error_code
  855. CFI_ENDPROC
  856. END(invalid_op)
  857. ENTRY(coprocessor_segment_overrun)
  858. RING0_INT_FRAME
  859. pushl $0
  860. CFI_ADJUST_CFA_OFFSET 4
  861. pushl $do_coprocessor_segment_overrun
  862. CFI_ADJUST_CFA_OFFSET 4
  863. jmp error_code
  864. CFI_ENDPROC
  865. END(coprocessor_segment_overrun)
  866. ENTRY(invalid_TSS)
  867. RING0_EC_FRAME
  868. pushl $do_invalid_TSS
  869. CFI_ADJUST_CFA_OFFSET 4
  870. jmp error_code
  871. CFI_ENDPROC
  872. END(invalid_TSS)
  873. ENTRY(segment_not_present)
  874. RING0_EC_FRAME
  875. pushl $do_segment_not_present
  876. CFI_ADJUST_CFA_OFFSET 4
  877. jmp error_code
  878. CFI_ENDPROC
  879. END(segment_not_present)
  880. ENTRY(stack_segment)
  881. RING0_EC_FRAME
  882. pushl $do_stack_segment
  883. CFI_ADJUST_CFA_OFFSET 4
  884. jmp error_code
  885. CFI_ENDPROC
  886. END(stack_segment)
  887. KPROBE_ENTRY(general_protection)
  888. RING0_EC_FRAME
  889. pushl $do_general_protection
  890. CFI_ADJUST_CFA_OFFSET 4
  891. jmp error_code
  892. CFI_ENDPROC
  893. KPROBE_END(general_protection)
  894. ENTRY(alignment_check)
  895. RING0_EC_FRAME
  896. pushl $do_alignment_check
  897. CFI_ADJUST_CFA_OFFSET 4
  898. jmp error_code
  899. CFI_ENDPROC
  900. END(alignment_check)
  901. ENTRY(divide_error)
  902. RING0_INT_FRAME
  903. pushl $0 # no error code
  904. CFI_ADJUST_CFA_OFFSET 4
  905. pushl $do_divide_error
  906. CFI_ADJUST_CFA_OFFSET 4
  907. jmp error_code
  908. CFI_ENDPROC
  909. END(divide_error)
  910. #ifdef CONFIG_X86_MCE
  911. ENTRY(machine_check)
  912. RING0_INT_FRAME
  913. pushl $0
  914. CFI_ADJUST_CFA_OFFSET 4
  915. pushl machine_check_vector
  916. CFI_ADJUST_CFA_OFFSET 4
  917. jmp error_code
  918. CFI_ENDPROC
  919. END(machine_check)
  920. #endif
  921. ENTRY(spurious_interrupt_bug)
  922. RING0_INT_FRAME
  923. pushl $0
  924. CFI_ADJUST_CFA_OFFSET 4
  925. pushl $do_spurious_interrupt_bug
  926. CFI_ADJUST_CFA_OFFSET 4
  927. jmp error_code
  928. CFI_ENDPROC
  929. END(spurious_interrupt_bug)
  930. ENTRY(kernel_thread_helper)
  931. pushl $0 # fake return address for unwinder
  932. CFI_STARTPROC
  933. movl %edx,%eax
  934. push %edx
  935. CFI_ADJUST_CFA_OFFSET 4
  936. call *%ebx
  937. push %eax
  938. CFI_ADJUST_CFA_OFFSET 4
  939. call do_exit
  940. CFI_ENDPROC
  941. ENDPROC(kernel_thread_helper)
  942. #ifdef CONFIG_XEN
  943. /* Xen doesn't set %esp to be precisely what the normal sysenter
  944. entrypoint expects, so fix it up before using the normal path. */
  945. ENTRY(xen_sysenter_target)
  946. RING0_INT_FRAME
  947. addl $5*4, %esp /* remove xen-provided frame */
  948. jmp sysenter_past_esp
  949. CFI_ENDPROC
  950. ENTRY(xen_hypervisor_callback)
  951. CFI_STARTPROC
  952. pushl $0
  953. CFI_ADJUST_CFA_OFFSET 4
  954. SAVE_ALL
  955. TRACE_IRQS_OFF
  956. /* Check to see if we got the event in the critical
  957. region in xen_iret_direct, after we've reenabled
  958. events and checked for pending events. This simulates
  959. iret instruction's behaviour where it delivers a
  960. pending interrupt when enabling interrupts. */
  961. movl PT_EIP(%esp),%eax
  962. cmpl $xen_iret_start_crit,%eax
  963. jb 1f
  964. cmpl $xen_iret_end_crit,%eax
  965. jae 1f
  966. jmp xen_iret_crit_fixup
  967. ENTRY(xen_do_upcall)
  968. 1: mov %esp, %eax
  969. call xen_evtchn_do_upcall
  970. jmp ret_from_intr
  971. CFI_ENDPROC
  972. ENDPROC(xen_hypervisor_callback)
  973. # Hypervisor uses this for application faults while it executes.
  974. # We get here for two reasons:
  975. # 1. Fault while reloading DS, ES, FS or GS
  976. # 2. Fault while executing IRET
  977. # Category 1 we fix up by reattempting the load, and zeroing the segment
  978. # register if the load fails.
  979. # Category 2 we fix up by jumping to do_iret_error. We cannot use the
  980. # normal Linux return path in this case because if we use the IRET hypercall
  981. # to pop the stack frame we end up in an infinite loop of failsafe callbacks.
  982. # We distinguish between categories by maintaining a status value in EAX.
  983. ENTRY(xen_failsafe_callback)
  984. CFI_STARTPROC
  985. pushl %eax
  986. CFI_ADJUST_CFA_OFFSET 4
  987. movl $1,%eax
  988. 1: mov 4(%esp),%ds
  989. 2: mov 8(%esp),%es
  990. 3: mov 12(%esp),%fs
  991. 4: mov 16(%esp),%gs
  992. testl %eax,%eax
  993. popl %eax
  994. CFI_ADJUST_CFA_OFFSET -4
  995. lea 16(%esp),%esp
  996. CFI_ADJUST_CFA_OFFSET -16
  997. jz 5f
  998. addl $16,%esp
  999. jmp iret_exc # EAX != 0 => Category 2 (Bad IRET)
  1000. 5: pushl $0 # EAX == 0 => Category 1 (Bad segment)
  1001. CFI_ADJUST_CFA_OFFSET 4
  1002. SAVE_ALL
  1003. jmp ret_from_exception
  1004. CFI_ENDPROC
  1005. .section .fixup,"ax"
  1006. 6: xorl %eax,%eax
  1007. movl %eax,4(%esp)
  1008. jmp 1b
  1009. 7: xorl %eax,%eax
  1010. movl %eax,8(%esp)
  1011. jmp 2b
  1012. 8: xorl %eax,%eax
  1013. movl %eax,12(%esp)
  1014. jmp 3b
  1015. 9: xorl %eax,%eax
  1016. movl %eax,16(%esp)
  1017. jmp 4b
  1018. .previous
  1019. .section __ex_table,"a"
  1020. .align 4
  1021. .long 1b,6b
  1022. .long 2b,7b
  1023. .long 3b,8b
  1024. .long 4b,9b
  1025. .previous
  1026. ENDPROC(xen_failsafe_callback)
  1027. #endif /* CONFIG_XEN */
  1028. #ifdef CONFIG_FTRACE
  1029. #ifdef CONFIG_DYNAMIC_FTRACE
  1030. ENTRY(mcount)
  1031. pushl %eax
  1032. pushl %ecx
  1033. pushl %edx
  1034. movl 0xc(%esp), %eax
  1035. subl $MCOUNT_INSN_SIZE, %eax
  1036. .globl mcount_call
  1037. mcount_call:
  1038. call ftrace_stub
  1039. popl %edx
  1040. popl %ecx
  1041. popl %eax
  1042. ret
  1043. END(mcount)
  1044. ENTRY(ftrace_caller)
  1045. pushl %eax
  1046. pushl %ecx
  1047. pushl %edx
  1048. movl 0xc(%esp), %eax
  1049. movl 0x4(%ebp), %edx
  1050. subl $MCOUNT_INSN_SIZE, %eax
  1051. .globl ftrace_call
  1052. ftrace_call:
  1053. call ftrace_stub
  1054. popl %edx
  1055. popl %ecx
  1056. popl %eax
  1057. .globl ftrace_stub
  1058. ftrace_stub:
  1059. ret
  1060. END(ftrace_caller)
  1061. #else /* ! CONFIG_DYNAMIC_FTRACE */
  1062. ENTRY(mcount)
  1063. cmpl $ftrace_stub, ftrace_trace_function
  1064. jnz trace
  1065. .globl ftrace_stub
  1066. ftrace_stub:
  1067. ret
  1068. /* taken from glibc */
  1069. trace:
  1070. pushl %eax
  1071. pushl %ecx
  1072. pushl %edx
  1073. movl 0xc(%esp), %eax
  1074. movl 0x4(%ebp), %edx
  1075. subl $MCOUNT_INSN_SIZE, %eax
  1076. call *ftrace_trace_function
  1077. popl %edx
  1078. popl %ecx
  1079. popl %eax
  1080. jmp ftrace_stub
  1081. END(mcount)
  1082. #endif /* CONFIG_DYNAMIC_FTRACE */
  1083. #endif /* CONFIG_FTRACE */
  1084. .section .rodata,"a"
  1085. #include "syscall_table_32.S"
  1086. syscall_table_size=(.-sys_call_table)