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