public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* .eh_frame augmentation character for MTE stack tagging
@ 2022-06-03 23:52 Florian Mayer
  2022-06-06 11:00 ` Richard Earnshaw
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Mayer @ 2022-06-03 23:52 UTC (permalink / raw)
  To: gcc; +Cc: Evgenii Stepanov, Fangrui Song

Hey!

We are in the process of implementing MTE (Memory Tagging Extension)
stack tagging in LLVM. To support stack tagging in combination with
exceptions, we need to make sure that the unwinder will untag stack
frames, to avoid leaving behind stale tags. As such, we need some way
to communicate to the unwinder to do that.

In a discussion on llvm-dev [1], it was decided the best way to go
forward with this would be to add a new character ('G' for taG, as the
MTE instructions stg etc.) to the eh_frame augmentation string, and
then handle that in libunwind by clearing the tags of the respective
frame.

How does that sound? Would that be a good course of action for GCC as well?

Thanks,
Florian

[1]: https://lists.llvm.org/pipermail/llvm-dev/2020-May/141345.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: .eh_frame augmentation character for MTE stack tagging
  2022-06-03 23:52 .eh_frame augmentation character for MTE stack tagging Florian Mayer
@ 2022-06-06 11:00 ` Richard Earnshaw
  2022-06-06 14:15   ` Matthew Malcomson
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Earnshaw @ 2022-06-06 11:00 UTC (permalink / raw)
  To: Florian Mayer, gcc; +Cc: Fangrui Song, Evgenii Stepanov



On 04/06/2022 00:52, Florian Mayer via Gcc wrote:
> Hey!
> 
> We are in the process of implementing MTE (Memory Tagging Extension)
> stack tagging in LLVM. To support stack tagging in combination with
> exceptions, we need to make sure that the unwinder will untag stack
> frames, to avoid leaving behind stale tags. As such, we need some way
> to communicate to the unwinder to do that.
> 
> In a discussion on llvm-dev [1], it was decided the best way to go
> forward with this would be to add a new character ('G' for taG, as the
> MTE instructions stg etc.) to the eh_frame augmentation string, and
> then handle that in libunwind by clearing the tags of the respective
> frame.
> 
> How does that sound? Would that be a good course of action for GCC as well?
> 
> Thanks,
> Florian
> 
> [1]: https://lists.llvm.org/pipermail/llvm-dev/2020-May/141345.html

Hi Florian,

This is something that needs to be specified in the ABI, not just agreed 
between a couple of compilers. So while the community input is helpful, 
it isn't enough.

The correct place to do this is in the ABI project here: 
https://github.com/ARM-software/abi-aa

R.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: .eh_frame augmentation character for MTE stack tagging
  2022-06-06 11:00 ` Richard Earnshaw
@ 2022-06-06 14:15   ` Matthew Malcomson
  0 siblings, 0 replies; 3+ messages in thread
From: Matthew Malcomson @ 2022-06-06 14:15 UTC (permalink / raw)
  To: Richard Earnshaw, Florian Mayer, gcc; +Cc: Evgenii Stepanov, Fangrui Song

Hi there,

Just to mention that this decision has been included in the Arm ABI project.

https://github.com/ARM-software/abi-aa/blob/main/aadwarf64/aadwarf64.rst#id22

MM

On 6/6/22 12:00, Richard Earnshaw via Gcc wrote:
> 
> 
> On 04/06/2022 00:52, Florian Mayer via Gcc wrote:
>> Hey!
>>
>> We are in the process of implementing MTE (Memory Tagging Extension)
>> stack tagging in LLVM. To support stack tagging in combination with
>> exceptions, we need to make sure that the unwinder will untag stack
>> frames, to avoid leaving behind stale tags. As such, we need some way
>> to communicate to the unwinder to do that.
>>
>> In a discussion on llvm-dev [1], it was decided the best way to go
>> forward with this would be to add a new character ('G' for taG, as the
>> MTE instructions stg etc.) to the eh_frame augmentation string, and
>> then handle that in libunwind by clearing the tags of the respective
>> frame.
>>
>> How does that sound? Would that be a good course of action for GCC as 
>> well?
>>
>> Thanks,
>> Florian
>>
>> [1]: https://lists.llvm.org/pipermail/llvm-dev/2020-May/141345.html
> 
> Hi Florian,
> 
> This is something that needs to be specified in the ABI, not just agreed 
> between a couple of compilers. So while the community input is helpful, 
> it isn't enough.
> 
> The correct place to do this is in the ABI project here: 
> https://github.com/ARM-software/abi-aa
> 
> R.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-06 14:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-03 23:52 .eh_frame augmentation character for MTE stack tagging Florian Mayer
2022-06-06 11:00 ` Richard Earnshaw
2022-06-06 14:15   ` Matthew Malcomson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).