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 |
Joe Korty | 74b47a7 | 2006-12-07 02:14:04 +0100 | [diff] [blame^] | 460 | #ifdef CONFIG_VM86 |
Jeremy Fitzhardinge | eb5b7b9 | 2006-12-07 02:14:02 +0100 | [diff] [blame] | 461 | testl $VM_MASK, PT_EFLAGS(%esp) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 462 | movl %esp, %eax |
| 463 | jne work_notifysig_v86 # returning to kernel-space or |
| 464 | # vm86-space |
| 465 | xorl %edx, %edx |
| 466 | call do_notify_resume |
Aleksey Gorelov | 4031ff3 | 2006-06-27 02:53:48 -0700 | [diff] [blame] | 467 | jmp resume_userspace_sig |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 468 | |
| 469 | ALIGN |
| 470 | work_notifysig_v86: |
| 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 |
Joe Korty | 74b47a7 | 2006-12-07 02:14:04 +0100 | [diff] [blame^] | 477 | #else |
| 478 | movl %esp, %eax |
| 479 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 480 | xorl %edx, %edx |
| 481 | call do_notify_resume |
Aleksey Gorelov | 4031ff3 | 2006-06-27 02:53:48 -0700 | [diff] [blame] | 482 | jmp resume_userspace_sig |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 483 | |
| 484 | # perform syscall exit tracing |
| 485 | ALIGN |
| 486 | syscall_trace_entry: |
Jeremy Fitzhardinge | eb5b7b9 | 2006-12-07 02:14:02 +0100 | [diff] [blame] | 487 | movl $-ENOSYS,PT_EAX(%esp) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 488 | movl %esp, %eax |
| 489 | xorl %edx,%edx |
| 490 | call do_syscall_trace |
Laurent Vivier | ed75e8d | 2005-09-03 15:57:18 -0700 | [diff] [blame] | 491 | cmpl $0, %eax |
Paolo 'Blaisorblade' Giarrusso | 640aa46 | 2005-09-03 15:57:22 -0700 | [diff] [blame] | 492 | jne resume_userspace # ret != 0 -> running under PTRACE_SYSEMU, |
Laurent Vivier | ed75e8d | 2005-09-03 15:57:18 -0700 | [diff] [blame] | 493 | # so must skip actual syscall |
Jeremy Fitzhardinge | eb5b7b9 | 2006-12-07 02:14:02 +0100 | [diff] [blame] | 494 | movl PT_ORIG_EAX(%esp), %eax |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 495 | cmpl $(nr_syscalls), %eax |
| 496 | jnae syscall_call |
| 497 | jmp syscall_exit |
| 498 | |
| 499 | # perform syscall exit tracing |
| 500 | ALIGN |
| 501 | syscall_exit_work: |
| 502 | testb $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP), %cl |
| 503 | jz work_pending |
Ingo Molnar | 55f327f | 2006-07-03 00:24:43 -0700 | [diff] [blame] | 504 | TRACE_IRQS_ON |
Rusty Russell | 0da5db3 | 2006-09-26 10:52:39 +0200 | [diff] [blame] | 505 | ENABLE_INTERRUPTS # could let do_syscall_trace() call |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 506 | # schedule() instead |
| 507 | movl %esp, %eax |
| 508 | movl $1, %edx |
| 509 | call do_syscall_trace |
| 510 | jmp resume_userspace |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 511 | CFI_ENDPROC |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 512 | |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 513 | RING0_INT_FRAME # can't unwind into user space anyway |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 514 | syscall_fault: |
| 515 | pushl %eax # save orig_eax |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 516 | CFI_ADJUST_CFA_OFFSET 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 517 | SAVE_ALL |
| 518 | GET_THREAD_INFO(%ebp) |
Jeremy Fitzhardinge | eb5b7b9 | 2006-12-07 02:14:02 +0100 | [diff] [blame] | 519 | movl $-EFAULT,PT_EAX(%esp) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 520 | jmp resume_userspace |
| 521 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 522 | syscall_badsys: |
Jeremy Fitzhardinge | eb5b7b9 | 2006-12-07 02:14:02 +0100 | [diff] [blame] | 523 | movl $-ENOSYS,PT_EAX(%esp) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 524 | jmp resume_userspace |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 525 | CFI_ENDPROC |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 526 | |
| 527 | #define FIXUP_ESPFIX_STACK \ |
Stas Sergeev | be44d2a | 2006-12-07 02:14:01 +0100 | [diff] [blame] | 528 | /* 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] | 529 | movl %gs:PDA_cpu, %ebx; \ |
Stas Sergeev | be44d2a | 2006-12-07 02:14:01 +0100 | [diff] [blame] | 530 | PER_CPU(cpu_gdt_descr, %ebx); \ |
| 531 | movl GDS_address(%ebx), %ebx; \ |
| 532 | GET_DESC_BASE(GDT_ENTRY_ESPFIX_SS, %ebx, %eax, %ax, %al, %ah); \ |
| 533 | addl %esp, %eax; \ |
| 534 | pushl $__KERNEL_DS; \ |
| 535 | CFI_ADJUST_CFA_OFFSET 4; \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 536 | pushl %eax; \ |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 537 | CFI_ADJUST_CFA_OFFSET 4; \ |
Stas Sergeev | be44d2a | 2006-12-07 02:14:01 +0100 | [diff] [blame] | 538 | lss (%esp), %esp; \ |
| 539 | CFI_ADJUST_CFA_OFFSET -8; |
| 540 | #define UNWIND_ESPFIX_STACK \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 541 | movl %ss, %eax; \ |
Stas Sergeev | be44d2a | 2006-12-07 02:14:01 +0100 | [diff] [blame] | 542 | /* see if on espfix stack */ \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 543 | cmpw $__ESPFIX_SS, %ax; \ |
Stas Sergeev | be44d2a | 2006-12-07 02:14:01 +0100 | [diff] [blame] | 544 | jne 27f; \ |
| 545 | movl $__KERNEL_DS, %eax; \ |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 546 | movl %eax, %ds; \ |
| 547 | movl %eax, %es; \ |
Stas Sergeev | be44d2a | 2006-12-07 02:14:01 +0100 | [diff] [blame] | 548 | /* switch to normal stack */ \ |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 549 | FIXUP_ESPFIX_STACK; \ |
Stas Sergeev | be44d2a | 2006-12-07 02:14:01 +0100 | [diff] [blame] | 550 | 27:; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 551 | |
| 552 | /* |
| 553 | * Build the entry stubs and pointer table with |
| 554 | * some assembler magic. |
| 555 | */ |
| 556 | .data |
| 557 | ENTRY(interrupt) |
| 558 | .text |
| 559 | |
| 560 | vector=0 |
| 561 | ENTRY(irq_entries_start) |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 562 | RING0_INT_FRAME |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 563 | .rept NR_IRQS |
| 564 | ALIGN |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 565 | .if vector |
| 566 | CFI_ADJUST_CFA_OFFSET -4 |
| 567 | .endif |
Rusty Russell | 19eadf9 | 2006-06-27 02:53:44 -0700 | [diff] [blame] | 568 | 1: pushl $~(vector) |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 569 | CFI_ADJUST_CFA_OFFSET 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 570 | jmp common_interrupt |
| 571 | .data |
| 572 | .long 1b |
| 573 | .text |
| 574 | vector=vector+1 |
| 575 | .endr |
| 576 | |
Ingo Molnar | 55f327f | 2006-07-03 00:24:43 -0700 | [diff] [blame] | 577 | /* |
| 578 | * the CPU automatically disables interrupts when executing an IRQ vector, |
| 579 | * so IRQ-flags tracing has to follow that: |
| 580 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 581 | ALIGN |
| 582 | common_interrupt: |
| 583 | SAVE_ALL |
Ingo Molnar | 55f327f | 2006-07-03 00:24:43 -0700 | [diff] [blame] | 584 | TRACE_IRQS_OFF |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 585 | movl %esp,%eax |
| 586 | call do_IRQ |
| 587 | jmp ret_from_intr |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 588 | CFI_ENDPROC |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 589 | |
| 590 | #define BUILD_INTERRUPT(name, nr) \ |
| 591 | ENTRY(name) \ |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 592 | RING0_INT_FRAME; \ |
Rusty Russell | 19eadf9 | 2006-06-27 02:53:44 -0700 | [diff] [blame] | 593 | pushl $~(nr); \ |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 594 | CFI_ADJUST_CFA_OFFSET 4; \ |
| 595 | SAVE_ALL; \ |
Ingo Molnar | 55f327f | 2006-07-03 00:24:43 -0700 | [diff] [blame] | 596 | TRACE_IRQS_OFF \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 597 | movl %esp,%eax; \ |
| 598 | call smp_/**/name; \ |
Ingo Molnar | 55f327f | 2006-07-03 00:24:43 -0700 | [diff] [blame] | 599 | jmp ret_from_intr; \ |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 600 | CFI_ENDPROC |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 601 | |
| 602 | /* The include is where all of the SMP etc. interrupts come from */ |
| 603 | #include "entry_arch.h" |
| 604 | |
Prasanna S.P | d28c439 | 2006-09-26 10:52:34 +0200 | [diff] [blame] | 605 | KPROBE_ENTRY(page_fault) |
| 606 | RING0_EC_FRAME |
| 607 | pushl $do_page_fault |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 608 | CFI_ADJUST_CFA_OFFSET 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 609 | ALIGN |
| 610 | error_code: |
Jeremy Fitzhardinge | f95d47c | 2006-12-07 02:14:02 +0100 | [diff] [blame] | 611 | /* the function address is in %gs's slot on the stack */ |
| 612 | pushl %es |
| 613 | CFI_ADJUST_CFA_OFFSET 4 |
| 614 | /*CFI_REL_OFFSET es, 0*/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 615 | pushl %ds |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 616 | CFI_ADJUST_CFA_OFFSET 4 |
| 617 | /*CFI_REL_OFFSET ds, 0*/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 618 | pushl %eax |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 619 | CFI_ADJUST_CFA_OFFSET 4 |
| 620 | CFI_REL_OFFSET eax, 0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 621 | pushl %ebp |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 622 | CFI_ADJUST_CFA_OFFSET 4 |
| 623 | CFI_REL_OFFSET ebp, 0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 624 | pushl %edi |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 625 | CFI_ADJUST_CFA_OFFSET 4 |
| 626 | CFI_REL_OFFSET edi, 0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 627 | pushl %esi |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 628 | CFI_ADJUST_CFA_OFFSET 4 |
| 629 | CFI_REL_OFFSET esi, 0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 630 | pushl %edx |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 631 | CFI_ADJUST_CFA_OFFSET 4 |
| 632 | CFI_REL_OFFSET edx, 0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 633 | pushl %ecx |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 634 | CFI_ADJUST_CFA_OFFSET 4 |
| 635 | CFI_REL_OFFSET ecx, 0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 636 | pushl %ebx |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 637 | CFI_ADJUST_CFA_OFFSET 4 |
| 638 | CFI_REL_OFFSET ebx, 0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 639 | cld |
Jeremy Fitzhardinge | f95d47c | 2006-12-07 02:14:02 +0100 | [diff] [blame] | 640 | pushl %gs |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 641 | CFI_ADJUST_CFA_OFFSET 4 |
Jeremy Fitzhardinge | f95d47c | 2006-12-07 02:14:02 +0100 | [diff] [blame] | 642 | /*CFI_REL_OFFSET gs, 0*/ |
| 643 | movl $(__KERNEL_PDA), %ecx |
| 644 | movl %ecx, %gs |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 645 | UNWIND_ESPFIX_STACK |
| 646 | popl %ecx |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 647 | CFI_ADJUST_CFA_OFFSET -4 |
| 648 | /*CFI_REGISTER es, ecx*/ |
Jeremy Fitzhardinge | f95d47c | 2006-12-07 02:14:02 +0100 | [diff] [blame] | 649 | movl PT_GS(%esp), %edi # get the function address |
Jeremy Fitzhardinge | eb5b7b9 | 2006-12-07 02:14:02 +0100 | [diff] [blame] | 650 | movl PT_ORIG_EAX(%esp), %edx # get the error code |
Jeremy Fitzhardinge | f95d47c | 2006-12-07 02:14:02 +0100 | [diff] [blame] | 651 | movl $-1, PT_ORIG_EAX(%esp) # no syscall to restart |
| 652 | mov %ecx, PT_GS(%esp) |
| 653 | /*CFI_REL_OFFSET gs, ES*/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 654 | movl $(__USER_DS), %ecx |
| 655 | movl %ecx, %ds |
| 656 | movl %ecx, %es |
| 657 | movl %esp,%eax # pt_regs pointer |
| 658 | call *%edi |
| 659 | jmp ret_from_exception |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 660 | CFI_ENDPROC |
Prasanna S.P | d28c439 | 2006-09-26 10:52:34 +0200 | [diff] [blame] | 661 | KPROBE_END(page_fault) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 662 | |
| 663 | ENTRY(coprocessor_error) |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 664 | RING0_INT_FRAME |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 665 | pushl $0 |
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 | pushl $do_coprocessor_error |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 668 | CFI_ADJUST_CFA_OFFSET 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 669 | jmp error_code |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 670 | CFI_ENDPROC |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 671 | |
| 672 | ENTRY(simd_coprocessor_error) |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 673 | RING0_INT_FRAME |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 674 | pushl $0 |
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 | pushl $do_simd_coprocessor_error |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 677 | CFI_ADJUST_CFA_OFFSET 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 678 | jmp error_code |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 679 | CFI_ENDPROC |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 680 | |
| 681 | ENTRY(device_not_available) |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 682 | RING0_INT_FRAME |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 683 | pushl $-1 # mark this as an int |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 684 | CFI_ADJUST_CFA_OFFSET 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 685 | SAVE_ALL |
Rusty Russell | 0da5db3 | 2006-09-26 10:52:39 +0200 | [diff] [blame] | 686 | GET_CR0_INTO_EAX |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 687 | testl $0x4, %eax # EM (math emulation bit) |
| 688 | jne device_not_available_emulate |
| 689 | preempt_stop |
| 690 | call math_state_restore |
| 691 | jmp ret_from_exception |
| 692 | device_not_available_emulate: |
| 693 | pushl $0 # temporary storage for ORIG_EIP |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 694 | CFI_ADJUST_CFA_OFFSET 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 695 | call math_emulate |
| 696 | addl $4, %esp |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 697 | CFI_ADJUST_CFA_OFFSET -4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 698 | jmp ret_from_exception |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 699 | CFI_ENDPROC |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 700 | |
| 701 | /* |
| 702 | * Debug traps and NMI can happen at the one SYSENTER instruction |
| 703 | * that sets up the real kernel stack. Check here, since we can't |
| 704 | * allow the wrong stack to be used. |
| 705 | * |
| 706 | * "TSS_sysenter_esp0+12" is because the NMI/debug handler will have |
| 707 | * already pushed 3 words if it hits on the sysenter instruction: |
| 708 | * eflags, cs and eip. |
| 709 | * |
| 710 | * We just load the right stack, and push the three (known) values |
| 711 | * by hand onto the new stack - while updating the return eip past |
| 712 | * the instruction that would have done it for sysenter. |
| 713 | */ |
| 714 | #define FIX_STACK(offset, ok, label) \ |
| 715 | cmpw $__KERNEL_CS,4(%esp); \ |
| 716 | jne ok; \ |
| 717 | label: \ |
| 718 | movl TSS_sysenter_esp0+offset(%esp),%esp; \ |
Chuck Ebbert | a549b86 | 2006-09-26 10:52:37 +0200 | [diff] [blame] | 719 | CFI_DEF_CFA esp, 0; \ |
| 720 | CFI_UNDEFINED eip; \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 721 | pushfl; \ |
Chuck Ebbert | a549b86 | 2006-09-26 10:52:37 +0200 | [diff] [blame] | 722 | CFI_ADJUST_CFA_OFFSET 4; \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 723 | pushl $__KERNEL_CS; \ |
Chuck Ebbert | a549b86 | 2006-09-26 10:52:37 +0200 | [diff] [blame] | 724 | CFI_ADJUST_CFA_OFFSET 4; \ |
| 725 | pushl $sysenter_past_esp; \ |
| 726 | CFI_ADJUST_CFA_OFFSET 4; \ |
| 727 | CFI_REL_OFFSET eip, 0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 728 | |
Prasanna S Panchamukhi | 3d97ae5 | 2005-09-06 15:19:27 -0700 | [diff] [blame] | 729 | KPROBE_ENTRY(debug) |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 730 | RING0_INT_FRAME |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 731 | cmpl $sysenter_entry,(%esp) |
| 732 | jne debug_stack_correct |
| 733 | FIX_STACK(12, debug_stack_correct, debug_esp_fix_insn) |
| 734 | debug_stack_correct: |
| 735 | pushl $-1 # mark this as an int |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 736 | CFI_ADJUST_CFA_OFFSET 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 737 | SAVE_ALL |
| 738 | xorl %edx,%edx # error code 0 |
| 739 | movl %esp,%eax # pt_regs pointer |
| 740 | call do_debug |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 741 | jmp ret_from_exception |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 742 | CFI_ENDPROC |
Prasanna S.P | d28c439 | 2006-09-26 10:52:34 +0200 | [diff] [blame] | 743 | KPROBE_END(debug) |
| 744 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 745 | /* |
| 746 | * NMI is doubly nasty. It can happen _while_ we're handling |
| 747 | * a debug fault, and the debug fault hasn't yet been able to |
| 748 | * clear up the stack. So we first check whether we got an |
| 749 | * NMI on the sysenter entry path, but after that we need to |
| 750 | * check whether we got an NMI on the debug path where the debug |
| 751 | * fault happened on the sysenter path. |
| 752 | */ |
Fernando Luis Vázquez Cao | 0603975 | 2006-09-26 10:52:36 +0200 | [diff] [blame] | 753 | KPROBE_ENTRY(nmi) |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 754 | RING0_INT_FRAME |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 755 | pushl %eax |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 756 | CFI_ADJUST_CFA_OFFSET 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 757 | movl %ss, %eax |
| 758 | cmpw $__ESPFIX_SS, %ax |
| 759 | popl %eax |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 760 | CFI_ADJUST_CFA_OFFSET -4 |
Stas Sergeev | be44d2a | 2006-12-07 02:14:01 +0100 | [diff] [blame] | 761 | je nmi_espfix_stack |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 762 | cmpl $sysenter_entry,(%esp) |
| 763 | je nmi_stack_fixup |
| 764 | pushl %eax |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 765 | CFI_ADJUST_CFA_OFFSET 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 766 | movl %esp,%eax |
| 767 | /* Do not access memory above the end of our stack page, |
| 768 | * it might not exist. |
| 769 | */ |
| 770 | andl $(THREAD_SIZE-1),%eax |
| 771 | cmpl $(THREAD_SIZE-20),%eax |
| 772 | popl %eax |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 773 | CFI_ADJUST_CFA_OFFSET -4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 774 | jae nmi_stack_correct |
| 775 | cmpl $sysenter_entry,12(%esp) |
| 776 | je nmi_debug_stack_check |
| 777 | nmi_stack_correct: |
Chuck Ebbert | a549b86 | 2006-09-26 10:52:37 +0200 | [diff] [blame] | 778 | /* We have a RING0_INT_FRAME here */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 779 | pushl %eax |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 780 | CFI_ADJUST_CFA_OFFSET 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 781 | SAVE_ALL |
| 782 | xorl %edx,%edx # zero error code |
| 783 | movl %esp,%eax # pt_regs pointer |
| 784 | call do_nmi |
Ingo Molnar | 55f327f | 2006-07-03 00:24:43 -0700 | [diff] [blame] | 785 | jmp restore_nocheck_notrace |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 786 | CFI_ENDPROC |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 787 | |
| 788 | nmi_stack_fixup: |
Chuck Ebbert | a549b86 | 2006-09-26 10:52:37 +0200 | [diff] [blame] | 789 | RING0_INT_FRAME |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 790 | FIX_STACK(12,nmi_stack_correct, 1) |
| 791 | jmp nmi_stack_correct |
Chuck Ebbert | a549b86 | 2006-09-26 10:52:37 +0200 | [diff] [blame] | 792 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 793 | nmi_debug_stack_check: |
Chuck Ebbert | a549b86 | 2006-09-26 10:52:37 +0200 | [diff] [blame] | 794 | /* We have a RING0_INT_FRAME here */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 795 | cmpw $__KERNEL_CS,16(%esp) |
| 796 | jne nmi_stack_correct |
Jan Beulich | e271820 | 2005-11-13 16:06:52 -0800 | [diff] [blame] | 797 | cmpl $debug,(%esp) |
| 798 | jb nmi_stack_correct |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 799 | cmpl $debug_esp_fix_insn,(%esp) |
Jan Beulich | e271820 | 2005-11-13 16:06:52 -0800 | [diff] [blame] | 800 | ja nmi_stack_correct |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 801 | FIX_STACK(24,nmi_stack_correct, 1) |
| 802 | jmp nmi_stack_correct |
| 803 | |
Stas Sergeev | be44d2a | 2006-12-07 02:14:01 +0100 | [diff] [blame] | 804 | nmi_espfix_stack: |
Chuck Ebbert | a549b86 | 2006-09-26 10:52:37 +0200 | [diff] [blame] | 805 | /* We have a RING0_INT_FRAME here. |
| 806 | * |
| 807 | * create the pointer to lss back |
| 808 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 809 | pushl %ss |
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 | pushl %esp |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 812 | CFI_ADJUST_CFA_OFFSET 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 813 | addw $4, (%esp) |
| 814 | /* copy the iret frame of 12 bytes */ |
| 815 | .rept 3 |
| 816 | pushl 16(%esp) |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 817 | CFI_ADJUST_CFA_OFFSET 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 818 | .endr |
| 819 | pushl %eax |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 820 | CFI_ADJUST_CFA_OFFSET 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 821 | SAVE_ALL |
| 822 | FIXUP_ESPFIX_STACK # %eax == %esp |
| 823 | xorl %edx,%edx # zero error code |
| 824 | call do_nmi |
| 825 | RESTORE_REGS |
Stas Sergeev | be44d2a | 2006-12-07 02:14:01 +0100 | [diff] [blame] | 826 | lss 12+4(%esp), %esp # back to espfix stack |
| 827 | CFI_ADJUST_CFA_OFFSET -24 |
Rusty Russell | 0da5db3 | 2006-09-26 10:52:39 +0200 | [diff] [blame] | 828 | 1: INTERRUPT_RETURN |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 829 | CFI_ENDPROC |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 830 | .section __ex_table,"a" |
| 831 | .align 4 |
| 832 | .long 1b,iret_exc |
| 833 | .previous |
Fernando Luis Vázquez Cao | 0603975 | 2006-09-26 10:52:36 +0200 | [diff] [blame] | 834 | KPROBE_END(nmi) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 835 | |
Prasanna S Panchamukhi | 3d97ae5 | 2005-09-06 15:19:27 -0700 | [diff] [blame] | 836 | KPROBE_ENTRY(int3) |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 837 | RING0_INT_FRAME |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 838 | pushl $-1 # mark this as an int |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 839 | CFI_ADJUST_CFA_OFFSET 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 840 | SAVE_ALL |
| 841 | xorl %edx,%edx # zero error code |
| 842 | movl %esp,%eax # pt_regs pointer |
| 843 | call do_int3 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 844 | jmp ret_from_exception |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 845 | CFI_ENDPROC |
Prasanna S.P | d28c439 | 2006-09-26 10:52:34 +0200 | [diff] [blame] | 846 | KPROBE_END(int3) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 847 | |
| 848 | ENTRY(overflow) |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 849 | RING0_INT_FRAME |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 850 | pushl $0 |
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 | pushl $do_overflow |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 853 | CFI_ADJUST_CFA_OFFSET 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 854 | jmp error_code |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 855 | CFI_ENDPROC |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 856 | |
| 857 | ENTRY(bounds) |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 858 | RING0_INT_FRAME |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 859 | pushl $0 |
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 | pushl $do_bounds |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 862 | CFI_ADJUST_CFA_OFFSET 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 863 | jmp error_code |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 864 | CFI_ENDPROC |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 865 | |
| 866 | ENTRY(invalid_op) |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 867 | RING0_INT_FRAME |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 868 | pushl $0 |
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 | pushl $do_invalid_op |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 871 | CFI_ADJUST_CFA_OFFSET 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 872 | jmp error_code |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 873 | CFI_ENDPROC |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 874 | |
| 875 | ENTRY(coprocessor_segment_overrun) |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 876 | RING0_INT_FRAME |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 877 | pushl $0 |
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 | pushl $do_coprocessor_segment_overrun |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 880 | CFI_ADJUST_CFA_OFFSET 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 881 | jmp error_code |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 882 | CFI_ENDPROC |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 883 | |
| 884 | ENTRY(invalid_TSS) |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 885 | RING0_EC_FRAME |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 886 | pushl $do_invalid_TSS |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 887 | CFI_ADJUST_CFA_OFFSET 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 888 | jmp error_code |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 889 | CFI_ENDPROC |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 890 | |
| 891 | ENTRY(segment_not_present) |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 892 | RING0_EC_FRAME |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 893 | pushl $do_segment_not_present |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 894 | CFI_ADJUST_CFA_OFFSET 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 895 | jmp error_code |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 896 | CFI_ENDPROC |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 897 | |
| 898 | ENTRY(stack_segment) |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 899 | RING0_EC_FRAME |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 900 | pushl $do_stack_segment |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 901 | CFI_ADJUST_CFA_OFFSET 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 902 | jmp error_code |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 903 | CFI_ENDPROC |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 904 | |
Prasanna S Panchamukhi | 3d97ae5 | 2005-09-06 15:19:27 -0700 | [diff] [blame] | 905 | KPROBE_ENTRY(general_protection) |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 906 | RING0_EC_FRAME |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 907 | pushl $do_general_protection |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 908 | CFI_ADJUST_CFA_OFFSET 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 909 | jmp error_code |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 910 | CFI_ENDPROC |
Prasanna S.P | d28c439 | 2006-09-26 10:52:34 +0200 | [diff] [blame] | 911 | KPROBE_END(general_protection) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 912 | |
| 913 | ENTRY(alignment_check) |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 914 | RING0_EC_FRAME |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 915 | pushl $do_alignment_check |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 916 | CFI_ADJUST_CFA_OFFSET 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 917 | jmp error_code |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 918 | CFI_ENDPROC |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 919 | |
Prasanna S.P | d28c439 | 2006-09-26 10:52:34 +0200 | [diff] [blame] | 920 | ENTRY(divide_error) |
| 921 | RING0_INT_FRAME |
| 922 | pushl $0 # no error code |
| 923 | CFI_ADJUST_CFA_OFFSET 4 |
| 924 | pushl $do_divide_error |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 925 | CFI_ADJUST_CFA_OFFSET 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 926 | jmp error_code |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 927 | CFI_ENDPROC |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 928 | |
| 929 | #ifdef CONFIG_X86_MCE |
| 930 | ENTRY(machine_check) |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 931 | RING0_INT_FRAME |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 932 | pushl $0 |
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 | pushl machine_check_vector |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 935 | CFI_ADJUST_CFA_OFFSET 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 936 | jmp error_code |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 937 | CFI_ENDPROC |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 938 | #endif |
| 939 | |
| 940 | ENTRY(spurious_interrupt_bug) |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 941 | RING0_INT_FRAME |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 942 | pushl $0 |
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 | pushl $do_spurious_interrupt_bug |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 945 | CFI_ADJUST_CFA_OFFSET 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 946 | jmp error_code |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 947 | CFI_ENDPROC |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 948 | |
Jan Beulich | 176a271 | 2006-06-26 13:57:41 +0200 | [diff] [blame] | 949 | #ifdef CONFIG_STACK_UNWIND |
| 950 | ENTRY(arch_unwind_init_running) |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 951 | CFI_STARTPROC |
Jan Beulich | 176a271 | 2006-06-26 13:57:41 +0200 | [diff] [blame] | 952 | movl 4(%esp), %edx |
| 953 | movl (%esp), %ecx |
| 954 | leal 4(%esp), %eax |
Jeremy Fitzhardinge | eb5b7b9 | 2006-12-07 02:14:02 +0100 | [diff] [blame] | 955 | movl %ebx, PT_EBX(%edx) |
Jan Beulich | 176a271 | 2006-06-26 13:57:41 +0200 | [diff] [blame] | 956 | xorl %ebx, %ebx |
Jeremy Fitzhardinge | eb5b7b9 | 2006-12-07 02:14:02 +0100 | [diff] [blame] | 957 | movl %ebx, PT_ECX(%edx) |
| 958 | movl %ebx, PT_EDX(%edx) |
| 959 | movl %esi, PT_ESI(%edx) |
| 960 | movl %edi, PT_EDI(%edx) |
| 961 | movl %ebp, PT_EBP(%edx) |
| 962 | movl %ebx, PT_EAX(%edx) |
| 963 | movl $__USER_DS, PT_DS(%edx) |
| 964 | movl $__USER_DS, PT_ES(%edx) |
Jeremy Fitzhardinge | f95d47c | 2006-12-07 02:14:02 +0100 | [diff] [blame] | 965 | movl $0, PT_GS(%edx) |
Jeremy Fitzhardinge | eb5b7b9 | 2006-12-07 02:14:02 +0100 | [diff] [blame] | 966 | movl %ebx, PT_ORIG_EAX(%edx) |
| 967 | movl %ecx, PT_EIP(%edx) |
Jan Beulich | 176a271 | 2006-06-26 13:57:41 +0200 | [diff] [blame] | 968 | movl 12(%esp), %ecx |
Jeremy Fitzhardinge | eb5b7b9 | 2006-12-07 02:14:02 +0100 | [diff] [blame] | 969 | movl $__KERNEL_CS, PT_CS(%edx) |
| 970 | movl %ebx, PT_EFLAGS(%edx) |
| 971 | movl %eax, PT_OLDESP(%edx) |
Jan Beulich | 176a271 | 2006-06-26 13:57:41 +0200 | [diff] [blame] | 972 | movl 8(%esp), %eax |
| 973 | movl %ecx, 8(%esp) |
Jeremy Fitzhardinge | eb5b7b9 | 2006-12-07 02:14:02 +0100 | [diff] [blame] | 974 | movl PT_EBX(%edx), %ebx |
| 975 | movl $__KERNEL_DS, PT_OLDSS(%edx) |
Jan Beulich | 176a271 | 2006-06-26 13:57:41 +0200 | [diff] [blame] | 976 | jmpl *%eax |
Jan Beulich | fe7cacc | 2006-06-26 13:57:44 +0200 | [diff] [blame] | 977 | CFI_ENDPROC |
Jan Beulich | 176a271 | 2006-06-26 13:57:41 +0200 | [diff] [blame] | 978 | ENDPROC(arch_unwind_init_running) |
| 979 | #endif |
| 980 | |
Andi Kleen | 02ba1a3 | 2006-09-26 10:52:35 +0200 | [diff] [blame] | 981 | ENTRY(kernel_thread_helper) |
| 982 | pushl $0 # fake return address for unwinder |
| 983 | CFI_STARTPROC |
| 984 | movl %edx,%eax |
| 985 | push %edx |
| 986 | CFI_ADJUST_CFA_OFFSET 4 |
| 987 | call *%ebx |
| 988 | push %eax |
| 989 | CFI_ADJUST_CFA_OFFSET 4 |
| 990 | call do_exit |
| 991 | CFI_ENDPROC |
| 992 | ENDPROC(kernel_thread_helper) |
| 993 | |
Arjan van de Ven | bb152f5 | 2006-01-06 00:12:05 -0800 | [diff] [blame] | 994 | .section .rodata,"a" |
Paolo 'Blaisorblade' Giarrusso | 5e7b83f | 2005-05-01 08:58:55 -0700 | [diff] [blame] | 995 | #include "syscall_table.S" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 996 | |
| 997 | syscall_table_size=(.-sys_call_table) |