aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/entry_32.S
diff options
context:
space:
mode:
authorJan Beulich <JBeulich@novell.com>2010-09-02 09:07:16 -0400
committerIngo Molnar <mingo@elte.hu>2010-09-03 02:14:11 -0400
commitdf5d1874ce1a1f0e0eceff4fa3a9d45620243a68 (patch)
tree0537808418ae9d181fa4a569b3573b1ac59e83c0 /arch/x86/kernel/entry_32.S
parenta34107b5577968dc53cf9c2195c7c2d4a2caf9ce (diff)
x86: Use {push,pop}{l,q}_cfi in more places
... plus additionally introduce {push,pop}f{l,q}_cfi. All in the hope that the code becomes better readable this way (it gets quite a bit smaller in any case). Signed-off-by: Jan Beulich <jbeulich@novell.com> Acked-by: Alexander van Heukelum <heukelum@fastmail.fm> LKML-Reference: <4C7FBDA40200007800013FAF@vpn.id2.novell.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/entry_32.S')
-rw-r--r--arch/x86/kernel/entry_32.S294
1 files changed, 98 insertions, 196 deletions
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
index d9b950ee559..9fb188d7bc7 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -115,8 +115,7 @@
115 115
116 /* unfortunately push/pop can't be no-op */ 116 /* unfortunately push/pop can't be no-op */
117.macro PUSH_GS 117.macro PUSH_GS
118 pushl $0 118 pushl_cfi $0
119 CFI_ADJUST_CFA_OFFSET 4
120.endm 119.endm
121.macro POP_GS pop=0 120.macro POP_GS pop=0
122 addl $(4 + \pop), %esp 121 addl $(4 + \pop), %esp
@@ -140,14 +139,12 @@
140#else /* CONFIG_X86_32_LAZY_GS */ 139#else /* CONFIG_X86_32_LAZY_GS */
141 140
142.macro PUSH_GS 141.macro PUSH_GS
143 pushl %gs 142 pushl_cfi %gs
144 CFI_ADJUST_CFA_OFFSET 4
145 /*CFI_REL_OFFSET gs, 0*/ 143 /*CFI_REL_OFFSET gs, 0*/
146.endm 144.endm
147 145
148.macro POP_GS pop=0 146.macro POP_GS pop=0
14998: popl %gs 14798: popl_cfi %gs
150 CFI_ADJUST_CFA_OFFSET -4
151 /*CFI_RESTORE gs*/ 148 /*CFI_RESTORE gs*/
152 .if \pop <> 0 149 .if \pop <> 0
153 add $\pop, %esp 150 add $\pop, %esp
@@ -195,35 +192,25 @@
195.macro SAVE_ALL 192.macro SAVE_ALL
196 cld 193 cld
197 PUSH_GS 194 PUSH_GS
198 pushl %fs 195 pushl_cfi %fs
199 CFI_ADJUST_CFA_OFFSET 4
200 /*CFI_REL_OFFSET fs, 0;*/ 196 /*CFI_REL_OFFSET fs, 0;*/
201 pushl %es 197 pushl_cfi %es
202 CFI_ADJUST_CFA_OFFSET 4
203 /*CFI_REL_OFFSET es, 0;*/ 198 /*CFI_REL_OFFSET es, 0;*/
204 pushl %ds 199 pushl_cfi %ds
205 CFI_ADJUST_CFA_OFFSET 4
206 /*CFI_REL_OFFSET ds, 0;*/ 200 /*CFI_REL_OFFSET ds, 0;*/
207 pushl %eax 201 pushl_cfi %eax
208 CFI_ADJUST_CFA_OFFSET 4
209 CFI_REL_OFFSET eax, 0 202 CFI_REL_OFFSET eax, 0
210 pushl %ebp 203 pushl_cfi %ebp
211 CFI_ADJUST_CFA_OFFSET 4
212 CFI_REL_OFFSET ebp, 0 204 CFI_REL_OFFSET ebp, 0
213 pushl %edi 205 pushl_cfi %edi
214 CFI_ADJUST_CFA_OFFSET 4
215 CFI_REL_OFFSET edi, 0 206 CFI_REL_OFFSET edi, 0
216 pushl %esi 207 pushl_cfi %esi
217 CFI_ADJUST_CFA_OFFSET 4
218 CFI_REL_OFFSET esi, 0 208 CFI_REL_OFFSET esi, 0
219 pushl %edx 209 pushl_cfi %edx
220 CFI_ADJUST_CFA_OFFSET 4
221 CFI_REL_OFFSET edx, 0 210 CFI_REL_OFFSET edx, 0
222 pushl %ecx 211 pushl_cfi %ecx
223 CFI_ADJUST_CFA_OFFSET 4
224 CFI_REL_OFFSET ecx, 0 212 CFI_REL_OFFSET ecx, 0
225 pushl %ebx 213 pushl_cfi %ebx
226 CFI_ADJUST_CFA_OFFSET 4
227 CFI_REL_OFFSET ebx, 0 214 CFI_REL_OFFSET ebx, 0
228 movl $(__USER_DS), %edx 215 movl $(__USER_DS), %edx
229 movl %edx, %ds 216 movl %edx, %ds
@@ -234,39 +221,29 @@
234.endm 221.endm
235 222
236.macro RESTORE_INT_REGS 223.macro RESTORE_INT_REGS
237 popl %ebx 224 popl_cfi %ebx
238 CFI_ADJUST_CFA_OFFSET -4
239 CFI_RESTORE ebx 225 CFI_RESTORE ebx
240 popl %ecx 226 popl_cfi %ecx
241 CFI_ADJUST_CFA_OFFSET -4
242 CFI_RESTORE ecx 227 CFI_RESTORE ecx
243 popl %edx 228 popl_cfi %edx
244 CFI_ADJUST_CFA_OFFSET -4
245 CFI_RESTORE edx 229 CFI_RESTORE edx
246 popl %esi 230 popl_cfi %esi
247 CFI_ADJUST_CFA_OFFSET -4
248 CFI_RESTORE esi 231 CFI_RESTORE esi
249 popl %edi 232 popl_cfi %edi
250 CFI_ADJUST_CFA_OFFSET -4
251 CFI_RESTORE edi 233 CFI_RESTORE edi
252 popl %ebp 234 popl_cfi %ebp
253 CFI_ADJUST_CFA_OFFSET -4
254 CFI_RESTORE ebp 235 CFI_RESTORE ebp
255 popl %eax 236 popl_cfi %eax
256 CFI_ADJUST_CFA_OFFSET -4
257 CFI_RESTORE eax 237 CFI_RESTORE eax
258.endm 238.endm
259 239
260.macro RESTORE_REGS pop=0 240.macro RESTORE_REGS pop=0
261 RESTORE_INT_REGS 241 RESTORE_INT_REGS
2621: popl %ds 2421: popl_cfi %ds
263 CFI_ADJUST_CFA_OFFSET -4
264 /*CFI_RESTORE ds;*/ 243 /*CFI_RESTORE ds;*/
2652: popl %es 2442: popl_cfi %es
266 CFI_ADJUST_CFA_OFFSET -4
267 /*CFI_RESTORE es;*/ 245 /*CFI_RESTORE es;*/
2683: popl %fs 2463: popl_cfi %fs
269 CFI_ADJUST_CFA_OFFSET -4
270 /*CFI_RESTORE fs;*/ 247 /*CFI_RESTORE fs;*/
271 POP_GS \pop 248 POP_GS \pop
272.pushsection .fixup, "ax" 249.pushsection .fixup, "ax"
@@ -320,16 +297,12 @@
320 297
321ENTRY(ret_from_fork) 298ENTRY(ret_from_fork)
322 CFI_STARTPROC 299 CFI_STARTPROC
323 pushl %eax 300 pushl_cfi %eax
324 CFI_ADJUST_CFA_OFFSET 4
325 call schedule_tail 301 call schedule_tail
326 GET_THREAD_INFO(%ebp) 302 GET_THREAD_INFO(%ebp)
327 popl %eax 303 popl_cfi %eax
328 CFI_ADJUST_CFA_OFFSET -4 304 pushl_cfi $0x0202 # Reset kernel eflags
329 pushl $0x0202 # Reset kernel eflags 305 popfl_cfi
330 CFI_ADJUST_CFA_OFFSET 4
331 popfl
332 CFI_ADJUST_CFA_OFFSET -4
333 jmp syscall_exit 306 jmp syscall_exit
334 CFI_ENDPROC 307 CFI_ENDPROC
335END(ret_from_fork) 308END(ret_from_fork)
@@ -409,29 +382,23 @@ sysenter_past_esp:
409 * enough kernel state to call TRACE_IRQS_OFF can be called - but 382 * enough kernel state to call TRACE_IRQS_OFF can be called - but
410 * we immediately enable interrupts at that point anyway. 383 * we immediately enable interrupts at that point anyway.
411 */ 384 */
412 pushl $(__USER_DS) 385 pushl_cfi $(__USER_DS)
413 CFI_ADJUST_CFA_OFFSET 4
414 /*CFI_REL_OFFSET ss, 0*/ 386 /*CFI_REL_OFFSET ss, 0*/
415 pushl %ebp 387 pushl_cfi %ebp
416 CFI_ADJUST_CFA_OFFSET 4
417 CFI_REL_OFFSET esp, 0 388 CFI_REL_OFFSET esp, 0
418 pushfl 389 pushfl_cfi
419 orl $X86_EFLAGS_IF, (%esp) 390 orl $X86_EFLAGS_IF, (%esp)
420 CFI_ADJUST_CFA_OFFSET 4 391 pushl_cfi $(__USER_CS)
421 pushl $(__USER_CS)
422 CFI_ADJUST_CFA_OFFSET 4
423 /*CFI_REL_OFFSET cs, 0*/ 392 /*CFI_REL_OFFSET cs, 0*/
424 /* 393 /*
425 * Push current_thread_info()->sysenter_return to the stack. 394 * Push current_thread_info()->sysenter_return to the stack.
426 * A tiny bit of offset fixup is necessary - 4*4 means the 4 words 395 * A tiny bit of offset fixup is necessary - 4*4 means the 4 words
427 * pushed above; +8 corresponds to copy_thread's esp0 setting. 396 * pushed above; +8 corresponds to copy_thread's esp0 setting.
428 */ 397 */
429 pushl (TI_sysenter_return-THREAD_SIZE+8+4*4)(%esp) 398 pushl_cfi (TI_sysenter_return-THREAD_SIZE+8+4*4)(%esp)
430 CFI_ADJUST_CFA_OFFSET 4
431 CFI_REL_OFFSET eip, 0 399 CFI_REL_OFFSET eip, 0
432 400
433 pushl %eax 401 pushl_cfi %eax
434 CFI_ADJUST_CFA_OFFSET 4
435 SAVE_ALL 402 SAVE_ALL
436 ENABLE_INTERRUPTS(CLBR_NONE) 403 ENABLE_INTERRUPTS(CLBR_NONE)
437 404
@@ -486,8 +453,7 @@ sysenter_audit:
486 movl %eax,%edx /* 2nd arg: syscall number */ 453 movl %eax,%edx /* 2nd arg: syscall number */
487 movl $AUDIT_ARCH_I386,%eax /* 1st arg: audit arch */ 454 movl $AUDIT_ARCH_I386,%eax /* 1st arg: audit arch */
488 call audit_syscall_entry 455 call audit_syscall_entry
489 pushl %ebx 456 pushl_cfi %ebx
490 CFI_ADJUST_CFA_OFFSET 4
491 movl PT_EAX(%esp),%eax /* reload syscall number */ 457 movl PT_EAX(%esp),%eax /* reload syscall number */
492 jmp sysenter_do_call 458 jmp sysenter_do_call
493 459
@@ -529,8 +495,7 @@ ENDPROC(ia32_sysenter_target)
529 # system call handler stub 495 # system call handler stub
530ENTRY(system_call) 496ENTRY(system_call)
531 RING0_INT_FRAME # can't unwind into user space anyway 497 RING0_INT_FRAME # can't unwind into user space anyway
532 pushl %eax # save orig_eax 498 pushl_cfi %eax # save orig_eax
533 CFI_ADJUST_CFA_OFFSET 4
534 SAVE_ALL 499 SAVE_ALL
535 GET_THREAD_INFO(%ebp) 500 GET_THREAD_INFO(%ebp)
536 # system call tracing in operation / emulation 501 # system call tracing in operation / emulation
@@ -566,7 +531,6 @@ restore_all_notrace:
566 je ldt_ss # returning to user-space with LDT SS 531 je ldt_ss # returning to user-space with LDT SS
567restore_nocheck: 532restore_nocheck:
568 RESTORE_REGS 4 # skip orig_eax/error_code 533 RESTORE_REGS 4 # skip orig_eax/error_code
569 CFI_ADJUST_CFA_OFFSET -4
570irq_return: 534irq_return:
571 INTERRUPT_RETURN 535 INTERRUPT_RETURN
572.section .fixup,"ax" 536.section .fixup,"ax"
@@ -619,10 +583,8 @@ ldt_ss:
619 shr $16, %edx 583 shr $16, %edx
620 mov %dl, GDT_ESPFIX_SS + 4 /* bits 16..23 */ 584 mov %dl, GDT_ESPFIX_SS + 4 /* bits 16..23 */
621 mov %dh, GDT_ESPFIX_SS + 7 /* bits 24..31 */ 585 mov %dh, GDT_ESPFIX_SS + 7 /* bits 24..31 */
622 pushl $__ESPFIX_SS 586 pushl_cfi $__ESPFIX_SS
623 CFI_ADJUST_CFA_OFFSET 4 587 pushl_cfi %eax /* new kernel esp */
624 push %eax /* new kernel esp */
625 CFI_ADJUST_CFA_OFFSET 4
626 /* Disable interrupts, but do not irqtrace this section: we 588 /* Disable interrupts, but do not irqtrace this section: we
627 * will soon execute iret and the tracer was already set to 589 * will soon execute iret and the tracer was already set to
628 * the irqstate after the iret */ 590 * the irqstate after the iret */
@@ -666,11 +628,9 @@ work_notifysig: # deal with pending signals and
666 628
667 ALIGN 629 ALIGN
668work_notifysig_v86: 630work_notifysig_v86:
669 pushl %ecx # save ti_flags for do_notify_resume 631 pushl_cfi %ecx # save ti_flags for do_notify_resume
670 CFI_ADJUST_CFA_OFFSET 4
671 call save_v86_state # %eax contains pt_regs pointer 632 call save_v86_state # %eax contains pt_regs pointer
672 popl %ecx 633 popl_cfi %ecx
673 CFI_ADJUST_CFA_OFFSET -4
674 movl %eax, %esp 634 movl %eax, %esp
675#else 635#else
676 movl %esp, %eax 636 movl %esp, %eax
@@ -803,10 +763,8 @@ ENDPROC(ptregs_clone)
803 mov GDT_ESPFIX_SS + 7, %ah /* bits 24..31 */ 763 mov GDT_ESPFIX_SS + 7, %ah /* bits 24..31 */
804 shl $16, %eax 764 shl $16, %eax
805 addl %esp, %eax /* the adjusted stack pointer */ 765 addl %esp, %eax /* the adjusted stack pointer */
806 pushl $__KERNEL_DS 766 pushl_cfi $__KERNEL_DS
807 CFI_ADJUST_CFA_OFFSET 4 767 pushl_cfi %eax
808 pushl %eax
809 CFI_ADJUST_CFA_OFFSET 4
810 lss (%esp), %esp /* switch to the normal stack segment */ 768 lss (%esp), %esp /* switch to the normal stack segment */
811 CFI_ADJUST_CFA_OFFSET -8 769 CFI_ADJUST_CFA_OFFSET -8
812.endm 770.endm
@@ -843,8 +801,7 @@ vector=FIRST_EXTERNAL_VECTOR
843 .if vector <> FIRST_EXTERNAL_VECTOR 801 .if vector <> FIRST_EXTERNAL_VECTOR
844 CFI_ADJUST_CFA_OFFSET -4 802 CFI_ADJUST_CFA_OFFSET -4
845 .endif 803 .endif
8461: pushl $(~vector+0x80) /* Note: always in signed byte range */ 8041: pushl_cfi $(~vector+0x80) /* Note: always in signed byte range */
847 CFI_ADJUST_CFA_OFFSET 4
848 .if ((vector-FIRST_EXTERNAL_VECTOR)%7) <> 6 805 .if ((vector-FIRST_EXTERNAL_VECTOR)%7) <> 6
849 jmp 2f 806 jmp 2f
850 .endif 807 .endif
@@ -884,8 +841,7 @@ ENDPROC(common_interrupt)
884#define BUILD_INTERRUPT3(name, nr, fn) \ 841#define BUILD_INTERRUPT3(name, nr, fn) \
885ENTRY(name) \ 842ENTRY(name) \
886 RING0_INT_FRAME; \ 843 RING0_INT_FRAME; \
887 pushl $~(nr); \ 844 pushl_cfi $~(nr); \
888 CFI_ADJUST_CFA_OFFSET 4; \
889 SAVE_ALL; \ 845 SAVE_ALL; \
890 TRACE_IRQS_OFF \ 846 TRACE_IRQS_OFF \
891 movl %esp,%eax; \ 847 movl %esp,%eax; \
@@ -901,21 +857,18 @@ ENDPROC(name)
901 857
902ENTRY(coprocessor_error) 858ENTRY(coprocessor_error)
903 RING0_INT_FRAME 859 RING0_INT_FRAME
904 pushl $0 860 pushl_cfi $0
905 CFI_ADJUST_CFA_OFFSET 4 861 pushl_cfi $do_coprocessor_error
906 pushl $do_coprocessor_error
907 CFI_ADJUST_CFA_OFFSET 4
908 jmp error_code 862 jmp error_code
909 CFI_ENDPROC 863 CFI_ENDPROC
910END(coprocessor_error) 864END(coprocessor_error)
911 865
912ENTRY(simd_coprocessor_error) 866ENTRY(simd_coprocessor_error)
913 RING0_INT_FRAME 867 RING0_INT_FRAME
914 pushl $0 868 pushl_cfi $0
915 CFI_ADJUST_CFA_OFFSET 4
916#ifdef CONFIG_X86_INVD_BUG 869#ifdef CONFIG_X86_INVD_BUG
917 /* AMD 486 bug: invd from userspace calls exception 19 instead of #GP */ 870 /* AMD 486 bug: invd from userspace calls exception 19 instead of #GP */
918661: pushl $do_general_protection 871661: pushl_cfi $do_general_protection
919662: 872662:
920.section .altinstructions,"a" 873.section .altinstructions,"a"
921 .balign 4 874 .balign 4
@@ -930,19 +883,16 @@ ENTRY(simd_coprocessor_error)
930664: 883664:
931.previous 884.previous
932#else 885#else
933 pushl $do_simd_coprocessor_error 886 pushl_cfi $do_simd_coprocessor_error
934#endif 887#endif
935 CFI_ADJUST_CFA_OFFSET 4
936 jmp error_code 888 jmp error_code
937 CFI_ENDPROC 889 CFI_ENDPROC
938END(simd_coprocessor_error) 890END(simd_coprocessor_error)
939 891
940ENTRY(device_not_available) 892ENTRY(device_not_available)
941 RING0_INT_FRAME 893 RING0_INT_FRAME
942 pushl $-1 # mark this as an int 894 pushl_cfi $-1 # mark this as an int
943 CFI_ADJUST_CFA_OFFSET 4 895 pushl_cfi $do_device_not_available
944 pushl $do_device_not_available
945 CFI_ADJUST_CFA_OFFSET 4
946 jmp error_code 896 jmp error_code
947 CFI_ENDPROC 897 CFI_ENDPROC
948END(device_not_available) 898END(device_not_available)
@@ -964,82 +914,68 @@ END(native_irq_enable_sysexit)
964 914
965ENTRY(overflow) 915ENTRY(overflow)
966 RING0_INT_FRAME 916 RING0_INT_FRAME
967 pushl $0 917 pushl_cfi $0
968 CFI_ADJUST_CFA_OFFSET 4 918 pushl_cfi $do_overflow
969 pushl $do_overflow
970 CFI_ADJUST_CFA_OFFSET 4
971 jmp error_code 919 jmp error_code
972 CFI_ENDPROC 920 CFI_ENDPROC
973END(overflow) 921END(overflow)
974 922
975ENTRY(bounds) 923ENTRY(bounds)
976 RING0_INT_FRAME 924 RING0_INT_FRAME
977 pushl $0 925 pushl_cfi $0
978 CFI_ADJUST_CFA_OFFSET 4 926 pushl_cfi $do_bounds
979 pushl $do_bounds
980 CFI_ADJUST_CFA_OFFSET 4
981 jmp error_code 927 jmp error_code
982 CFI_ENDPROC 928 CFI_ENDPROC
983END(bounds) 929END(bounds)
984 930
985ENTRY(invalid_op) 931ENTRY(invalid_op)
986 RING0_INT_FRAME 932 RING0_INT_FRAME
987 pushl $0 933 pushl_cfi $0
988 CFI_ADJUST_CFA_OFFSET 4 934 pushl_cfi $do_invalid_op
989 pushl $do_invalid_op
990 CFI_ADJUST_CFA_OFFSET 4
991 jmp error_code 935 jmp error_code
992 CFI_ENDPROC 936 CFI_ENDPROC
993END(invalid_op) 937END(invalid_op)
994 938
995ENTRY(coprocessor_segment_overrun) 939ENTRY(coprocessor_segment_overrun)
996 RING0_INT_FRAME 940 RING0_INT_FRAME
997 pushl $0 941 pushl_cfi $0
998 CFI_ADJUST_CFA_OFFSET 4 942 pushl_cfi $do_coprocessor_segment_overrun
999 pushl $do_coprocessor_segment_overrun
1000 CFI_ADJUST_CFA_OFFSET 4
1001 jmp error_code 943 jmp error_code
1002 CFI_ENDPROC 944 CFI_ENDPROC
1003END(coprocessor_segment_overrun) 945END(coprocessor_segment_overrun)
1004 946
1005ENTRY(invalid_TSS) 947ENTRY(invalid_TSS)
1006 RING0_EC_FRAME 948 RING0_EC_FRAME
1007 pushl $do_invalid_TSS 949 pushl_cfi $do_invalid_TSS
1008 CFI_ADJUST_CFA_OFFSET 4
1009 jmp error_code 950 jmp error_code
1010 CFI_ENDPROC 951 CFI_ENDPROC
1011END(invalid_TSS) 952END(invalid_TSS)
1012 953
1013ENTRY(segment_not_present) 954ENTRY(segment_not_present)
1014 RING0_EC_FRAME 955 RING0_EC_FRAME
1015 pushl $do_segment_not_present 956 pushl_cfi $do_segment_not_present
1016 CFI_ADJUST_CFA_OFFSET 4
1017 jmp error_code 957 jmp error_code
1018 CFI_ENDPROC 958 CFI_ENDPROC
1019END(segment_not_present) 959END(segment_not_present)
1020 960
1021ENTRY(stack_segment) 961ENTRY(stack_segment)
1022 RING0_EC_FRAME 962 RING0_EC_FRAME
1023 pushl $do_stack_segment 963 pushl_cfi $do_stack_segment
1024 CFI_ADJUST_CFA_OFFSET 4
1025 jmp error_code 964 jmp error_code
1026 CFI_ENDPROC 965 CFI_ENDPROC
1027END(stack_segment) 966END(stack_segment)
1028 967
1029ENTRY(alignment_check) 968ENTRY(alignment_check)
1030 RING0_EC_FRAME 969 RING0_EC_FRAME
1031 pushl $do_alignment_check 970 pushl_cfi $do_alignment_check
1032 CFI_ADJUST_CFA_OFFSET 4
1033 jmp error_code 971 jmp error_code
1034 CFI_ENDPROC 972 CFI_ENDPROC
1035END(alignment_check) 973END(alignment_check)
1036 974
1037ENTRY(divide_error) 975ENTRY(divide_error)
1038 RING0_INT_FRAME 976 RING0_INT_FRAME
1039 pushl $0 # no error code 977 pushl_cfi $0 # no error code
1040 CFI_ADJUST_CFA_OFFSET 4 978 pushl_cfi $do_divide_error
1041 pushl $do_divide_error
1042 CFI_ADJUST_CFA_OFFSET 4
1043 jmp error_code 979 jmp error_code
1044 CFI_ENDPROC 980 CFI_ENDPROC
1045END(divide_error) 981END(divide_error)
@@ -1047,10 +983,8 @@ END(divide_error)
1047#ifdef CONFIG_X86_MCE 983#ifdef CONFIG_X86_MCE
1048ENTRY(machine_check) 984ENTRY(machine_check)
1049 RING0_INT_FRAME 985 RING0_INT_FRAME
1050 pushl $0 986 pushl_cfi $0
1051 CFI_ADJUST_CFA_OFFSET 4 987 pushl_cfi machine_check_vector
1052 pushl machine_check_vector
1053 CFI_ADJUST_CFA_OFFSET 4
1054 jmp error_code 988 jmp error_code
1055 CFI_ENDPROC 989 CFI_ENDPROC
1056END(machine_check) 990END(machine_check)
@@ -1058,10 +992,8 @@ END(machine_check)
1058 992
1059ENTRY(spurious_interrupt_bug) 993ENTRY(spurious_interrupt_bug)
1060 RING0_INT_FRAME 994 RING0_INT_FRAME
1061 pushl $0 995 pushl_cfi $0
1062 CFI_ADJUST_CFA_OFFSET 4 996 pushl_cfi $do_spurious_interrupt_bug
1063 pushl $do_spurious_interrupt_bug
1064 CFI_ADJUST_CFA_OFFSET 4
1065 jmp error_code 997 jmp error_code
1066 CFI_ENDPROC 998 CFI_ENDPROC
1067END(spurious_interrupt_bug) 999END(spurious_interrupt_bug)
@@ -1092,8 +1024,7 @@ ENTRY(xen_sysenter_target)
1092 1024
1093ENTRY(xen_hypervisor_callback) 1025ENTRY(xen_hypervisor_callback)
1094 CFI_STARTPROC 1026 CFI_STARTPROC
1095 pushl $0 1027 pushl_cfi $0
1096 CFI_ADJUST_CFA_OFFSET 4
1097 SAVE_ALL 1028 SAVE_ALL
1098 TRACE_IRQS_OFF 1029 TRACE_IRQS_OFF
1099 1030
@@ -1129,23 +1060,20 @@ ENDPROC(xen_hypervisor_callback)
1129# We distinguish between categories by maintaining a status value in EAX. 1060# We distinguish between categories by maintaining a status value in EAX.
1130ENTRY(xen_failsafe_callback) 1061ENTRY(xen_failsafe_callback)
1131 CFI_STARTPROC 1062 CFI_STARTPROC
1132 pushl %eax 1063 pushl_cfi %eax
1133 CFI_ADJUST_CFA_OFFSET 4
1134 movl $1,%eax 1064 movl $1,%eax
11351: mov 4(%esp),%ds 10651: mov 4(%esp),%ds
11362: mov 8(%esp),%es 10662: mov 8(%esp),%es
11373: mov 12(%esp),%fs 10673: mov 12(%esp),%fs
11384: mov 16(%esp),%gs 10684: mov 16(%esp),%gs
1139 testl %eax,%eax 1069 testl %eax,%eax
1140 popl %eax 1070 popl_cfi %eax
1141 CFI_ADJUST_CFA_OFFSET -4
1142 lea 16(%esp),%esp 1071 lea 16(%esp),%esp
1143 CFI_ADJUST_CFA_OFFSET -16 1072 CFI_ADJUST_CFA_OFFSET -16
1144 jz 5f 1073 jz 5f
1145 addl $16,%esp 1074 addl $16,%esp
1146 jmp iret_exc # EAX != 0 => Category 2 (Bad IRET) 1075 jmp iret_exc # EAX != 0 => Category 2 (Bad IRET)
11475: pushl $0 # EAX == 0 => Category 1 (Bad segment) 10765: pushl_cfi $0 # EAX == 0 => Category 1 (Bad segment)
1148 CFI_ADJUST_CFA_OFFSET 4
1149 SAVE_ALL 1077 SAVE_ALL
1150 jmp ret_from_exception 1078 jmp ret_from_exception
1151 CFI_ENDPROC 1079 CFI_ENDPROC
@@ -1295,40 +1223,29 @@ syscall_table_size=(.-sys_call_table)
1295 1223
1296ENTRY(page_fault) 1224ENTRY(page_fault)
1297 RING0_EC_FRAME 1225 RING0_EC_FRAME
1298 pushl $do_page_fault 1226 pushl_cfi $do_page_fault
1299 CFI_ADJUST_CFA_OFFSET 4
1300 ALIGN 1227 ALIGN
1301error_code: 1228error_code:
1302 /* the function address is in %gs's slot on the stack */ 1229 /* the function address is in %gs's slot on the stack */
1303 pushl %fs 1230 pushl_cfi %fs
1304 CFI_ADJUST_CFA_OFFSET 4
1305 /*CFI_REL_OFFSET fs, 0*/ 1231 /*CFI_REL_OFFSET fs, 0*/
1306 pushl %es 1232 pushl_cfi %es
1307 CFI_ADJUST_CFA_OFFSET 4
1308 /*CFI_REL_OFFSET es, 0*/ 1233 /*CFI_REL_OFFSET es, 0*/
1309 pushl %ds 1234 pushl_cfi %ds
1310 CFI_ADJUST_CFA_OFFSET 4
1311 /*CFI_REL_OFFSET ds, 0*/ 1235 /*CFI_REL_OFFSET ds, 0*/
1312 pushl %eax 1236 pushl_cfi %eax
1313 CFI_ADJUST_CFA_OFFSET 4
1314 CFI_REL_OFFSET eax, 0 1237 CFI_REL_OFFSET eax, 0
1315 pushl %ebp 1238 pushl_cfi %ebp
1316 CFI_ADJUST_CFA_OFFSET 4
1317 CFI_REL_OFFSET ebp, 0 1239 CFI_REL_OFFSET ebp, 0
1318 pushl %edi 1240 pushl_cfi %edi
1319 CFI_ADJUST_CFA_OFFSET 4
1320 CFI_REL_OFFSET edi, 0 1241 CFI_REL_OFFSET edi, 0
1321 pushl %esi 1242 pushl_cfi %esi
1322 CFI_ADJUST_CFA_OFFSET 4
1323 CFI_REL_OFFSET esi, 0 1243 CFI_REL_OFFSET esi, 0
1324 pushl %edx 1244 pushl_cfi %edx
1325 CFI_ADJUST_CFA_OFFSET 4
1326 CFI_REL_OFFSET edx, 0 1245 CFI_REL_OFFSET edx, 0
1327 pushl %ecx 1246 pushl_cfi %ecx
1328 CFI_ADJUST_CFA_OFFSET 4
1329 CFI_REL_OFFSET ecx, 0 1247 CFI_REL_OFFSET ecx, 0
1330 pushl %ebx 1248 pushl_cfi %ebx
1331 CFI_ADJUST_CFA_OFFSET 4
1332 CFI_REL_OFFSET ebx, 0 1249 CFI_REL_OFFSET ebx, 0
1333 cld 1250 cld
1334 movl $(__KERNEL_PERCPU), %ecx 1251 movl $(__KERNEL_PERCPU), %ecx
@@ -1370,12 +1287,9 @@ END(page_fault)
1370 movl TSS_sysenter_sp0 + \offset(%esp), %esp 1287 movl TSS_sysenter_sp0 + \offset(%esp), %esp
1371 CFI_DEF_CFA esp, 0 1288 CFI_DEF_CFA esp, 0
1372 CFI_UNDEFINED eip 1289 CFI_UNDEFINED eip
1373 pushfl 1290 pushfl_cfi
1374 CFI_ADJUST_CFA_OFFSET 4 1291 pushl_cfi $__KERNEL_CS
1375 pushl $__KERNEL_CS 1292 pushl_cfi $sysenter_past_esp
1376 CFI_ADJUST_CFA_OFFSET 4
1377 pushl $sysenter_past_esp
1378 CFI_ADJUST_CFA_OFFSET 4
1379 CFI_REL_OFFSET eip, 0 1293 CFI_REL_OFFSET eip, 0
1380.endm 1294.endm
1381 1295
@@ -1385,8 +1299,7 @@ ENTRY(debug)
1385 jne debug_stack_correct 1299 jne debug_stack_correct
1386 FIX_STACK 12, debug_stack_correct, debug_esp_fix_insn 1300 FIX_STACK 12, debug_stack_correct, debug_esp_fix_insn
1387debug_stack_correct: 1301debug_stack_correct:
1388 pushl $-1 # mark this as an int 1302 pushl_cfi $-1 # mark this as an int
1389 CFI_ADJUST_CFA_OFFSET 4
1390 SAVE_ALL 1303 SAVE_ALL
1391 TRACE_IRQS_OFF 1304 TRACE_IRQS_OFF
1392 xorl %edx,%edx # error code 0 1305 xorl %edx,%edx # error code 0
@@ -1406,32 +1319,27 @@ END(debug)
1406 */ 1319 */
1407ENTRY(nmi) 1320ENTRY(nmi)
1408 RING0_INT_FRAME 1321 RING0_INT_FRAME
1409 pushl %eax 1322 pushl_cfi %eax
1410 CFI_ADJUST_CFA_OFFSET 4
1411 movl %ss, %eax 1323 movl %ss, %eax
1412 cmpw $__ESPFIX_SS, %ax 1324 cmpw $__ESPFIX_SS, %ax
1413 popl %eax 1325 popl_cfi %eax
1414 CFI_ADJUST_CFA_OFFSET -4
1415 je nmi_espfix_stack 1326 je nmi_espfix_stack
1416 cmpl $ia32_sysenter_target,(%esp) 1327 cmpl $ia32_sysenter_target,(%esp)
1417 je nmi_stack_fixup 1328 je nmi_stack_fixup
1418 pushl %eax 1329 pushl_cfi %eax
1419 CFI_ADJUST_CFA_OFFSET 4
1420 movl %esp,%eax 1330 movl %esp,%eax
1421 /* Do not access memory above the end of our stack page, 1331 /* Do not access memory above the end of our stack page,
1422 * it might not exist. 1332 * it might not exist.
1423 */ 1333 */
1424 andl $(THREAD_SIZE-1),%eax 1334 andl $(THREAD_SIZE-1),%eax
1425 cmpl $(THREAD_SIZE-20),%eax 1335 cmpl $(THREAD_SIZE-20),%eax
1426 popl %eax 1336 popl_cfi %eax
1427 CFI_ADJUST_CFA_OFFSET -4
1428 jae nmi_stack_correct 1337 jae nmi_stack_correct
1429 cmpl $ia32_sysenter_target,12(%esp) 1338 cmpl $ia32_sysenter_target,12(%esp)
1430 je nmi_debug_stack_check 1339 je nmi_debug_stack_check
1431nmi_stack_correct: 1340nmi_stack_correct:
1432 /* We have a RING0_INT_FRAME here */ 1341 /* We have a RING0_INT_FRAME here */
1433 pushl %eax 1342 pushl_cfi %eax
1434 CFI_ADJUST_CFA_OFFSET 4
1435 SAVE_ALL 1343 SAVE_ALL
1436 xorl %edx,%edx # zero error code 1344 xorl %edx,%edx # zero error code
1437 movl %esp,%eax # pt_regs pointer 1345 movl %esp,%eax # pt_regs pointer
@@ -1460,18 +1368,14 @@ nmi_espfix_stack:
1460 * 1368 *
1461 * create the pointer to lss back 1369 * create the pointer to lss back
1462 */ 1370 */
1463 pushl %ss 1371 pushl_cfi %ss
1464 CFI_ADJUST_CFA_OFFSET 4 1372 pushl_cfi %esp
1465 pushl %esp
1466 CFI_ADJUST_CFA_OFFSET 4
1467 addl $4, (%esp) 1373 addl $4, (%esp)
1468 /* copy the iret frame of 12 bytes */ 1374 /* copy the iret frame of 12 bytes */
1469 .rept 3 1375 .rept 3
1470 pushl 16(%esp) 1376 pushl_cfi 16(%esp)
1471 CFI_ADJUST_CFA_OFFSET 4
1472 .endr 1377 .endr
1473 pushl %eax 1378 pushl_cfi %eax
1474 CFI_ADJUST_CFA_OFFSET 4
1475 SAVE_ALL 1379 SAVE_ALL
1476 FIXUP_ESPFIX_STACK # %eax == %esp 1380 FIXUP_ESPFIX_STACK # %eax == %esp
1477 xorl %edx,%edx # zero error code 1381 xorl %edx,%edx # zero error code
@@ -1485,8 +1389,7 @@ END(nmi)
1485 1389
1486ENTRY(int3) 1390ENTRY(int3)
1487 RING0_INT_FRAME 1391 RING0_INT_FRAME
1488 pushl $-1 # mark this as an int 1392 pushl_cfi $-1 # mark this as an int
1489 CFI_ADJUST_CFA_OFFSET 4
1490 SAVE_ALL 1393 SAVE_ALL
1491 TRACE_IRQS_OFF 1394 TRACE_IRQS_OFF
1492 xorl %edx,%edx # zero error code 1395 xorl %edx,%edx # zero error code
@@ -1498,8 +1401,7 @@ END(int3)
1498 1401
1499ENTRY(general_protection) 1402ENTRY(general_protection)
1500 RING0_EC_FRAME 1403 RING0_EC_FRAME
1501 pushl $do_general_protection 1404 pushl_cfi $do_general_protection
1502 CFI_ADJUST_CFA_OFFSET 4
1503 jmp error_code 1405 jmp error_code
1504 CFI_ENDPROC 1406 CFI_ENDPROC
1505END(general_protection) 1407END(general_protection)