diff options
-rw-r--r-- | arch/x86/kernel/entry_64.S | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index fad777b11366..692c1da61905 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S | |||
@@ -1026,6 +1026,39 @@ END(spurious_interrupt) | |||
1026 | CFI_ENDPROC | 1026 | CFI_ENDPROC |
1027 | .endm | 1027 | .endm |
1028 | 1028 | ||
1029 | .macro paranoidzeroentry sym | ||
1030 | INTR_FRAME | ||
1031 | PARAVIRT_ADJUST_EXCEPTION_FRAME | ||
1032 | pushq $-1 /* ORIG_RAX: no syscall to restart */ | ||
1033 | CFI_ADJUST_CFA_OFFSET 8 | ||
1034 | subq $15*8, %rsp | ||
1035 | call save_paranoid | ||
1036 | TRACE_IRQS_OFF | ||
1037 | movq %rsp,%rdi /* pt_regs pointer */ | ||
1038 | xorl %esi,%esi /* no error code */ | ||
1039 | call \sym | ||
1040 | jmp paranoid_exit /* %ebx: no swapgs flag */ | ||
1041 | CFI_ENDPROC | ||
1042 | .endm | ||
1043 | |||
1044 | .macro paranoidzeroentry_ist sym ist | ||
1045 | INTR_FRAME | ||
1046 | PARAVIRT_ADJUST_EXCEPTION_FRAME | ||
1047 | pushq $-1 /* ORIG_RAX: no syscall to restart */ | ||
1048 | CFI_ADJUST_CFA_OFFSET 8 | ||
1049 | subq $15*8, %rsp | ||
1050 | call save_paranoid | ||
1051 | TRACE_IRQS_OFF | ||
1052 | movq %rsp,%rdi /* pt_regs pointer */ | ||
1053 | xorl %esi,%esi /* no error code */ | ||
1054 | movq %gs:pda_data_offset, %rbp | ||
1055 | subq $EXCEPTION_STKSZ, per_cpu__init_tss + TSS_ist + (\ist - 1) * 8(%rbp) | ||
1056 | call \sym | ||
1057 | addq $EXCEPTION_STKSZ, per_cpu__init_tss + TSS_ist + (\ist - 1) * 8(%rbp) | ||
1058 | jmp paranoid_exit /* %ebx: no swapgs flag */ | ||
1059 | CFI_ENDPROC | ||
1060 | .endm | ||
1061 | |||
1029 | .macro errorentry sym | 1062 | .macro errorentry sym |
1030 | XCPT_FRAME | 1063 | XCPT_FRAME |
1031 | PARAVIRT_ADJUST_EXCEPTION_FRAME | 1064 | PARAVIRT_ADJUST_EXCEPTION_FRAME |
@@ -1042,27 +1075,20 @@ END(spurious_interrupt) | |||
1042 | .endm | 1075 | .endm |
1043 | 1076 | ||
1044 | /* error code is on the stack already */ | 1077 | /* error code is on the stack already */ |
1045 | .macro paranoidentry sym ist=0 | 1078 | .macro paranoiderrorentry sym |
1046 | subq $15*8, %rsp | 1079 | XCPT_FRAME |
1080 | PARAVIRT_ADJUST_EXCEPTION_FRAME | ||
1081 | subq $15*8,%rsp | ||
1047 | CFI_ADJUST_CFA_OFFSET 15*8 | 1082 | CFI_ADJUST_CFA_OFFSET 15*8 |
1048 | call save_paranoid | 1083 | call save_paranoid |
1049 | DEFAULT_FRAME 0 | 1084 | DEFAULT_FRAME 0 |
1050 | .if \ist | ||
1051 | movq %gs:pda_data_offset, %rbp | ||
1052 | .endif | ||
1053 | TRACE_IRQS_OFF | 1085 | TRACE_IRQS_OFF |
1054 | movq %rsp,%rdi | 1086 | movq %rsp,%rdi /* pt_regs pointer */ |
1055 | movq ORIG_RAX(%rsp),%rsi | 1087 | movq ORIG_RAX(%rsp),%rsi /* get error code */ |
1056 | movq $-1,ORIG_RAX(%rsp) | 1088 | movq $-1,ORIG_RAX(%rsp) /* no syscall to restart */ |
1057 | .if \ist | ||
1058 | subq $EXCEPTION_STKSZ, per_cpu__init_tss + TSS_ist + (\ist - 1) * 8(%rbp) | ||
1059 | .endif | ||
1060 | call \sym | 1089 | call \sym |
1061 | .if \ist | 1090 | jmp paranoid_exit /* %ebx: no swapgs flag */ |
1062 | addq $EXCEPTION_STKSZ, per_cpu__init_tss + TSS_ist + (\ist - 1) * 8(%rbp) | 1091 | CFI_ENDPROC |
1063 | .endif | ||
1064 | DISABLE_INTERRUPTS(CLBR_NONE) | ||
1065 | TRACE_IRQS_OFF | ||
1066 | .endm | 1092 | .endm |
1067 | 1093 | ||
1068 | /* | 1094 | /* |
@@ -1081,6 +1107,8 @@ END(spurious_interrupt) | |||
1081 | /* ebx: no swapgs flag */ | 1107 | /* ebx: no swapgs flag */ |
1082 | KPROBE_ENTRY(paranoid_exit) | 1108 | KPROBE_ENTRY(paranoid_exit) |
1083 | INTR_FRAME | 1109 | INTR_FRAME |
1110 | DISABLE_INTERRUPTS(CLBR_NONE) | ||
1111 | TRACE_IRQS_OFF | ||
1084 | testl %ebx,%ebx /* swapgs needed? */ | 1112 | testl %ebx,%ebx /* swapgs needed? */ |
1085 | jnz paranoid_restore | 1113 | jnz paranoid_restore |
1086 | testl $3,CS(%rsp) | 1114 | testl $3,CS(%rsp) |
@@ -1331,13 +1359,7 @@ END(device_not_available) | |||
1331 | 1359 | ||
1332 | /* runs on exception stack */ | 1360 | /* runs on exception stack */ |
1333 | KPROBE_ENTRY(debug) | 1361 | KPROBE_ENTRY(debug) |
1334 | INTR_FRAME | 1362 | paranoidzeroentry_ist do_debug, DEBUG_STACK |
1335 | PARAVIRT_ADJUST_EXCEPTION_FRAME | ||
1336 | pushq $0 | ||
1337 | CFI_ADJUST_CFA_OFFSET 8 | ||
1338 | paranoidentry do_debug, DEBUG_STACK | ||
1339 | jmp paranoid_exit | ||
1340 | CFI_ENDPROC | ||
1341 | KPROBE_END(debug) | 1363 | KPROBE_END(debug) |
1342 | 1364 | ||
1343 | /* runs on exception stack */ | 1365 | /* runs on exception stack */ |
@@ -1351,14 +1373,12 @@ KPROBE_ENTRY(nmi) | |||
1351 | DEFAULT_FRAME 0 | 1373 | DEFAULT_FRAME 0 |
1352 | /* paranoidentry do_nmi, 0; without TRACE_IRQS_OFF */ | 1374 | /* paranoidentry do_nmi, 0; without TRACE_IRQS_OFF */ |
1353 | movq %rsp,%rdi | 1375 | movq %rsp,%rdi |
1354 | movq ORIG_RAX(%rsp),%rsi | 1376 | movq $-1,%rsi |
1355 | movq $-1,ORIG_RAX(%rsp) | ||
1356 | call do_nmi | 1377 | call do_nmi |
1357 | DISABLE_INTERRUPTS(CLBR_NONE) | ||
1358 | #ifdef CONFIG_TRACE_IRQFLAGS | 1378 | #ifdef CONFIG_TRACE_IRQFLAGS |
1359 | /* paranoidexit; without TRACE_IRQS_OFF */ | 1379 | /* paranoidexit; without TRACE_IRQS_OFF */ |
1360 | /* ebx: no swapgs flag */ | 1380 | /* ebx: no swapgs flag */ |
1361 | nmi_exit: | 1381 | DISABLE_INTERRUPTS(CLBR_NONE) |
1362 | testl %ebx,%ebx /* swapgs needed? */ | 1382 | testl %ebx,%ebx /* swapgs needed? */ |
1363 | jnz nmi_restore | 1383 | jnz nmi_restore |
1364 | testl $3,CS(%rsp) | 1384 | testl $3,CS(%rsp) |
@@ -1398,13 +1418,7 @@ nmi_schedule: | |||
1398 | KPROBE_END(nmi) | 1418 | KPROBE_END(nmi) |
1399 | 1419 | ||
1400 | KPROBE_ENTRY(int3) | 1420 | KPROBE_ENTRY(int3) |
1401 | INTR_FRAME | 1421 | paranoidzeroentry_ist do_int3, DEBUG_STACK |
1402 | PARAVIRT_ADJUST_EXCEPTION_FRAME | ||
1403 | pushq $0 | ||
1404 | CFI_ADJUST_CFA_OFFSET 8 | ||
1405 | paranoidentry do_int3, DEBUG_STACK | ||
1406 | jmp paranoid_exit | ||
1407 | CFI_ENDPROC | ||
1408 | KPROBE_END(int3) | 1422 | KPROBE_END(int3) |
1409 | 1423 | ||
1410 | ENTRY(overflow) | 1424 | ENTRY(overflow) |
@@ -1425,11 +1439,7 @@ END(coprocessor_segment_overrun) | |||
1425 | 1439 | ||
1426 | /* runs on exception stack */ | 1440 | /* runs on exception stack */ |
1427 | ENTRY(double_fault) | 1441 | ENTRY(double_fault) |
1428 | XCPT_FRAME | 1442 | paranoiderrorentry do_double_fault |
1429 | PARAVIRT_ADJUST_EXCEPTION_FRAME | ||
1430 | paranoidentry do_double_fault | ||
1431 | jmp paranoid_exit | ||
1432 | CFI_ENDPROC | ||
1433 | END(double_fault) | 1443 | END(double_fault) |
1434 | 1444 | ||
1435 | ENTRY(invalid_TSS) | 1445 | ENTRY(invalid_TSS) |
@@ -1442,11 +1452,7 @@ END(segment_not_present) | |||
1442 | 1452 | ||
1443 | /* runs on exception stack */ | 1453 | /* runs on exception stack */ |
1444 | ENTRY(stack_segment) | 1454 | ENTRY(stack_segment) |
1445 | XCPT_FRAME | 1455 | paranoiderrorentry do_stack_segment |
1446 | PARAVIRT_ADJUST_EXCEPTION_FRAME | ||
1447 | paranoidentry do_stack_segment | ||
1448 | jmp paranoid_exit | ||
1449 | CFI_ENDPROC | ||
1450 | END(stack_segment) | 1456 | END(stack_segment) |
1451 | 1457 | ||
1452 | KPROBE_ENTRY(general_protection) | 1458 | KPROBE_ENTRY(general_protection) |
@@ -1468,13 +1474,7 @@ END(spurious_interrupt_bug) | |||
1468 | #ifdef CONFIG_X86_MCE | 1474 | #ifdef CONFIG_X86_MCE |
1469 | /* runs on exception stack */ | 1475 | /* runs on exception stack */ |
1470 | ENTRY(machine_check) | 1476 | ENTRY(machine_check) |
1471 | INTR_FRAME | 1477 | paranoidzeroentry do_machine_check |
1472 | PARAVIRT_ADJUST_EXCEPTION_FRAME | ||
1473 | pushq $0 | ||
1474 | CFI_ADJUST_CFA_OFFSET 8 | ||
1475 | paranoidentry do_machine_check | ||
1476 | jmp paranoid_exit | ||
1477 | CFI_ENDPROC | ||
1478 | END(machine_check) | 1478 | END(machine_check) |
1479 | #endif | 1479 | #endif |
1480 | 1480 | ||