[PATCH] D68468: [AArch64] Do not untag before returning via a `resume` instruction

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 4 14:04:15 PDT 2019


eugenis added a subscriber: pcc.
eugenis added a comment.

@pcc We actually went back and forth on this with HWASan, and ended up wrapping personality functions with a small tag cleanup routine:
https://github.com/llvm-mirror/llvm/blob/master/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp#L1435

As I understand, this line assumes that "resume" exits clean tags for their frame:
https://github.com/llvm-mirror/compiler-rt/blob/master/lib/hwasan/hwasan_exceptions.cpp#L51

This does not have to be same for MTE, but it has an advantage that frames without tagging do not incur the overhead of untagging when an exception flies by.
On the other hand, exceptions are not expected to be exceptionally fast, and untagging in the unwinder has the advantage of simplicity and smaller code size.
In the end, this is a platform ABI issue and should be documented somewhere - SysV ABI supplement maybe? Or here for Android: https://developer.android.com/ndk/guides/abis.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68468/new/

https://reviews.llvm.org/D68468





More information about the llvm-commits mailing list