[PATCH] D127007: [MC] Add 'G' to augmentation string for MTE instrumented functions

Florian Mayer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 6 17:49:01 PDT 2022


fmayer added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp:1289
+  case AArch64::EMITMTETAGGED: {
+    ExceptionHandling ExceptionHandlingType = MAI->getExceptionHandlingType();
+    if (ExceptionHandlingType != ExceptionHandling::DwarfCFI &&
----------------
fmayer wrote:
> eugenis wrote:
> > As we've seen recently, sometimes even nounwind frames get unwound. Is it possible to relax some of these conditions to emit the "G" in as many cases as possible? This is the situation where MTE is more demanding to the unwind correctness, so I'd rather err on the safe side.
> > 
> I'm not sure. This is exactly the same logic as for the B-Key, so either we change both or neither. B-Key is just as important to correctness as this is.
> 
> What do you mean "nounwind frames get unwound"? AFAICT they do get skipped over, so the 'G' wouldn't help.
I think the only thing we can do is force unwind tables for all frames that have stack instrumentation, but that would be quite a big hammer.

I'm not sure that is the right thing to do, where the real solution would be for people to fix their builds to not mix exception and noexception code in this way. Given that this mode is (at least for now) intended for testing, to me that seems like the better thing for people to do, as all sorts of stuff can go wrong when throwing exceptions through no-exception code (PAC as mentioned above, anything that needs RAII, &c).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127007



More information about the llvm-commits mailing list