[Lldb-commits] [PATCH] D105178: [lldb][AArch64] Annotate synchronous tag faults

Peter Collingbourne via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 12 18:14:46 PDT 2021


pcc added a comment.

> Programs must enable the tagged address ABI to
> receive these signals and are also opting into the
> presence of these tag bits.

This is actually independent of the tagged address ABI. For siginfo data structures read via `ptrace(PTRACE_GETSIGINFO)` we will always have the tag in `si_addr` provided that the kernel is new enough. It's only the signal delivery via `sigaction` where the user program needs to opt in (via `SA_EXPOSE_TAGBITS`), and that is again independent of the tagged address ABI.



================
Comment at: lldb/test/API/linux/aarch64/mte_tag_faults/main.c:38
+  // Tag ptr with 10
+  char *tagged_buf = __arm_mte_create_random_tag(buf, 1 << 9);
+  // Set first allocation tag to 10
----------------
This seems like a bit of a roundabout way to set the address tag to 10. Why not just set it directly? i.e.
```
char *tagged_buf = buf + (10ULL << 56);
```
Or wrap that in a function to make things more self documenting. Then you don't need to set the inclusion mask in the prctl call.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105178



More information about the lldb-commits mailing list