diff mbox series

[for_v23,v2,3/3] x86/vdso: sgx: Fix unwinder support, again

Message ID 20191017000554.11927-4-sean.j.christopherson@intel.com (mailing list archive)
State New, archived
Headers show
Series x86/vdso: sgx: Bug fixes for v23 | expand

Commit Message

Sean Christopherson Oct. 17, 2019, 12:05 a.m. UTC
Move the .cfi_endproc directive back to the end of the function where it
belongs, and instead update the Canonical Frame Address to account for
the out-of-line code running in the pre-leave context, i.e. before the
stack frame is popped.

Reported-by: Cedric Xing <cedric.xing@intel.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
 arch/x86/entry/vdso/vsgx_enter_enclave.S | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/arch/x86/entry/vdso/vsgx_enter_enclave.S b/arch/x86/entry/vdso/vsgx_enter_enclave.S
index d36043b99dc6..c6ca6e6031b6 100644
--- a/arch/x86/entry/vdso/vsgx_enter_enclave.S
+++ b/arch/x86/entry/vdso/vsgx_enter_enclave.S
@@ -113,7 +113,9 @@  ENTRY(__vdso_sgx_enter_enclave)
 	leave
 	.cfi_def_cfa		%rsp, 8
 	ret
-	.cfi_endproc
+
+	/* The out-of-line code runs with the pre-leave stack frame. */
+	.cfi_def_cfa		%rbp, 16
 
 .Linvalid_leaf:
 	mov	$(-EINVAL), %eax
@@ -178,6 +180,7 @@  ENTRY(__vdso_sgx_enter_enclave)
 	jmp	1b
 2:	mov	%rax, (%rsp)
 	ret
+	.cfi_endproc
 
 _ASM_VDSO_EXTABLE_HANDLE(.Lenclu_eenter_eresume, .Lhandle_exception)