RFR: 8287325: AArch64: fix virtual threads with -XX:UseBranchProtection=pac-ret
Hao Sun
haosun at openjdk.org
Mon Aug 14 04:47:33 UTC 2023
On Mon, 29 May 2023 09:48:02 GMT, Andrew Haley <aph at openjdk.org> wrote:
> > We thought it's the usual convention that any MacroAssembler call can clobber rscratch1 or rscratch2 registers. We
> > cannot do that in protect_return_address() and authenticate_return_address(). Here shows an exception case [2]. We
> > may need revisit all the usages of rscratch1 and rscratch2 to check if this convention can be guaranteed.
>
> Generally speaking, that is the rule. If LR is not live in the snippet you mentioned, we could use LR instead of rscratch1.
Thanks for your comment.
But the fact is that LR is **live** in the PAC code generation/authentication parts, since LR is one of the three inputs to PAC(Note that the other two are the modifier and the key). As a result, I'm afraid we could not use LR as scratch register there either.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/13322#issuecomment-1566876770
More information about the hotspot-dev
mailing list