aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/entry_64.S
diff options
context:
space:
mode:
authorAlexander van Heukelum <heukelum@mailshack.com>2008-11-23 04:08:28 -0500
committerIngo Molnar <mingo@elte.hu>2008-11-23 08:21:54 -0500
commit322648d1ba75280d62f114d47048beb0b35f5047 (patch)
treea4963976f5a699267c8c5c7d9b305e959ed8ce9f /arch/x86/kernel/entry_64.S
parent8a2503fa4a6fae8ee42140b339f37373fc6acaae (diff)
x86: include ENTRY/END in entry handlers in entry_64.S
Impact: cleanup of entry_64.S Except for the order and the place of the functions, this patch should not change the generated code. Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/entry_64.S')
-rw-r--r--arch/x86/kernel/entry_64.S259
1 files changed, 109 insertions, 150 deletions
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 249eb604e71b..1a856c0b21a8 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -922,76 +922,70 @@ END(common_interrupt)
922/* 922/*
923 * APIC interrupts. 923 * APIC interrupts.
924 */ 924 */
925 .p2align 5 925.macro apicinterrupt num sym do_sym
926 926ENTRY(\sym)
927 .macro apicinterrupt num,func
928 INTR_FRAME 927 INTR_FRAME
929 pushq $~(\num) 928 pushq $~(\num)
930 CFI_ADJUST_CFA_OFFSET 8 929 CFI_ADJUST_CFA_OFFSET 8
931 interrupt \func 930 interrupt \do_sym
932 jmp ret_from_intr 931 jmp ret_from_intr
933 CFI_ENDPROC 932 CFI_ENDPROC
934 .endm 933END(\sym)
934.endm
935 935
936ENTRY(thermal_interrupt) 936#ifdef CONFIG_SMP
937 apicinterrupt THERMAL_APIC_VECTOR,smp_thermal_interrupt 937apicinterrupt IRQ_MOVE_CLEANUP_VECTOR \
938END(thermal_interrupt) 938 irq_move_cleanup_interrupt smp_irq_move_cleanup_interrupt
939#endif
939 940
940ENTRY(threshold_interrupt) 941apicinterrupt 220 \
941 apicinterrupt THRESHOLD_APIC_VECTOR,mce_threshold_interrupt 942 uv_bau_message_intr1 uv_bau_message_interrupt
942END(threshold_interrupt) 943apicinterrupt LOCAL_TIMER_VECTOR \
944 apic_timer_interrupt smp_apic_timer_interrupt
943 945
944#ifdef CONFIG_SMP 946#ifdef CONFIG_SMP
945ENTRY(reschedule_interrupt) 947apicinterrupt INVALIDATE_TLB_VECTOR_START+0 \
946 apicinterrupt RESCHEDULE_VECTOR,smp_reschedule_interrupt 948 invalidate_interrupt0 smp_invalidate_interrupt
947END(reschedule_interrupt) 949apicinterrupt INVALIDATE_TLB_VECTOR_START+1 \
948 950 invalidate_interrupt1 smp_invalidate_interrupt
949 .macro INVALIDATE_ENTRY num 951apicinterrupt INVALIDATE_TLB_VECTOR_START+2 \
950ENTRY(invalidate_interrupt\num) 952 invalidate_interrupt2 smp_invalidate_interrupt
951 apicinterrupt INVALIDATE_TLB_VECTOR_START+\num,smp_invalidate_interrupt 953apicinterrupt INVALIDATE_TLB_VECTOR_START+3 \
952END(invalidate_interrupt\num) 954 invalidate_interrupt3 smp_invalidate_interrupt
953 .endm 955apicinterrupt INVALIDATE_TLB_VECTOR_START+4 \
954 956 invalidate_interrupt4 smp_invalidate_interrupt
955 INVALIDATE_ENTRY 0 957apicinterrupt INVALIDATE_TLB_VECTOR_START+5 \
956 INVALIDATE_ENTRY 1 958 invalidate_interrupt5 smp_invalidate_interrupt
957 INVALIDATE_ENTRY 2 959apicinterrupt INVALIDATE_TLB_VECTOR_START+6 \
958 INVALIDATE_ENTRY 3 960 invalidate_interrupt6 smp_invalidate_interrupt
959 INVALIDATE_ENTRY 4 961apicinterrupt INVALIDATE_TLB_VECTOR_START+7 \
960 INVALIDATE_ENTRY 5 962 invalidate_interrupt7 smp_invalidate_interrupt
961 INVALIDATE_ENTRY 6
962 INVALIDATE_ENTRY 7
963
964ENTRY(call_function_interrupt)
965 apicinterrupt CALL_FUNCTION_VECTOR,smp_call_function_interrupt
966END(call_function_interrupt)
967ENTRY(call_function_single_interrupt)
968 apicinterrupt CALL_FUNCTION_SINGLE_VECTOR,smp_call_function_single_interrupt
969END(call_function_single_interrupt)
970ENTRY(irq_move_cleanup_interrupt)
971 apicinterrupt IRQ_MOVE_CLEANUP_VECTOR,smp_irq_move_cleanup_interrupt
972END(irq_move_cleanup_interrupt)
973#endif 963#endif
974 964
975ENTRY(apic_timer_interrupt) 965apicinterrupt THRESHOLD_APIC_VECTOR \
976 apicinterrupt LOCAL_TIMER_VECTOR,smp_apic_timer_interrupt 966 threshold_interrupt mce_threshold_interrupt
977END(apic_timer_interrupt) 967apicinterrupt THERMAL_APIC_VECTOR \
978 968 thermal_interrupt smp_thermal_interrupt
979ENTRY(uv_bau_message_intr1)
980 apicinterrupt 220,uv_bau_message_interrupt
981END(uv_bau_message_intr1)
982 969
983ENTRY(error_interrupt) 970#ifdef CONFIG_SMP
984 apicinterrupt ERROR_APIC_VECTOR,smp_error_interrupt 971apicinterrupt CALL_FUNCTION_SINGLE_VECTOR \
985END(error_interrupt) 972 call_function_single_interrupt smp_call_function_single_interrupt
973apicinterrupt CALL_FUNCTION_VECTOR \
974 call_function_interrupt smp_call_function_interrupt
975apicinterrupt RESCHEDULE_VECTOR \
976 reschedule_interrupt smp_reschedule_interrupt
977#endif
986 978
987ENTRY(spurious_interrupt) 979apicinterrupt ERROR_APIC_VECTOR \
988 apicinterrupt SPURIOUS_APIC_VECTOR,smp_spurious_interrupt 980 error_interrupt smp_error_interrupt
989END(spurious_interrupt) 981apicinterrupt SPURIOUS_APIC_VECTOR \
982 spurious_interrupt smp_spurious_interrupt
990 983
991/* 984/*
992 * Exception entry points. 985 * Exception entry points.
993 */ 986 */
994 .macro zeroentry sym 987.macro zeroentry sym do_sym
988ENTRY(\sym)
995 INTR_FRAME 989 INTR_FRAME
996 PARAVIRT_ADJUST_EXCEPTION_FRAME 990 PARAVIRT_ADJUST_EXCEPTION_FRAME
997 pushq_cfi $-1 /* ORIG_RAX: no syscall to restart */ 991 pushq_cfi $-1 /* ORIG_RAX: no syscall to restart */
@@ -1001,12 +995,14 @@ END(spurious_interrupt)
1001 DEFAULT_FRAME 0 995 DEFAULT_FRAME 0
1002 movq %rsp,%rdi /* pt_regs pointer */ 996 movq %rsp,%rdi /* pt_regs pointer */
1003 xorl %esi,%esi /* no error code */ 997 xorl %esi,%esi /* no error code */
1004 call \sym 998 call \do_sym
1005 jmp error_exit /* %ebx: no swapgs flag */ 999 jmp error_exit /* %ebx: no swapgs flag */
1006 CFI_ENDPROC 1000 CFI_ENDPROC
1007 .endm 1001END(\sym)
1002.endm
1008 1003
1009 .macro paranoidzeroentry sym 1004.macro paranoidzeroentry sym do_sym
1005KPROBE_ENTRY(\sym)
1010 INTR_FRAME 1006 INTR_FRAME
1011 PARAVIRT_ADJUST_EXCEPTION_FRAME 1007 PARAVIRT_ADJUST_EXCEPTION_FRAME
1012 pushq $-1 /* ORIG_RAX: no syscall to restart */ 1008 pushq $-1 /* ORIG_RAX: no syscall to restart */
@@ -1016,12 +1012,14 @@ END(spurious_interrupt)
1016 TRACE_IRQS_OFF 1012 TRACE_IRQS_OFF
1017 movq %rsp,%rdi /* pt_regs pointer */ 1013 movq %rsp,%rdi /* pt_regs pointer */
1018 xorl %esi,%esi /* no error code */ 1014 xorl %esi,%esi /* no error code */
1019 call \sym 1015 call \do_sym
1020 jmp paranoid_exit /* %ebx: no swapgs flag */ 1016 jmp paranoid_exit /* %ebx: no swapgs flag */
1021 CFI_ENDPROC 1017 CFI_ENDPROC
1022 .endm 1018KPROBE_END(\sym)
1019.endm
1023 1020
1024 .macro paranoidzeroentry_ist sym ist 1021.macro paranoidzeroentry_ist sym do_sym ist
1022KPROBE_ENTRY(\sym)
1025 INTR_FRAME 1023 INTR_FRAME
1026 PARAVIRT_ADJUST_EXCEPTION_FRAME 1024 PARAVIRT_ADJUST_EXCEPTION_FRAME
1027 pushq $-1 /* ORIG_RAX: no syscall to restart */ 1025 pushq $-1 /* ORIG_RAX: no syscall to restart */
@@ -1033,13 +1031,19 @@ END(spurious_interrupt)
1033 xorl %esi,%esi /* no error code */ 1031 xorl %esi,%esi /* no error code */
1034 movq %gs:pda_data_offset, %rbp 1032 movq %gs:pda_data_offset, %rbp
1035 subq $EXCEPTION_STKSZ, per_cpu__init_tss + TSS_ist + (\ist - 1) * 8(%rbp) 1033 subq $EXCEPTION_STKSZ, per_cpu__init_tss + TSS_ist + (\ist - 1) * 8(%rbp)
1036 call \sym 1034 call \do_sym
1037 addq $EXCEPTION_STKSZ, per_cpu__init_tss + TSS_ist + (\ist - 1) * 8(%rbp) 1035 addq $EXCEPTION_STKSZ, per_cpu__init_tss + TSS_ist + (\ist - 1) * 8(%rbp)
1038 jmp paranoid_exit /* %ebx: no swapgs flag */ 1036 jmp paranoid_exit /* %ebx: no swapgs flag */
1039 CFI_ENDPROC 1037 CFI_ENDPROC
1040 .endm 1038KPROBE_END(\sym)
1039.endm
1041 1040
1042 .macro errorentry sym 1041.macro errorentry sym do_sym entry=0
1042.if \entry
1043KPROBE_ENTRY(\sym)
1044.else
1045ENTRY(\sym)
1046.endif
1043 XCPT_FRAME 1047 XCPT_FRAME
1044 PARAVIRT_ADJUST_EXCEPTION_FRAME 1048 PARAVIRT_ADJUST_EXCEPTION_FRAME
1045 subq $15*8,%rsp 1049 subq $15*8,%rsp
@@ -1049,13 +1053,23 @@ END(spurious_interrupt)
1049 movq %rsp,%rdi /* pt_regs pointer */ 1053 movq %rsp,%rdi /* pt_regs pointer */
1050 movq ORIG_RAX(%rsp),%rsi /* get error code */ 1054 movq ORIG_RAX(%rsp),%rsi /* get error code */
1051 movq $-1,ORIG_RAX(%rsp) /* no syscall to restart */ 1055 movq $-1,ORIG_RAX(%rsp) /* no syscall to restart */
1052 call \sym 1056 call \do_sym
1053 jmp error_exit /* %ebx: no swapgs flag */ 1057 jmp error_exit /* %ebx: no swapgs flag */
1054 CFI_ENDPROC 1058 CFI_ENDPROC
1055 .endm 1059.if \entry
1060KPROBE_END(\sym)
1061.else
1062END(\sym)
1063.endif
1064.endm
1056 1065
1057 /* error code is on the stack already */ 1066 /* error code is on the stack already */
1058 .macro paranoiderrorentry sym 1067.macro paranoiderrorentry sym do_sym entry=1
1068.if \entry
1069KPROBE_ENTRY(\sym)
1070.else
1071ENTRY(\sym)
1072.endif
1059 XCPT_FRAME 1073 XCPT_FRAME
1060 PARAVIRT_ADJUST_EXCEPTION_FRAME 1074 PARAVIRT_ADJUST_EXCEPTION_FRAME
1061 subq $15*8,%rsp 1075 subq $15*8,%rsp
@@ -1066,10 +1080,37 @@ END(spurious_interrupt)
1066 movq %rsp,%rdi /* pt_regs pointer */ 1080 movq %rsp,%rdi /* pt_regs pointer */
1067 movq ORIG_RAX(%rsp),%rsi /* get error code */ 1081 movq ORIG_RAX(%rsp),%rsi /* get error code */
1068 movq $-1,ORIG_RAX(%rsp) /* no syscall to restart */ 1082 movq $-1,ORIG_RAX(%rsp) /* no syscall to restart */
1069 call \sym 1083 call \do_sym
1070 jmp paranoid_exit /* %ebx: no swapgs flag */ 1084 jmp paranoid_exit /* %ebx: no swapgs flag */
1071 CFI_ENDPROC 1085 CFI_ENDPROC
1072 .endm 1086.if \entry
1087KPROBE_END(\sym)
1088.else
1089END(\sym)
1090.endif
1091.endm
1092
1093zeroentry divide_error do_divide_error
1094paranoidzeroentry_ist debug do_debug DEBUG_STACK
1095paranoidzeroentry_ist int3 do_int3 DEBUG_STACK
1096zeroentry overflow do_overflow
1097zeroentry bounds do_bounds
1098zeroentry invalid_op do_invalid_op
1099zeroentry device_not_available do_device_not_available
1100paranoiderrorentry double_fault do_double_fault 0
1101zeroentry coprocessor_segment_overrun do_coprocessor_segment_overrun
1102errorentry invalid_TSS do_invalid_TSS
1103errorentry segment_not_present do_segment_not_present
1104paranoiderrorentry stack_segment do_stack_segment
1105errorentry general_protection do_general_protection 1
1106errorentry page_fault do_page_fault 1
1107zeroentry spurious_interrupt_bug do_spurious_interrupt_bug
1108zeroentry coprocessor_error do_coprocessor_error
1109errorentry alignment_check do_alignment_check
1110#ifdef CONFIG_X86_MCE
1111paranoidzeroentry machine_check do_machine_check
1112#endif
1113zeroentry simd_coprocessor_error do_simd_coprocessor_error
1073 1114
1074 /* 1115 /*
1075 * "Paranoid" exit path from exception stack. 1116 * "Paranoid" exit path from exception stack.
@@ -1321,26 +1362,7 @@ ENTRY(kernel_execve)
1321 CFI_ENDPROC 1362 CFI_ENDPROC
1322ENDPROC(kernel_execve) 1363ENDPROC(kernel_execve)
1323 1364
1324KPROBE_ENTRY(page_fault)
1325 errorentry do_page_fault
1326KPROBE_END(page_fault)
1327 1365
1328ENTRY(coprocessor_error)
1329 zeroentry do_coprocessor_error
1330END(coprocessor_error)
1331
1332ENTRY(simd_coprocessor_error)
1333 zeroentry do_simd_coprocessor_error
1334END(simd_coprocessor_error)
1335
1336ENTRY(device_not_available)
1337 zeroentry do_device_not_available
1338END(device_not_available)
1339
1340 /* runs on exception stack */
1341KPROBE_ENTRY(debug)
1342 paranoidzeroentry_ist do_debug, DEBUG_STACK
1343KPROBE_END(debug)
1344 1366
1345 /* runs on exception stack */ 1367 /* runs on exception stack */
1346KPROBE_ENTRY(nmi) 1368KPROBE_ENTRY(nmi)
@@ -1397,67 +1419,6 @@ nmi_schedule:
1397#endif 1419#endif
1398KPROBE_END(nmi) 1420KPROBE_END(nmi)
1399 1421
1400KPROBE_ENTRY(int3)
1401 paranoidzeroentry_ist do_int3, DEBUG_STACK
1402KPROBE_END(int3)
1403
1404ENTRY(overflow)
1405 zeroentry do_overflow
1406END(overflow)
1407
1408ENTRY(bounds)
1409 zeroentry do_bounds
1410END(bounds)
1411
1412ENTRY(invalid_op)
1413 zeroentry do_invalid_op
1414END(invalid_op)
1415
1416ENTRY(coprocessor_segment_overrun)
1417 zeroentry do_coprocessor_segment_overrun
1418END(coprocessor_segment_overrun)
1419
1420 /* runs on exception stack */
1421ENTRY(double_fault)
1422 paranoiderrorentry do_double_fault
1423END(double_fault)
1424
1425ENTRY(invalid_TSS)
1426 errorentry do_invalid_TSS
1427END(invalid_TSS)
1428
1429ENTRY(segment_not_present)
1430 errorentry do_segment_not_present
1431END(segment_not_present)
1432
1433 /* runs on exception stack */
1434ENTRY(stack_segment)
1435 paranoiderrorentry do_stack_segment
1436END(stack_segment)
1437
1438KPROBE_ENTRY(general_protection)
1439 errorentry do_general_protection
1440KPROBE_END(general_protection)
1441
1442ENTRY(alignment_check)
1443 errorentry do_alignment_check
1444END(alignment_check)
1445
1446ENTRY(divide_error)
1447 zeroentry do_divide_error
1448END(divide_error)
1449
1450ENTRY(spurious_interrupt_bug)
1451 zeroentry do_spurious_interrupt_bug
1452END(spurious_interrupt_bug)
1453
1454#ifdef CONFIG_X86_MCE
1455 /* runs on exception stack */
1456ENTRY(machine_check)
1457 paranoidzeroentry do_machine_check
1458END(machine_check)
1459#endif
1460
1461/* Call softirq on interrupt stack. Interrupts are off. */ 1422/* Call softirq on interrupt stack. Interrupts are off. */
1462ENTRY(call_softirq) 1423ENTRY(call_softirq)
1463 CFI_STARTPROC 1424 CFI_STARTPROC
@@ -1486,9 +1447,7 @@ KPROBE_ENTRY(ignore_sysret)
1486ENDPROC(ignore_sysret) 1447ENDPROC(ignore_sysret)
1487 1448
1488#ifdef CONFIG_XEN 1449#ifdef CONFIG_XEN
1489ENTRY(xen_hypervisor_callback) 1450zeroentry xen_hypervisor_callback xen_do_hypervisor_callback
1490 zeroentry xen_do_hypervisor_callback
1491END(xen_hypervisor_callback)
1492 1451
1493/* 1452/*
1494# A note on the "critical region" in our callback handler. 1453# A note on the "critical region" in our callback handler.