Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jiong Wang <jiong.wang@foss.arm.com>
To: Ivo Raisr <ivo.raisr@oracle.com>, GDB <gdb-patches@sourceware.org>
Subject: Re: [Patch] New gdbarch method "dwarf_cfa_op" and migrate SPARC to it
Date: Fri, 21 Apr 2017 18:33:00 -0000	[thread overview]
Message-ID: <1d0d97ca-b503-0303-5efc-600db754bd27@foss.arm.com> (raw)
In-Reply-To: <edec7b0b-7f63-76f8-6546-d11c831e5058@oracle.com>

On 21/04/17 15:43, Ivo Raisr wrote:
>
>
> On 19.4.2017 12:17, Jiong Wang wrote:
>> Hi,
>>
>> Recently a feature called "return address signing" has been added to 
>> GCC to
>> prevent stack smash stack on AArch64.  For details please refer:
>>
>>   https://gcc.gnu.org/ml/gcc-patches/2017-01/msg00376.html
>>
>> GDB needs to be aware of this feature so it can restore the original 
>> return
>> address which is critical for unwinding.
>>
>> On compiler side, whenever return address, i.e. LR register, is 
>> mangled or
>> restored by hardware instruction, compiler is expected to generate a
>> DW_CFA_GNU_window_save CFA instruction to toggle the LR signing status.
>> DW_CFA_GNU_window_save was introduced by SPARC for their register window
>> feature, here AArch64 want to multiplex this DWARF CFA instruction as
>> it's in vendor space.  So, a new gdbarch method, dwarf_cfa_op, is 
>> introduced.
>
> Are you sure to reuse DW_CFA_GNU_window_save for AArch64 purposes? 
> Because semantics of DW_CFA_GNU_window_save (implied from "window 
> save") mean much more than just fiddling with return address. For 
> example as you learned from dwarf2-frame.c, whole register window 
> needs to be copied.

Hi Ivo,

   Thanks very much for testing this on SPARC platform.

   What's really reused is the DWARF CFA number 0x2d behind 
DW_CFA_GNU_window_save.  It is in vendor extension space ( 
DW_CFA_lo_user.. DW_CFA_hi_user) so the semantics depends on vendor 
interpreation.

Regards,
Jiong.


  reply	other threads:[~2017-04-21 18:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-19 10:17 Jiong Wang
2017-04-21 20:45 ` Ivo Raisr
2017-04-21 18:33   ` Jiong Wang [this message]
2017-04-21 19:37     ` Pedro Alves
2017-04-21 19:53       ` Ivo Raisr
2017-04-25 10:40       ` Jiong Wang
2017-04-26  8:49         ` Ivo Raisr
2017-04-26  9:22           ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1d0d97ca-b503-0303-5efc-600db754bd27@foss.arm.com \
    --to=jiong.wang@foss.arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=ivo.raisr@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox