RFR: 8286058: AArch64: clarify types of calls [v3]

Andrew Haley aph at openjdk.java.net
Wed May 25 09:49:00 UTC 2022


On Wed, 25 May 2022 07:35:32 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> Evgeny Astigeevich has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains five commits:
>> 
>>  - Describe call types; Fix API
>>  - Merge branch 'master' into JDK-8286058
>>  - Merge branch 'master' into JDK-8286058
>>  - Fix assert message
>>  - 8286058: AArch64: clarify uses of MacroAssembler::trampoline_call
>
> src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp line 1149:
> 
>> 1147:   //   - indirect call: move reg, address; blr reg
>> 1148:   //     This too can reach anywhere in the address space, but it cannot be
>> 1149:   //     patch while code is running, so it must be used at a safepoint.
> 
> Suggestion:
> 
>   //     patched while code is running, so it must be used at a safepoint.
>   //     This form of call is most suitable for targets at fixed addresses, whick
>   //     will never be patched.

Suggest:

//
// The patching we do conforms to the "Concurrent modification and
// execution of instructions" section of the Arm Architectural
// Reference Manual, which only allows B, BL, BRK, HVC, ISB, NOP, SMC,
// or SVC instructions to be modified while another thread is
// executing them.
//
// To patch a trampoline call when the BL can't reach, we first modify
// the 64-bit destination address in the trampoline, then modify the
// BL to point to the trampoline, then flush the instruction cache to
// broadcast the change to all executing threads. See
// NativeCall::set_destination_mt_safe for the details.
//
// There is a benign race in that the other thread might observe the
// modified BL before it observes the modified 64-bit destination
// address. That does not matter because the target method has been
// invalidated, so there will be a trap at its start.

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

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


More information about the hotspot-dev mailing list