diff options
author | Alexander van Heukelum <heukelum@mailshack.com> | 2008-11-23 04:08:28 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-23 08:21:54 -0500 |
commit | 322648d1ba75280d62f114d47048beb0b35f5047 (patch) | |
tree | a4963976f5a699267c8c5c7d9b305e959ed8ce9f /arch/x86/kernel/entry_64.S | |
parent | 8a2503fa4a6fae8ee42140b339f37373fc6acaae (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.S | 259 |
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 | 926 | ENTRY(\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 | 933 | END(\sym) |
934 | .endm | ||
935 | 935 | ||
936 | ENTRY(thermal_interrupt) | 936 | #ifdef CONFIG_SMP |
937 | apicinterrupt THERMAL_APIC_VECTOR,smp_thermal_interrupt | 937 | apicinterrupt IRQ_MOVE_CLEANUP_VECTOR \ |
938 | END(thermal_interrupt) | 938 | irq_move_cleanup_interrupt smp_irq_move_cleanup_interrupt |
939 | #endif | ||
939 | 940 | ||
940 | ENTRY(threshold_interrupt) | 941 | apicinterrupt 220 \ |
941 | apicinterrupt THRESHOLD_APIC_VECTOR,mce_threshold_interrupt | 942 | uv_bau_message_intr1 uv_bau_message_interrupt |
942 | END(threshold_interrupt) | 943 | apicinterrupt LOCAL_TIMER_VECTOR \ |
944 | apic_timer_interrupt smp_apic_timer_interrupt | ||
943 | 945 | ||
944 | #ifdef CONFIG_SMP | 946 | #ifdef CONFIG_SMP |
945 | ENTRY(reschedule_interrupt) | 947 | apicinterrupt INVALIDATE_TLB_VECTOR_START+0 \ |
946 | apicinterrupt RESCHEDULE_VECTOR,smp_reschedule_interrupt | 948 | invalidate_interrupt0 smp_invalidate_interrupt |
947 | END(reschedule_interrupt) | 949 | apicinterrupt INVALIDATE_TLB_VECTOR_START+1 \ |
948 | 950 | invalidate_interrupt1 smp_invalidate_interrupt | |
949 | .macro INVALIDATE_ENTRY num | 951 | apicinterrupt INVALIDATE_TLB_VECTOR_START+2 \ |
950 | ENTRY(invalidate_interrupt\num) | 952 | invalidate_interrupt2 smp_invalidate_interrupt |
951 | apicinterrupt INVALIDATE_TLB_VECTOR_START+\num,smp_invalidate_interrupt | 953 | apicinterrupt INVALIDATE_TLB_VECTOR_START+3 \ |
952 | END(invalidate_interrupt\num) | 954 | invalidate_interrupt3 smp_invalidate_interrupt |
953 | .endm | 955 | apicinterrupt INVALIDATE_TLB_VECTOR_START+4 \ |
954 | 956 | invalidate_interrupt4 smp_invalidate_interrupt | |
955 | INVALIDATE_ENTRY 0 | 957 | apicinterrupt INVALIDATE_TLB_VECTOR_START+5 \ |
956 | INVALIDATE_ENTRY 1 | 958 | invalidate_interrupt5 smp_invalidate_interrupt |
957 | INVALIDATE_ENTRY 2 | 959 | apicinterrupt INVALIDATE_TLB_VECTOR_START+6 \ |
958 | INVALIDATE_ENTRY 3 | 960 | invalidate_interrupt6 smp_invalidate_interrupt |
959 | INVALIDATE_ENTRY 4 | 961 | apicinterrupt INVALIDATE_TLB_VECTOR_START+7 \ |
960 | INVALIDATE_ENTRY 5 | 962 | invalidate_interrupt7 smp_invalidate_interrupt |
961 | INVALIDATE_ENTRY 6 | ||
962 | INVALIDATE_ENTRY 7 | ||
963 | |||
964 | ENTRY(call_function_interrupt) | ||
965 | apicinterrupt CALL_FUNCTION_VECTOR,smp_call_function_interrupt | ||
966 | END(call_function_interrupt) | ||
967 | ENTRY(call_function_single_interrupt) | ||
968 | apicinterrupt CALL_FUNCTION_SINGLE_VECTOR,smp_call_function_single_interrupt | ||
969 | END(call_function_single_interrupt) | ||
970 | ENTRY(irq_move_cleanup_interrupt) | ||
971 | apicinterrupt IRQ_MOVE_CLEANUP_VECTOR,smp_irq_move_cleanup_interrupt | ||
972 | END(irq_move_cleanup_interrupt) | ||
973 | #endif | 963 | #endif |
974 | 964 | ||
975 | ENTRY(apic_timer_interrupt) | 965 | apicinterrupt THRESHOLD_APIC_VECTOR \ |
976 | apicinterrupt LOCAL_TIMER_VECTOR,smp_apic_timer_interrupt | 966 | threshold_interrupt mce_threshold_interrupt |
977 | END(apic_timer_interrupt) | 967 | apicinterrupt THERMAL_APIC_VECTOR \ |
978 | 968 | thermal_interrupt smp_thermal_interrupt | |
979 | ENTRY(uv_bau_message_intr1) | ||
980 | apicinterrupt 220,uv_bau_message_interrupt | ||
981 | END(uv_bau_message_intr1) | ||
982 | 969 | ||
983 | ENTRY(error_interrupt) | 970 | #ifdef CONFIG_SMP |
984 | apicinterrupt ERROR_APIC_VECTOR,smp_error_interrupt | 971 | apicinterrupt CALL_FUNCTION_SINGLE_VECTOR \ |
985 | END(error_interrupt) | 972 | call_function_single_interrupt smp_call_function_single_interrupt |
973 | apicinterrupt CALL_FUNCTION_VECTOR \ | ||
974 | call_function_interrupt smp_call_function_interrupt | ||
975 | apicinterrupt RESCHEDULE_VECTOR \ | ||
976 | reschedule_interrupt smp_reschedule_interrupt | ||
977 | #endif | ||
986 | 978 | ||
987 | ENTRY(spurious_interrupt) | 979 | apicinterrupt ERROR_APIC_VECTOR \ |
988 | apicinterrupt SPURIOUS_APIC_VECTOR,smp_spurious_interrupt | 980 | error_interrupt smp_error_interrupt |
989 | END(spurious_interrupt) | 981 | apicinterrupt 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 |
988 | ENTRY(\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 | 1001 | END(\sym) |
1002 | .endm | ||
1008 | 1003 | ||
1009 | .macro paranoidzeroentry sym | 1004 | .macro paranoidzeroentry sym do_sym |
1005 | KPROBE_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 | 1018 | KPROBE_END(\sym) |
1019 | .endm | ||
1023 | 1020 | ||
1024 | .macro paranoidzeroentry_ist sym ist | 1021 | .macro paranoidzeroentry_ist sym do_sym ist |
1022 | KPROBE_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 | 1038 | KPROBE_END(\sym) |
1039 | .endm | ||
1041 | 1040 | ||
1042 | .macro errorentry sym | 1041 | .macro errorentry sym do_sym entry=0 |
1042 | .if \entry | ||
1043 | KPROBE_ENTRY(\sym) | ||
1044 | .else | ||
1045 | ENTRY(\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 |
1060 | KPROBE_END(\sym) | ||
1061 | .else | ||
1062 | END(\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 | ||
1069 | KPROBE_ENTRY(\sym) | ||
1070 | .else | ||
1071 | ENTRY(\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 |
1087 | KPROBE_END(\sym) | ||
1088 | .else | ||
1089 | END(\sym) | ||
1090 | .endif | ||
1091 | .endm | ||
1092 | |||
1093 | zeroentry divide_error do_divide_error | ||
1094 | paranoidzeroentry_ist debug do_debug DEBUG_STACK | ||
1095 | paranoidzeroentry_ist int3 do_int3 DEBUG_STACK | ||
1096 | zeroentry overflow do_overflow | ||
1097 | zeroentry bounds do_bounds | ||
1098 | zeroentry invalid_op do_invalid_op | ||
1099 | zeroentry device_not_available do_device_not_available | ||
1100 | paranoiderrorentry double_fault do_double_fault 0 | ||
1101 | zeroentry coprocessor_segment_overrun do_coprocessor_segment_overrun | ||
1102 | errorentry invalid_TSS do_invalid_TSS | ||
1103 | errorentry segment_not_present do_segment_not_present | ||
1104 | paranoiderrorentry stack_segment do_stack_segment | ||
1105 | errorentry general_protection do_general_protection 1 | ||
1106 | errorentry page_fault do_page_fault 1 | ||
1107 | zeroentry spurious_interrupt_bug do_spurious_interrupt_bug | ||
1108 | zeroentry coprocessor_error do_coprocessor_error | ||
1109 | errorentry alignment_check do_alignment_check | ||
1110 | #ifdef CONFIG_X86_MCE | ||
1111 | paranoidzeroentry machine_check do_machine_check | ||
1112 | #endif | ||
1113 | zeroentry 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 |
1322 | ENDPROC(kernel_execve) | 1363 | ENDPROC(kernel_execve) |
1323 | 1364 | ||
1324 | KPROBE_ENTRY(page_fault) | ||
1325 | errorentry do_page_fault | ||
1326 | KPROBE_END(page_fault) | ||
1327 | 1365 | ||
1328 | ENTRY(coprocessor_error) | ||
1329 | zeroentry do_coprocessor_error | ||
1330 | END(coprocessor_error) | ||
1331 | |||
1332 | ENTRY(simd_coprocessor_error) | ||
1333 | zeroentry do_simd_coprocessor_error | ||
1334 | END(simd_coprocessor_error) | ||
1335 | |||
1336 | ENTRY(device_not_available) | ||
1337 | zeroentry do_device_not_available | ||
1338 | END(device_not_available) | ||
1339 | |||
1340 | /* runs on exception stack */ | ||
1341 | KPROBE_ENTRY(debug) | ||
1342 | paranoidzeroentry_ist do_debug, DEBUG_STACK | ||
1343 | KPROBE_END(debug) | ||
1344 | 1366 | ||
1345 | /* runs on exception stack */ | 1367 | /* runs on exception stack */ |
1346 | KPROBE_ENTRY(nmi) | 1368 | KPROBE_ENTRY(nmi) |
@@ -1397,67 +1419,6 @@ nmi_schedule: | |||
1397 | #endif | 1419 | #endif |
1398 | KPROBE_END(nmi) | 1420 | KPROBE_END(nmi) |
1399 | 1421 | ||
1400 | KPROBE_ENTRY(int3) | ||
1401 | paranoidzeroentry_ist do_int3, DEBUG_STACK | ||
1402 | KPROBE_END(int3) | ||
1403 | |||
1404 | ENTRY(overflow) | ||
1405 | zeroentry do_overflow | ||
1406 | END(overflow) | ||
1407 | |||
1408 | ENTRY(bounds) | ||
1409 | zeroentry do_bounds | ||
1410 | END(bounds) | ||
1411 | |||
1412 | ENTRY(invalid_op) | ||
1413 | zeroentry do_invalid_op | ||
1414 | END(invalid_op) | ||
1415 | |||
1416 | ENTRY(coprocessor_segment_overrun) | ||
1417 | zeroentry do_coprocessor_segment_overrun | ||
1418 | END(coprocessor_segment_overrun) | ||
1419 | |||
1420 | /* runs on exception stack */ | ||
1421 | ENTRY(double_fault) | ||
1422 | paranoiderrorentry do_double_fault | ||
1423 | END(double_fault) | ||
1424 | |||
1425 | ENTRY(invalid_TSS) | ||
1426 | errorentry do_invalid_TSS | ||
1427 | END(invalid_TSS) | ||
1428 | |||
1429 | ENTRY(segment_not_present) | ||
1430 | errorentry do_segment_not_present | ||
1431 | END(segment_not_present) | ||
1432 | |||
1433 | /* runs on exception stack */ | ||
1434 | ENTRY(stack_segment) | ||
1435 | paranoiderrorentry do_stack_segment | ||
1436 | END(stack_segment) | ||
1437 | |||
1438 | KPROBE_ENTRY(general_protection) | ||
1439 | errorentry do_general_protection | ||
1440 | KPROBE_END(general_protection) | ||
1441 | |||
1442 | ENTRY(alignment_check) | ||
1443 | errorentry do_alignment_check | ||
1444 | END(alignment_check) | ||
1445 | |||
1446 | ENTRY(divide_error) | ||
1447 | zeroentry do_divide_error | ||
1448 | END(divide_error) | ||
1449 | |||
1450 | ENTRY(spurious_interrupt_bug) | ||
1451 | zeroentry do_spurious_interrupt_bug | ||
1452 | END(spurious_interrupt_bug) | ||
1453 | |||
1454 | #ifdef CONFIG_X86_MCE | ||
1455 | /* runs on exception stack */ | ||
1456 | ENTRY(machine_check) | ||
1457 | paranoidzeroentry do_machine_check | ||
1458 | END(machine_check) | ||
1459 | #endif | ||
1460 | |||
1461 | /* Call softirq on interrupt stack. Interrupts are off. */ | 1422 | /* Call softirq on interrupt stack. Interrupts are off. */ |
1462 | ENTRY(call_softirq) | 1423 | ENTRY(call_softirq) |
1463 | CFI_STARTPROC | 1424 | CFI_STARTPROC |
@@ -1486,9 +1447,7 @@ KPROBE_ENTRY(ignore_sysret) | |||
1486 | ENDPROC(ignore_sysret) | 1447 | ENDPROC(ignore_sysret) |
1487 | 1448 | ||
1488 | #ifdef CONFIG_XEN | 1449 | #ifdef CONFIG_XEN |
1489 | ENTRY(xen_hypervisor_callback) | 1450 | zeroentry xen_hypervisor_callback xen_do_hypervisor_callback |
1490 | zeroentry xen_do_hypervisor_callback | ||
1491 | END(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. |