[Lldb-commits] [PATCH] D98886: Pass pointer authentication code mask from minidump and use to strip pac from pc.

Peter Collingbourne via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 30 15:42:01 PDT 2021


pcc added inline comments.


================
Comment at: lldb/include/lldb/Target/Process.h:79
   void SetExtraStartupCommands(const Args &args);
+  uint64_t GetPointerAuthenticationAddressMask() const;
+  void SetPointerAuthenticationAddressMask(const uint64_t mask);
----------------
omjavaid wrote:
> This function name is too specific to AArch64 architecture. IMO, we should have information on significant address bits rather than PAuth mask. This is because we have to cover for the top byte in case of AArch64 Top Byte Ignore feature as well as any other memory management features.
> 
> From user process perspective we should figure out how many bits of the process memory address are significant for addressing while the others store extra information like PAC, Tags or any information inserted by software in top byte.
> 
> I propose to add a new variable (may be call it address_bits_in_use) in process class which is populated by default equal to process address width in our case 64 bit. In case a we choose to update address_bits_in_use we may do it on when process is created or through set method during execution as well.
I don't think we want to clear the top byte if TBI is enabled. This is because the top byte may contain a pointer tag that is necessary in order to access the pointer with MTE. That is exactly what a mask would let us do. The top byte of the mask is clear when TBI is enabled so that the pointer tag is left unchanged.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98886



More information about the lldb-commits mailing list