RFR: 8287325: AArch64: fix virtual threads with -XX:UseBranchProtection=pac-ret
Hao Sun
haosun at openjdk.org
Fri Apr 7 03:25:45 UTC 2023
On Thu, 6 Apr 2023 09:58:39 GMT, Hao Sun <haosun at openjdk.org> wrote:
>> Using SP seems like the right way to go. Can't we compute the correct SP value to use in Runtime1::generate_handle_exception()?
>
>> Using SP seems like the right way to go. Can't we compute the correct SP value to use in Runtime1::generate_handle_exception()?
>
> Thanks for your question, Dean.
> Thinking more about it, I guess we can get the expected SP value.
>
> In my local test, I always use `rfp + 16` to authenticate the return address, and test cases under `test/jdk/java/lang/Thread/` and `test/hotspot/jtreg/compiler/c2/` can pass except the `virtual thread` cases. I'm running tier1-3 now.
>
> My concern is that **using absolute SP** is incompatible with **virtual thread**, since PAC re-sign is still needed due to the stack copying process (See Requirement-2 in the commit message). Alternatively, we may want to use **relative SP** as the modifier.
>
> However, I didn't know how to get such an **initial SP** value. Do you have any idea?
> Thanks.
> @shqking, to get a relative SP, I think you would want to subtract SP from thread->last_continuation()->entry_sp().
Thanks for your hint. I will take a try.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/13322#issuecomment-1499890789
More information about the hotspot-dev
mailing list