aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2006-06-26 07:56:55 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-26 13:48:16 -0400
commit4b787e0b831c71c6b09902b66575dadb2260a7c8 (patch)
tree73ad905b40a5a07c0ccce8d75544bd7f320dc7c0
parentbebfa1013eee1d91b3242e5801cc8fbdfaf148ec (diff)
[PATCH] x86_64: add END()/ENDPROC() annotations to entry.S
Since END()/ENDPROC() are now available, add respective annotations to x86_64's entry.S. This should help debugging activities. Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--arch/x86_64/ia32/ia32entry.S4
-rw-r--r--arch/x86_64/kernel/entry.S45
2 files changed, 48 insertions, 1 deletions
diff --git a/arch/x86_64/ia32/ia32entry.S b/arch/x86_64/ia32/ia32entry.S
index 4ec594ab1a98..8b502eb0a28b 100644
--- a/arch/x86_64/ia32/ia32entry.S
+++ b/arch/x86_64/ia32/ia32entry.S
@@ -155,6 +155,7 @@ sysenter_tracesys:
155 .previous 155 .previous
156 jmp sysenter_do_call 156 jmp sysenter_do_call
157 CFI_ENDPROC 157 CFI_ENDPROC
158ENDPROC(ia32_sysenter_target)
158 159
159/* 160/*
160 * 32bit SYSCALL instruction entry. 161 * 32bit SYSCALL instruction entry.
@@ -249,6 +250,7 @@ cstar_tracesys:
249 .quad 1b,ia32_badarg 250 .quad 1b,ia32_badarg
250 .previous 251 .previous
251 jmp cstar_do_call 252 jmp cstar_do_call
253END(ia32_cstar_target)
252 254
253ia32_badarg: 255ia32_badarg:
254 movq $-EFAULT,%rax 256 movq $-EFAULT,%rax
@@ -314,6 +316,7 @@ ia32_tracesys:
314 LOAD_ARGS ARGOFFSET /* reload args from stack in case ptrace changed it */ 316 LOAD_ARGS ARGOFFSET /* reload args from stack in case ptrace changed it */
315 RESTORE_REST 317 RESTORE_REST
316 jmp ia32_do_syscall 318 jmp ia32_do_syscall
319END(ia32_syscall)
317 320
318ia32_badsys: 321ia32_badsys:
319 movq $0,ORIG_RAX-ARGOFFSET(%rsp) 322 movq $0,ORIG_RAX-ARGOFFSET(%rsp)
@@ -370,6 +373,7 @@ ENTRY(ia32_ptregs_common)
370 RESTORE_REST 373 RESTORE_REST
371 jmp ia32_sysret /* misbalances the return cache */ 374 jmp ia32_sysret /* misbalances the return cache */
372 CFI_ENDPROC 375 CFI_ENDPROC
376END(ia32_ptregs_common)
373 377
374 .section .rodata,"a" 378 .section .rodata,"a"
375 .align 8 379 .align 8
diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S
index 586b34c00c48..9999d703b6c4 100644
--- a/arch/x86_64/kernel/entry.S
+++ b/arch/x86_64/kernel/entry.S
@@ -154,6 +154,7 @@ rff_trace:
154 GET_THREAD_INFO(%rcx) 154 GET_THREAD_INFO(%rcx)
155 jmp rff_action 155 jmp rff_action
156 CFI_ENDPROC 156 CFI_ENDPROC
157END(ret_from_fork)
157 158
158/* 159/*
159 * System call entry. Upto 6 arguments in registers are supported. 160 * System call entry. Upto 6 arguments in registers are supported.
@@ -285,6 +286,7 @@ tracesys:
285 /* Use IRET because user could have changed frame */ 286 /* Use IRET because user could have changed frame */
286 jmp int_ret_from_sys_call 287 jmp int_ret_from_sys_call
287 CFI_ENDPROC 288 CFI_ENDPROC
289END(system_call)
288 290
289/* 291/*
290 * Syscall return path ending with IRET. 292 * Syscall return path ending with IRET.
@@ -364,6 +366,7 @@ int_restore_rest:
364 cli 366 cli
365 jmp int_with_check 367 jmp int_with_check
366 CFI_ENDPROC 368 CFI_ENDPROC
369END(int_ret_from_sys_call)
367 370
368/* 371/*
369 * Certain special system calls that need to save a complete full stack frame. 372 * Certain special system calls that need to save a complete full stack frame.
@@ -375,6 +378,7 @@ int_restore_rest:
375 leaq \func(%rip),%rax 378 leaq \func(%rip),%rax
376 leaq -ARGOFFSET+8(%rsp),\arg /* 8 for return address */ 379 leaq -ARGOFFSET+8(%rsp),\arg /* 8 for return address */
377 jmp ptregscall_common 380 jmp ptregscall_common
381END(\label)
378 .endm 382 .endm
379 383
380 CFI_STARTPROC 384 CFI_STARTPROC
@@ -404,6 +408,7 @@ ENTRY(ptregscall_common)
404 CFI_REL_OFFSET rip, 0 408 CFI_REL_OFFSET rip, 0
405 ret 409 ret
406 CFI_ENDPROC 410 CFI_ENDPROC
411END(ptregscall_common)
407 412
408ENTRY(stub_execve) 413ENTRY(stub_execve)
409 CFI_STARTPROC 414 CFI_STARTPROC
@@ -418,6 +423,7 @@ ENTRY(stub_execve)
418 RESTORE_REST 423 RESTORE_REST
419 jmp int_ret_from_sys_call 424 jmp int_ret_from_sys_call
420 CFI_ENDPROC 425 CFI_ENDPROC
426END(stub_execve)
421 427
422/* 428/*
423 * sigreturn is special because it needs to restore all registers on return. 429 * sigreturn is special because it needs to restore all registers on return.
@@ -435,6 +441,7 @@ ENTRY(stub_rt_sigreturn)
435 RESTORE_REST 441 RESTORE_REST
436 jmp int_ret_from_sys_call 442 jmp int_ret_from_sys_call
437 CFI_ENDPROC 443 CFI_ENDPROC
444END(stub_rt_sigreturn)
438 445
439/* 446/*
440 * initial frame state for interrupts and exceptions 447 * initial frame state for interrupts and exceptions
@@ -589,7 +596,9 @@ retint_kernel:
589 call preempt_schedule_irq 596 call preempt_schedule_irq
590 jmp exit_intr 597 jmp exit_intr
591#endif 598#endif
599
592 CFI_ENDPROC 600 CFI_ENDPROC
601END(common_interrupt)
593 602
594/* 603/*
595 * APIC interrupts. 604 * APIC interrupts.
@@ -605,17 +614,21 @@ retint_kernel:
605 614
606ENTRY(thermal_interrupt) 615ENTRY(thermal_interrupt)
607 apicinterrupt THERMAL_APIC_VECTOR,smp_thermal_interrupt 616 apicinterrupt THERMAL_APIC_VECTOR,smp_thermal_interrupt
617END(thermal_interrupt)
608 618
609ENTRY(threshold_interrupt) 619ENTRY(threshold_interrupt)
610 apicinterrupt THRESHOLD_APIC_VECTOR,mce_threshold_interrupt 620 apicinterrupt THRESHOLD_APIC_VECTOR,mce_threshold_interrupt
621END(threshold_interrupt)
611 622
612#ifdef CONFIG_SMP 623#ifdef CONFIG_SMP
613ENTRY(reschedule_interrupt) 624ENTRY(reschedule_interrupt)
614 apicinterrupt RESCHEDULE_VECTOR,smp_reschedule_interrupt 625 apicinterrupt RESCHEDULE_VECTOR,smp_reschedule_interrupt
626END(reschedule_interrupt)
615 627
616 .macro INVALIDATE_ENTRY num 628 .macro INVALIDATE_ENTRY num
617ENTRY(invalidate_interrupt\num) 629ENTRY(invalidate_interrupt\num)
618 apicinterrupt INVALIDATE_TLB_VECTOR_START+\num,smp_invalidate_interrupt 630 apicinterrupt INVALIDATE_TLB_VECTOR_START+\num,smp_invalidate_interrupt
631END(invalidate_interrupt\num)
619 .endm 632 .endm
620 633
621 INVALIDATE_ENTRY 0 634 INVALIDATE_ENTRY 0
@@ -629,17 +642,21 @@ ENTRY(invalidate_interrupt\num)
629 642
630ENTRY(call_function_interrupt) 643ENTRY(call_function_interrupt)
631 apicinterrupt CALL_FUNCTION_VECTOR,smp_call_function_interrupt 644 apicinterrupt CALL_FUNCTION_VECTOR,smp_call_function_interrupt
645END(call_function_interrupt)
632#endif 646#endif
633 647
634#ifdef CONFIG_X86_LOCAL_APIC 648#ifdef CONFIG_X86_LOCAL_APIC
635ENTRY(apic_timer_interrupt) 649ENTRY(apic_timer_interrupt)
636 apicinterrupt LOCAL_TIMER_VECTOR,smp_apic_timer_interrupt 650 apicinterrupt LOCAL_TIMER_VECTOR,smp_apic_timer_interrupt
651END(apic_timer_interrupt)
637 652
638ENTRY(error_interrupt) 653ENTRY(error_interrupt)
639 apicinterrupt ERROR_APIC_VECTOR,smp_error_interrupt 654 apicinterrupt ERROR_APIC_VECTOR,smp_error_interrupt
655END(error_interrupt)
640 656
641ENTRY(spurious_interrupt) 657ENTRY(spurious_interrupt)
642 apicinterrupt SPURIOUS_APIC_VECTOR,smp_spurious_interrupt 658 apicinterrupt SPURIOUS_APIC_VECTOR,smp_spurious_interrupt
659END(spurious_interrupt)
643#endif 660#endif
644 661
645/* 662/*
@@ -777,6 +794,7 @@ error_kernelspace:
777 cmpq $gs_change,RIP(%rsp) 794 cmpq $gs_change,RIP(%rsp)
778 je error_swapgs 795 je error_swapgs
779 jmp error_sti 796 jmp error_sti
797END(error_entry)
780 798
781 /* Reload gs selector with exception handling */ 799 /* Reload gs selector with exception handling */
782 /* edi: new selector */ 800 /* edi: new selector */
@@ -794,6 +812,7 @@ gs_change:
794 CFI_ADJUST_CFA_OFFSET -8 812 CFI_ADJUST_CFA_OFFSET -8
795 ret 813 ret
796 CFI_ENDPROC 814 CFI_ENDPROC
815ENDPROC(load_gs_index)
797 816
798 .section __ex_table,"a" 817 .section __ex_table,"a"
799 .align 8 818 .align 8
@@ -847,7 +866,7 @@ ENTRY(kernel_thread)
847 UNFAKE_STACK_FRAME 866 UNFAKE_STACK_FRAME
848 ret 867 ret
849 CFI_ENDPROC 868 CFI_ENDPROC
850 869ENDPROC(kernel_thread)
851 870
852child_rip: 871child_rip:
853 /* 872 /*
@@ -860,6 +879,7 @@ child_rip:
860 # exit 879 # exit
861 xorl %edi, %edi 880 xorl %edi, %edi
862 call do_exit 881 call do_exit
882ENDPROC(child_rip)
863 883
864/* 884/*
865 * execve(). This function needs to use IRET, not SYSRET, to set up all state properly. 885 * execve(). This function needs to use IRET, not SYSRET, to set up all state properly.
@@ -889,19 +909,24 @@ ENTRY(execve)
889 UNFAKE_STACK_FRAME 909 UNFAKE_STACK_FRAME
890 ret 910 ret
891 CFI_ENDPROC 911 CFI_ENDPROC
912ENDPROC(execve)
892 913
893KPROBE_ENTRY(page_fault) 914KPROBE_ENTRY(page_fault)
894 errorentry do_page_fault 915 errorentry do_page_fault
916END(page_fault)
895 .previous .text 917 .previous .text
896 918
897ENTRY(coprocessor_error) 919ENTRY(coprocessor_error)
898 zeroentry do_coprocessor_error 920 zeroentry do_coprocessor_error
921END(coprocessor_error)
899 922
900ENTRY(simd_coprocessor_error) 923ENTRY(simd_coprocessor_error)
901 zeroentry do_simd_coprocessor_error 924 zeroentry do_simd_coprocessor_error
925END(simd_coprocessor_error)
902 926
903ENTRY(device_not_available) 927ENTRY(device_not_available)
904 zeroentry math_state_restore 928 zeroentry math_state_restore
929END(device_not_available)
905 930
906 /* runs on exception stack */ 931 /* runs on exception stack */
907KPROBE_ENTRY(debug) 932KPROBE_ENTRY(debug)
@@ -911,6 +936,7 @@ KPROBE_ENTRY(debug)
911 paranoidentry do_debug, DEBUG_STACK 936 paranoidentry do_debug, DEBUG_STACK
912 jmp paranoid_exit 937 jmp paranoid_exit
913 CFI_ENDPROC 938 CFI_ENDPROC
939END(debug)
914 .previous .text 940 .previous .text
915 941
916 /* runs on exception stack */ 942 /* runs on exception stack */
@@ -961,6 +987,7 @@ paranoid_schedule:
961 cli 987 cli
962 jmp paranoid_userspace 988 jmp paranoid_userspace
963 CFI_ENDPROC 989 CFI_ENDPROC
990END(nmi)
964 .previous .text 991 .previous .text
965 992
966KPROBE_ENTRY(int3) 993KPROBE_ENTRY(int3)
@@ -970,22 +997,28 @@ KPROBE_ENTRY(int3)
970 paranoidentry do_int3, DEBUG_STACK 997 paranoidentry do_int3, DEBUG_STACK
971 jmp paranoid_exit 998 jmp paranoid_exit
972 CFI_ENDPROC 999 CFI_ENDPROC
1000END(int3)
973 .previous .text 1001 .previous .text
974 1002
975ENTRY(overflow) 1003ENTRY(overflow)
976 zeroentry do_overflow 1004 zeroentry do_overflow
1005END(overflow)
977 1006
978ENTRY(bounds) 1007ENTRY(bounds)
979 zeroentry do_bounds 1008 zeroentry do_bounds
1009END(bounds)
980 1010
981ENTRY(invalid_op) 1011ENTRY(invalid_op)
982 zeroentry do_invalid_op 1012 zeroentry do_invalid_op
1013END(invalid_op)
983 1014
984ENTRY(coprocessor_segment_overrun) 1015ENTRY(coprocessor_segment_overrun)
985 zeroentry do_coprocessor_segment_overrun 1016 zeroentry do_coprocessor_segment_overrun
1017END(coprocessor_segment_overrun)
986 1018
987ENTRY(reserved) 1019ENTRY(reserved)
988 zeroentry do_reserved 1020 zeroentry do_reserved
1021END(reserved)
989 1022
990 /* runs on exception stack */ 1023 /* runs on exception stack */
991ENTRY(double_fault) 1024ENTRY(double_fault)
@@ -993,12 +1026,15 @@ ENTRY(double_fault)
993 paranoidentry do_double_fault 1026 paranoidentry do_double_fault
994 jmp paranoid_exit 1027 jmp paranoid_exit
995 CFI_ENDPROC 1028 CFI_ENDPROC
1029END(double_fault)
996 1030
997ENTRY(invalid_TSS) 1031ENTRY(invalid_TSS)
998 errorentry do_invalid_TSS 1032 errorentry do_invalid_TSS
1033END(invalid_TSS)
999 1034
1000ENTRY(segment_not_present) 1035ENTRY(segment_not_present)
1001 errorentry do_segment_not_present 1036 errorentry do_segment_not_present
1037END(segment_not_present)
1002 1038
1003 /* runs on exception stack */ 1039 /* runs on exception stack */
1004ENTRY(stack_segment) 1040ENTRY(stack_segment)
@@ -1006,19 +1042,24 @@ ENTRY(stack_segment)
1006 paranoidentry do_stack_segment 1042 paranoidentry do_stack_segment
1007 jmp paranoid_exit 1043 jmp paranoid_exit
1008 CFI_ENDPROC 1044 CFI_ENDPROC
1045END(stack_segment)
1009 1046
1010KPROBE_ENTRY(general_protection) 1047KPROBE_ENTRY(general_protection)
1011 errorentry do_general_protection 1048 errorentry do_general_protection
1049END(general_protection)
1012 .previous .text 1050 .previous .text
1013 1051
1014ENTRY(alignment_check) 1052ENTRY(alignment_check)
1015 errorentry do_alignment_check 1053 errorentry do_alignment_check
1054END(alignment_check)
1016 1055
1017ENTRY(divide_error) 1056ENTRY(divide_error)
1018 zeroentry do_divide_error 1057 zeroentry do_divide_error
1058END(divide_error)
1019 1059
1020ENTRY(spurious_interrupt_bug) 1060ENTRY(spurious_interrupt_bug)
1021 zeroentry do_spurious_interrupt_bug 1061 zeroentry do_spurious_interrupt_bug
1062END(spurious_interrupt_bug)
1022 1063
1023#ifdef CONFIG_X86_MCE 1064#ifdef CONFIG_X86_MCE
1024 /* runs on exception stack */ 1065 /* runs on exception stack */
@@ -1029,6 +1070,7 @@ ENTRY(machine_check)
1029 paranoidentry do_machine_check 1070 paranoidentry do_machine_check
1030 jmp paranoid_exit 1071 jmp paranoid_exit
1031 CFI_ENDPROC 1072 CFI_ENDPROC
1073END(machine_check)
1032#endif 1074#endif
1033 1075
1034ENTRY(call_softirq) 1076ENTRY(call_softirq)
@@ -1046,3 +1088,4 @@ ENTRY(call_softirq)
1046 decl %gs:pda_irqcount 1088 decl %gs:pda_irqcount
1047 ret 1089 ret
1048 CFI_ENDPROC 1090 CFI_ENDPROC
1091ENDPROC(call_softirq)