RFR: 8266749: AArch64: Backtracing broken on PAC enabled systems [v6]

Alan Hayward github.com+4146708+a74nh at openjdk.java.net
Wed Jun 2 14:49:32 UTC 2021


On Wed, 2 Jun 2021 11:06:42 GMT, Alan Hayward <github.com+4146708+a74nh at openjdk.org> wrote:

>> src/hotspot/cpu/aarch64/pauth_aarch64.hpp line 31:
>> 
>>> 29: 
>>> 30: inline bool pauth_ptr_is_raw(address ptr) {
>>> 31:   // Confirm none of the high bits are set in the pointer.
>> 
>> This predicate seems to me to be be misnamed: it's checking for unsigned/stripped, not for raw. The raw value is whatever gets saved in LR/pushed onto the stack.
>
> Ah, yes, because the name pauth_ptr_is_raw() now clashes with sender_pc_raw().
> 
> I'll fix up, one way or the other. Don't really want to call it pauth_ptr_is_unsigned() or pauth_ptr_is_authenticated(), because they seem to imply different things at first glance.

raw is generally accepted as the correct name for a pointer that has not been signed (or has been authenticated/stripped). 
For example see: https://github.com/apple/llvm-project/blob/a63a81bd9911f87a0b5dcd5bdd7ccdda7124af87/clang/docs/PointerAuthentication.rst#basic-concepts

So, pauth_ptr_is_raw() is the correct name.

But, now what to rename sender_pc_raw() to ?  :)
The PAC coder would say:
   inline address  frame::sender_pc()       const { return *sender_pc_addr(); }
   inline address  frame::sender_pc_authenticated()           const { return pauth_strip_pointer(sender_pc()); }
But that's not right here for a common interface.

How about:
   inline address  frame::stored_sender_pc()       const { return *sender_pc_addr(); }
   inline address  frame::sender_pc()           const { return pauth_strip_pointer(stored_sender_pc()); }

-------------

PR: https://git.openjdk.java.net/jdk/pull/4029


More information about the hotspot-dev mailing list