diff options
-rw-r--r-- | arch/x86/include/asm/dwarf2.h | 20 | ||||
-rw-r--r-- | arch/x86/kernel/entry_32.S | 294 | ||||
-rw-r--r-- | arch/x86/kernel/entry_64.S | 65 |
3 files changed, 141 insertions, 238 deletions
diff --git a/arch/x86/include/asm/dwarf2.h b/arch/x86/include/asm/dwarf2.h index 733f7e91e7a9..326099199318 100644 --- a/arch/x86/include/asm/dwarf2.h +++ b/arch/x86/include/asm/dwarf2.h | |||
@@ -89,6 +89,16 @@ | |||
89 | CFI_ADJUST_CFA_OFFSET -8 | 89 | CFI_ADJUST_CFA_OFFSET -8 |
90 | .endm | 90 | .endm |
91 | 91 | ||
92 | .macro pushfq_cfi | ||
93 | pushfq | ||
94 | CFI_ADJUST_CFA_OFFSET 8 | ||
95 | .endm | ||
96 | |||
97 | .macro popfq_cfi | ||
98 | popfq | ||
99 | CFI_ADJUST_CFA_OFFSET -8 | ||
100 | .endm | ||
101 | |||
92 | .macro movq_cfi reg offset=0 | 102 | .macro movq_cfi reg offset=0 |
93 | movq %\reg, \offset(%rsp) | 103 | movq %\reg, \offset(%rsp) |
94 | CFI_REL_OFFSET \reg, \offset | 104 | CFI_REL_OFFSET \reg, \offset |
@@ -109,6 +119,16 @@ | |||
109 | CFI_ADJUST_CFA_OFFSET -4 | 119 | CFI_ADJUST_CFA_OFFSET -4 |
110 | .endm | 120 | .endm |
111 | 121 | ||
122 | .macro pushfl_cfi | ||
123 | pushfl | ||
124 | CFI_ADJUST_CFA_OFFSET 4 | ||
125 | .endm | ||
126 | |||
127 | .macro popfl_cfi | ||
128 | popfl | ||
129 | CFI_ADJUST_CFA_OFFSET -4 | ||
130 | .endm | ||
131 | |||
112 | .macro movl_cfi reg offset=0 | 132 | .macro movl_cfi reg offset=0 |
113 | movl %\reg, \offset(%esp) | 133 | movl %\reg, \offset(%esp) |
114 | CFI_REL_OFFSET \reg, \offset | 134 | CFI_REL_OFFSET \reg, \offset |
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index d9b950ee5590..9fb188d7bc76 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 |
149 | 98: popl %gs | 147 | 98: 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 |
262 | 1: popl %ds | 242 | 1: popl_cfi %ds |
263 | CFI_ADJUST_CFA_OFFSET -4 | ||
264 | /*CFI_RESTORE ds;*/ | 243 | /*CFI_RESTORE ds;*/ |
265 | 2: popl %es | 244 | 2: popl_cfi %es |
266 | CFI_ADJUST_CFA_OFFSET -4 | ||
267 | /*CFI_RESTORE es;*/ | 245 | /*CFI_RESTORE es;*/ |
268 | 3: popl %fs | 246 | 3: 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 | ||
321 | ENTRY(ret_from_fork) | 298 | ENTRY(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 |
335 | END(ret_from_fork) | 308 | END(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 |
530 | ENTRY(system_call) | 496 | ENTRY(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 |
567 | restore_nocheck: | 532 | restore_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 | ||
570 | irq_return: | 534 | irq_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 |
668 | work_notifysig_v86: | 630 | work_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 |
846 | 1: pushl $(~vector+0x80) /* Note: always in signed byte range */ | 804 | 1: 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) \ |
885 | ENTRY(name) \ | 842 | ENTRY(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 | ||
902 | ENTRY(coprocessor_error) | 858 | ENTRY(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 |
910 | END(coprocessor_error) | 864 | END(coprocessor_error) |
911 | 865 | ||
912 | ENTRY(simd_coprocessor_error) | 866 | ENTRY(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 */ |
918 | 661: pushl $do_general_protection | 871 | 661: pushl_cfi $do_general_protection |
919 | 662: | 872 | 662: |
920 | .section .altinstructions,"a" | 873 | .section .altinstructions,"a" |
921 | .balign 4 | 874 | .balign 4 |
@@ -930,19 +883,16 @@ ENTRY(simd_coprocessor_error) | |||
930 | 664: | 883 | 664: |
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 |
938 | END(simd_coprocessor_error) | 890 | END(simd_coprocessor_error) |
939 | 891 | ||
940 | ENTRY(device_not_available) | 892 | ENTRY(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 |
948 | END(device_not_available) | 898 | END(device_not_available) |
@@ -964,82 +914,68 @@ END(native_irq_enable_sysexit) | |||
964 | 914 | ||
965 | ENTRY(overflow) | 915 | ENTRY(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 |
973 | END(overflow) | 921 | END(overflow) |
974 | 922 | ||
975 | ENTRY(bounds) | 923 | ENTRY(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 |
983 | END(bounds) | 929 | END(bounds) |
984 | 930 | ||
985 | ENTRY(invalid_op) | 931 | ENTRY(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 |
993 | END(invalid_op) | 937 | END(invalid_op) |
994 | 938 | ||
995 | ENTRY(coprocessor_segment_overrun) | 939 | ENTRY(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 |
1003 | END(coprocessor_segment_overrun) | 945 | END(coprocessor_segment_overrun) |
1004 | 946 | ||
1005 | ENTRY(invalid_TSS) | 947 | ENTRY(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 |
1011 | END(invalid_TSS) | 952 | END(invalid_TSS) |
1012 | 953 | ||
1013 | ENTRY(segment_not_present) | 954 | ENTRY(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 |
1019 | END(segment_not_present) | 959 | END(segment_not_present) |
1020 | 960 | ||
1021 | ENTRY(stack_segment) | 961 | ENTRY(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 |
1027 | END(stack_segment) | 966 | END(stack_segment) |
1028 | 967 | ||
1029 | ENTRY(alignment_check) | 968 | ENTRY(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 |
1035 | END(alignment_check) | 973 | END(alignment_check) |
1036 | 974 | ||
1037 | ENTRY(divide_error) | 975 | ENTRY(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 |
1045 | END(divide_error) | 981 | END(divide_error) |
@@ -1047,10 +983,8 @@ END(divide_error) | |||
1047 | #ifdef CONFIG_X86_MCE | 983 | #ifdef CONFIG_X86_MCE |
1048 | ENTRY(machine_check) | 984 | ENTRY(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 |
1056 | END(machine_check) | 990 | END(machine_check) |
@@ -1058,10 +992,8 @@ END(machine_check) | |||
1058 | 992 | ||
1059 | ENTRY(spurious_interrupt_bug) | 993 | ENTRY(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 |
1067 | END(spurious_interrupt_bug) | 999 | END(spurious_interrupt_bug) |
@@ -1092,8 +1024,7 @@ ENTRY(xen_sysenter_target) | |||
1092 | 1024 | ||
1093 | ENTRY(xen_hypervisor_callback) | 1025 | ENTRY(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. |
1130 | ENTRY(xen_failsafe_callback) | 1061 | ENTRY(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 |
1135 | 1: mov 4(%esp),%ds | 1065 | 1: mov 4(%esp),%ds |
1136 | 2: mov 8(%esp),%es | 1066 | 2: mov 8(%esp),%es |
1137 | 3: mov 12(%esp),%fs | 1067 | 3: mov 12(%esp),%fs |
1138 | 4: mov 16(%esp),%gs | 1068 | 4: 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) |
1147 | 5: pushl $0 # EAX == 0 => Category 1 (Bad segment) | 1076 | 5: 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 | ||
1296 | ENTRY(page_fault) | 1224 | ENTRY(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 |
1301 | error_code: | 1228 | error_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 |
1387 | debug_stack_correct: | 1301 | debug_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 | */ |
1407 | ENTRY(nmi) | 1320 | ENTRY(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 |
1431 | nmi_stack_correct: | 1340 | nmi_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 | ||
1486 | ENTRY(int3) | 1390 | ENTRY(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 | ||
1499 | ENTRY(general_protection) | 1402 | ENTRY(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 |
1505 | END(general_protection) | 1407 | END(general_protection) |
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index 6f305830c80c..8851a2bb8c0b 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S | |||
@@ -213,23 +213,17 @@ ENDPROC(native_usergs_sysret64) | |||
213 | .macro FAKE_STACK_FRAME child_rip | 213 | .macro FAKE_STACK_FRAME child_rip |
214 | /* push in order ss, rsp, eflags, cs, rip */ | 214 | /* push in order ss, rsp, eflags, cs, rip */ |
215 | xorl %eax, %eax | 215 | xorl %eax, %eax |
216 | pushq $__KERNEL_DS /* ss */ | 216 | pushq_cfi $__KERNEL_DS /* ss */ |
217 | CFI_ADJUST_CFA_OFFSET 8 | ||
218 | /*CFI_REL_OFFSET ss,0*/ | 217 | /*CFI_REL_OFFSET ss,0*/ |
219 | pushq %rax /* rsp */ | 218 | pushq_cfi %rax /* rsp */ |
220 | CFI_ADJUST_CFA_OFFSET 8 | ||
221 | CFI_REL_OFFSET rsp,0 | 219 | CFI_REL_OFFSET rsp,0 |
222 | pushq $X86_EFLAGS_IF /* eflags - interrupts on */ | 220 | pushq_cfi $X86_EFLAGS_IF /* eflags - interrupts on */ |
223 | CFI_ADJUST_CFA_OFFSET 8 | ||
224 | /*CFI_REL_OFFSET rflags,0*/ | 221 | /*CFI_REL_OFFSET rflags,0*/ |
225 | pushq $__KERNEL_CS /* cs */ | 222 | pushq_cfi $__KERNEL_CS /* cs */ |
226 | CFI_ADJUST_CFA_OFFSET 8 | ||
227 | /*CFI_REL_OFFSET cs,0*/ | 223 | /*CFI_REL_OFFSET cs,0*/ |
228 | pushq \child_rip /* rip */ | 224 | pushq_cfi \child_rip /* rip */ |
229 | CFI_ADJUST_CFA_OFFSET 8 | ||
230 | CFI_REL_OFFSET rip,0 | 225 | CFI_REL_OFFSET rip,0 |
231 | pushq %rax /* orig rax */ | 226 | pushq_cfi %rax /* orig rax */ |
232 | CFI_ADJUST_CFA_OFFSET 8 | ||
233 | .endm | 227 | .endm |
234 | 228 | ||
235 | .macro UNFAKE_STACK_FRAME | 229 | .macro UNFAKE_STACK_FRAME |
@@ -398,10 +392,8 @@ ENTRY(ret_from_fork) | |||
398 | 392 | ||
399 | LOCK ; btr $TIF_FORK,TI_flags(%r8) | 393 | LOCK ; btr $TIF_FORK,TI_flags(%r8) |
400 | 394 | ||
401 | push kernel_eflags(%rip) | 395 | pushq_cfi kernel_eflags(%rip) |
402 | CFI_ADJUST_CFA_OFFSET 8 | 396 | popfq_cfi # reset kernel eflags |
403 | popf # reset kernel eflags | ||
404 | CFI_ADJUST_CFA_OFFSET -8 | ||
405 | 397 | ||
406 | call schedule_tail # rdi: 'prev' task parameter | 398 | call schedule_tail # rdi: 'prev' task parameter |
407 | 399 | ||
@@ -521,11 +513,9 @@ sysret_careful: | |||
521 | jnc sysret_signal | 513 | jnc sysret_signal |
522 | TRACE_IRQS_ON | 514 | TRACE_IRQS_ON |
523 | ENABLE_INTERRUPTS(CLBR_NONE) | 515 | ENABLE_INTERRUPTS(CLBR_NONE) |
524 | pushq %rdi | 516 | pushq_cfi %rdi |
525 | CFI_ADJUST_CFA_OFFSET 8 | ||
526 | call schedule | 517 | call schedule |
527 | popq %rdi | 518 | popq_cfi %rdi |
528 | CFI_ADJUST_CFA_OFFSET -8 | ||
529 | jmp sysret_check | 519 | jmp sysret_check |
530 | 520 | ||
531 | /* Handle a signal */ | 521 | /* Handle a signal */ |
@@ -634,11 +624,9 @@ int_careful: | |||
634 | jnc int_very_careful | 624 | jnc int_very_careful |
635 | TRACE_IRQS_ON | 625 | TRACE_IRQS_ON |
636 | ENABLE_INTERRUPTS(CLBR_NONE) | 626 | ENABLE_INTERRUPTS(CLBR_NONE) |
637 | pushq %rdi | 627 | pushq_cfi %rdi |
638 | CFI_ADJUST_CFA_OFFSET 8 | ||
639 | call schedule | 628 | call schedule |
640 | popq %rdi | 629 | popq_cfi %rdi |
641 | CFI_ADJUST_CFA_OFFSET -8 | ||
642 | DISABLE_INTERRUPTS(CLBR_NONE) | 630 | DISABLE_INTERRUPTS(CLBR_NONE) |
643 | TRACE_IRQS_OFF | 631 | TRACE_IRQS_OFF |
644 | jmp int_with_check | 632 | jmp int_with_check |
@@ -652,12 +640,10 @@ int_check_syscall_exit_work: | |||
652 | /* Check for syscall exit trace */ | 640 | /* Check for syscall exit trace */ |
653 | testl $_TIF_WORK_SYSCALL_EXIT,%edx | 641 | testl $_TIF_WORK_SYSCALL_EXIT,%edx |
654 | jz int_signal | 642 | jz int_signal |
655 | pushq %rdi | 643 | pushq_cfi %rdi |
656 | CFI_ADJUST_CFA_OFFSET 8 | ||
657 | leaq 8(%rsp),%rdi # &ptregs -> arg1 | 644 | leaq 8(%rsp),%rdi # &ptregs -> arg1 |
658 | call syscall_trace_leave | 645 | call syscall_trace_leave |
659 | popq %rdi | 646 | popq_cfi %rdi |
660 | CFI_ADJUST_CFA_OFFSET -8 | ||
661 | andl $~(_TIF_WORK_SYSCALL_EXIT|_TIF_SYSCALL_EMU),%edi | 647 | andl $~(_TIF_WORK_SYSCALL_EXIT|_TIF_SYSCALL_EMU),%edi |
662 | jmp int_restore_rest | 648 | jmp int_restore_rest |
663 | 649 | ||
@@ -765,8 +751,7 @@ vector=FIRST_EXTERNAL_VECTOR | |||
765 | .if vector <> FIRST_EXTERNAL_VECTOR | 751 | .if vector <> FIRST_EXTERNAL_VECTOR |
766 | CFI_ADJUST_CFA_OFFSET -8 | 752 | CFI_ADJUST_CFA_OFFSET -8 |
767 | .endif | 753 | .endif |
768 | 1: pushq $(~vector+0x80) /* Note: always in signed byte range */ | 754 | 1: pushq_cfi $(~vector+0x80) /* Note: always in signed byte range */ |
769 | CFI_ADJUST_CFA_OFFSET 8 | ||
770 | .if ((vector-FIRST_EXTERNAL_VECTOR)%7) <> 6 | 755 | .if ((vector-FIRST_EXTERNAL_VECTOR)%7) <> 6 |
771 | jmp 2f | 756 | jmp 2f |
772 | .endif | 757 | .endif |
@@ -821,6 +806,7 @@ ret_from_intr: | |||
821 | TRACE_IRQS_OFF | 806 | TRACE_IRQS_OFF |
822 | decl PER_CPU_VAR(irq_count) | 807 | decl PER_CPU_VAR(irq_count) |
823 | leaveq | 808 | leaveq |
809 | CFI_RESTORE rbp | ||
824 | CFI_DEF_CFA_REGISTER rsp | 810 | CFI_DEF_CFA_REGISTER rsp |
825 | CFI_ADJUST_CFA_OFFSET -8 | 811 | CFI_ADJUST_CFA_OFFSET -8 |
826 | exit_intr: | 812 | exit_intr: |
@@ -902,11 +888,9 @@ retint_careful: | |||
902 | jnc retint_signal | 888 | jnc retint_signal |
903 | TRACE_IRQS_ON | 889 | TRACE_IRQS_ON |
904 | ENABLE_INTERRUPTS(CLBR_NONE) | 890 | ENABLE_INTERRUPTS(CLBR_NONE) |
905 | pushq %rdi | 891 | pushq_cfi %rdi |
906 | CFI_ADJUST_CFA_OFFSET 8 | ||
907 | call schedule | 892 | call schedule |
908 | popq %rdi | 893 | popq_cfi %rdi |
909 | CFI_ADJUST_CFA_OFFSET -8 | ||
910 | GET_THREAD_INFO(%rcx) | 894 | GET_THREAD_INFO(%rcx) |
911 | DISABLE_INTERRUPTS(CLBR_NONE) | 895 | DISABLE_INTERRUPTS(CLBR_NONE) |
912 | TRACE_IRQS_OFF | 896 | TRACE_IRQS_OFF |
@@ -955,8 +939,7 @@ END(common_interrupt) | |||
955 | .macro apicinterrupt num sym do_sym | 939 | .macro apicinterrupt num sym do_sym |
956 | ENTRY(\sym) | 940 | ENTRY(\sym) |
957 | INTR_FRAME | 941 | INTR_FRAME |
958 | pushq $~(\num) | 942 | pushq_cfi $~(\num) |
959 | CFI_ADJUST_CFA_OFFSET 8 | ||
960 | interrupt \do_sym | 943 | interrupt \do_sym |
961 | jmp ret_from_intr | 944 | jmp ret_from_intr |
962 | CFI_ENDPROC | 945 | CFI_ENDPROC |
@@ -1138,16 +1121,14 @@ zeroentry simd_coprocessor_error do_simd_coprocessor_error | |||
1138 | /* edi: new selector */ | 1121 | /* edi: new selector */ |
1139 | ENTRY(native_load_gs_index) | 1122 | ENTRY(native_load_gs_index) |
1140 | CFI_STARTPROC | 1123 | CFI_STARTPROC |
1141 | pushf | 1124 | pushfq_cfi |
1142 | CFI_ADJUST_CFA_OFFSET 8 | ||
1143 | DISABLE_INTERRUPTS(CLBR_ANY & ~CLBR_RDI) | 1125 | DISABLE_INTERRUPTS(CLBR_ANY & ~CLBR_RDI) |
1144 | SWAPGS | 1126 | SWAPGS |
1145 | gs_change: | 1127 | gs_change: |
1146 | movl %edi,%gs | 1128 | movl %edi,%gs |
1147 | 2: mfence /* workaround */ | 1129 | 2: mfence /* workaround */ |
1148 | SWAPGS | 1130 | SWAPGS |
1149 | popf | 1131 | popfq_cfi |
1150 | CFI_ADJUST_CFA_OFFSET -8 | ||
1151 | ret | 1132 | ret |
1152 | CFI_ENDPROC | 1133 | CFI_ENDPROC |
1153 | END(native_load_gs_index) | 1134 | END(native_load_gs_index) |
@@ -1214,8 +1195,7 @@ END(kernel_execve) | |||
1214 | /* Call softirq on interrupt stack. Interrupts are off. */ | 1195 | /* Call softirq on interrupt stack. Interrupts are off. */ |
1215 | ENTRY(call_softirq) | 1196 | ENTRY(call_softirq) |
1216 | CFI_STARTPROC | 1197 | CFI_STARTPROC |
1217 | push %rbp | 1198 | pushq_cfi %rbp |
1218 | CFI_ADJUST_CFA_OFFSET 8 | ||
1219 | CFI_REL_OFFSET rbp,0 | 1199 | CFI_REL_OFFSET rbp,0 |
1220 | mov %rsp,%rbp | 1200 | mov %rsp,%rbp |
1221 | CFI_DEF_CFA_REGISTER rbp | 1201 | CFI_DEF_CFA_REGISTER rbp |
@@ -1224,6 +1204,7 @@ ENTRY(call_softirq) | |||
1224 | push %rbp # backlink for old unwinder | 1204 | push %rbp # backlink for old unwinder |
1225 | call __do_softirq | 1205 | call __do_softirq |
1226 | leaveq | 1206 | leaveq |
1207 | CFI_RESTORE rbp | ||
1227 | CFI_DEF_CFA_REGISTER rsp | 1208 | CFI_DEF_CFA_REGISTER rsp |
1228 | CFI_ADJUST_CFA_OFFSET -8 | 1209 | CFI_ADJUST_CFA_OFFSET -8 |
1229 | decl PER_CPU_VAR(irq_count) | 1210 | decl PER_CPU_VAR(irq_count) |