DavidSpickett added a comment.

> but I could imagine some harvard architecture target that behaved differently 
> (surely this is why Linux has two address masks)

I'm not privy to the exact reasoning, but at least part of it comes from the 
architecture itself. You could have a target that enables top byte ignore and 
pointer authentication for data addresses, but only enables pointer 
authentication for code addresses. So ptrace will show you different values for 
the pointer authentication masks in that case. I'm not sure you can actually 
configure a kernel that way today, but it's viable.

For the debugger, the result is the same. When top byte ignore is off, pointer 
authentication just uses that free space for itself. We end up removing the 
same set of bits either way.

For very specific tools you might want to only remove pointer authentication 
bits. Making this up, but maybe you want to take pointers from a pointer 
authenticated ABI application and pass them to a shared library without those 
protections. Niche, but ptrace leaves the door open for that rather than 
breaking userspace later by adding it.

Finally, you are right that one day there may be some scheme that truly does 
need different handling for code and data and again, let's keep the door open 
for that up here in lldb (though such an architecture would be major surgery in 
lldb anyway).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155905

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to