Commit 2765130b authored by Jan Beulich's avatar Jan Beulich Committed by Linus Torvalds

[PATCH] x86_64: More CFI fixes for 32bit entry code

Frame unwind information was still incorrect for ia32_ptregs_common
(sorry, my fault), and could be improved for some of the other entry
points.
Signed-Off-By: default avatarJan Beulich <jbeulich@novell.com>
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 6076399e
...@@ -35,6 +35,18 @@ ...@@ -35,6 +35,18 @@
movq %rax,R8(%rsp) movq %rax,R8(%rsp)
.endm .endm
.macro CFI_STARTPROC32 simple
CFI_STARTPROC \simple
CFI_UNDEFINED r8
CFI_UNDEFINED r9
CFI_UNDEFINED r10
CFI_UNDEFINED r11
CFI_UNDEFINED r12
CFI_UNDEFINED r13
CFI_UNDEFINED r14
CFI_UNDEFINED r15
.endm
/* /*
* 32bit SYSENTER instruction entry. * 32bit SYSENTER instruction entry.
* *
...@@ -55,7 +67,7 @@ ...@@ -55,7 +67,7 @@
* with the int 0x80 path. * with the int 0x80 path.
*/ */
ENTRY(ia32_sysenter_target) ENTRY(ia32_sysenter_target)
CFI_STARTPROC simple CFI_STARTPROC32 simple
CFI_DEF_CFA rsp,0 CFI_DEF_CFA rsp,0
CFI_REGISTER rsp,rbp CFI_REGISTER rsp,rbp
swapgs swapgs
...@@ -161,7 +173,7 @@ sysenter_tracesys: ...@@ -161,7 +173,7 @@ sysenter_tracesys:
* with the int 0x80 path. * with the int 0x80 path.
*/ */
ENTRY(ia32_cstar_target) ENTRY(ia32_cstar_target)
CFI_STARTPROC simple CFI_STARTPROC32 simple
CFI_DEF_CFA rsp,0 CFI_DEF_CFA rsp,0
CFI_REGISTER rip,rcx CFI_REGISTER rip,rcx
/*CFI_REGISTER rflags,r11*/ /*CFI_REGISTER rflags,r11*/
...@@ -318,7 +330,7 @@ quiet_ni_syscall: ...@@ -318,7 +330,7 @@ quiet_ni_syscall:
jmp ia32_ptregs_common jmp ia32_ptregs_common
.endm .endm
CFI_STARTPROC CFI_STARTPROC32
PTREGSCALL stub32_rt_sigreturn, sys32_rt_sigreturn, %rdi PTREGSCALL stub32_rt_sigreturn, sys32_rt_sigreturn, %rdi
PTREGSCALL stub32_sigreturn, sys32_sigreturn, %rdi PTREGSCALL stub32_sigreturn, sys32_sigreturn, %rdi
...@@ -333,8 +345,19 @@ quiet_ni_syscall: ...@@ -333,8 +345,19 @@ quiet_ni_syscall:
ENTRY(ia32_ptregs_common) ENTRY(ia32_ptregs_common)
popq %r11 popq %r11
CFI_ADJUST_CFA_OFFSET -8 CFI_ENDPROC
CFI_REGISTER rip, r11 CFI_STARTPROC32 simple
CFI_DEF_CFA rsp,SS+8-ARGOFFSET
CFI_REL_OFFSET rax,RAX-ARGOFFSET
CFI_REL_OFFSET rcx,RCX-ARGOFFSET
CFI_REL_OFFSET rdx,RDX-ARGOFFSET
CFI_REL_OFFSET rsi,RSI-ARGOFFSET
CFI_REL_OFFSET rdi,RDI-ARGOFFSET
CFI_REL_OFFSET rip,RIP-ARGOFFSET
/* CFI_REL_OFFSET cs,CS-ARGOFFSET*/
/* CFI_REL_OFFSET rflags,EFLAGS-ARGOFFSET*/
CFI_REL_OFFSET rsp,RSP-ARGOFFSET
/* CFI_REL_OFFSET ss,SS-ARGOFFSET*/
SAVE_REST SAVE_REST
call *%rax call *%rax
RESTORE_REST RESTORE_REST
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#define CFI_RESTORE .cfi_restore #define CFI_RESTORE .cfi_restore
#define CFI_REMEMBER_STATE .cfi_remember_state #define CFI_REMEMBER_STATE .cfi_remember_state
#define CFI_RESTORE_STATE .cfi_restore_state #define CFI_RESTORE_STATE .cfi_restore_state
#define CFI_UNDEFINED .cfi_undefined
#else #else
...@@ -44,6 +45,7 @@ ...@@ -44,6 +45,7 @@
#define CFI_RESTORE # #define CFI_RESTORE #
#define CFI_REMEMBER_STATE # #define CFI_REMEMBER_STATE #
#define CFI_RESTORE_STATE # #define CFI_RESTORE_STATE #
#define CFI_UNDEFINED #
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment