Patchwork [libitm] : GTM_longjmp: Jump indirect from memory address

login
register
mail settings
Submitter Richard Henderson
Date Feb. 14, 2012, 7:52 p.m.
Message ID <4F3ABB89.2090402@redhat.com>
Download mbox | patch
Permalink /patch/141179/
State New
Headers show

Comments

Richard Henderson - Feb. 14, 2012, 7:52 p.m.
On 02/14/2012 10:26 AM, Uros Bizjak wrote:
>  #ifdef __x86_64__
> +	cfi_def_cfa(%rsi, 0)
>  	movq	(%rsi), %rcx
>  	movq	8(%rsi), %rbx
>  	movq	16(%rsi), %rbp
> @@ -119,20 +120,21 @@
>  	movq	32(%rsi), %r13
>  	movq	40(%rsi), %r14
>  	movq	48(%rsi), %r15
> +	cfi_offset(%rip, 56)
>  	movl	%edi, %eax
> -	cfi_offset(%rip, 56)
> -	cfi_def_cfa(%rcx, 0)
>  	movq	%rcx, %rsp
> +	cfi_register(%rsp, %rcx)
>  	jmp	*56(%rsi)

No, your changes are incorrect.  All three markers needed to be together
in order to provide a consistent and coherent unwind.  What you committed
was much worse than simply not describing anything at all.

Fixed as below.  Committed.


r~
Uros Bizjak - Feb. 15, 2012, 8:38 a.m.
On Tue, Feb 14, 2012 at 8:52 PM, Richard Henderson <rth@redhat.com> wrote:
> On 02/14/2012 10:26 AM, Uros Bizjak wrote:
>>  #ifdef __x86_64__
>> +     cfi_def_cfa(%rsi, 0)
>>       movq    (%rsi), %rcx
>>       movq    8(%rsi), %rbx
>>       movq    16(%rsi), %rbp
>> @@ -119,20 +120,21 @@
>>       movq    32(%rsi), %r13
>>       movq    40(%rsi), %r14
>>       movq    48(%rsi), %r15
>> +     cfi_offset(%rip, 56)
>>       movl    %edi, %eax
>> -     cfi_offset(%rip, 56)
>> -     cfi_def_cfa(%rcx, 0)
>>       movq    %rcx, %rsp
>> +     cfi_register(%rsp, %rcx)
>>       jmp     *56(%rsi)
>
> No, your changes are incorrect.  All three markers needed to be together
> in order to provide a consistent and coherent unwind.  What you committed
> was much worse than simply not describing anything at all.
>
> Fixed as below.  Committed.

Thanks!

Uros.

Patch

diff --git a/libitm/config/x86/sjlj.S b/libitm/config/x86/sjlj.S
index 554ec98..8844228 100644
--- a/libitm/config/x86/sjlj.S
+++ b/libitm/config/x86/sjlj.S
@@ -112,7 +112,6 @@  SYM(_ITM_beginTransaction):
 SYM(GTM_longjmp):
 	cfi_startproc
 #ifdef __x86_64__
-	cfi_def_cfa(%rsi, 0)
 	movq	(%rsi), %rcx
 	movq	8(%rsi), %rbx
 	movq	16(%rsi), %rbp
@@ -120,21 +119,22 @@  SYM(GTM_longjmp):
 	movq	32(%rsi), %r13
 	movq	40(%rsi), %r14
 	movq	48(%rsi), %r15
-	cfi_offset(%rip, 56)
 	movl	%edi, %eax
-	movq	%rcx, %rsp
+	cfi_def_cfa(%rsi, 0)
+	cfi_offset(%rip, 56)
 	cfi_register(%rsp, %rcx)
+	movq	%rcx, %rsp
 	jmp	*56(%rsi)
 #else
-	cfi_def_cfa(%edx, 0)
 	movl	(%edx), %ecx
 	movl	4(%edx), %ebx
 	movl	8(%edx), %esi
 	movl	12(%edx), %edi
 	movl	16(%edx), %ebp
+	cfi_def_cfa(%edx, 0)
 	cfi_offset(%eip, 20)
-	movl	%ecx, %esp
 	cfi_register(%esp, %ecx)
+	movl	%ecx, %esp
 	jmp	*20(%edx)
 #endif
 	cfi_endproc