[aarch64-port-dev ] 8219993: AArch64: Compiled CI stubs are unsafely modified
Andrew Haley
aph at redhat.com
Wed Mar 27 09:56:23 UTC 2019
On 3/27/19 9:39 AM, Andrew Dinn wrote:
> On 26/03/2019 18:26, Andrew Haley wrote:
>> Here's a simpler patch. All I do this time is insert an ISB between the
>> call and the load instructions so that we don't have a stale instruction
>> buffer.
>>
>> I also took the opportunity to unify some code which was duplicated in
>> C1 and compiledIC_aarch64.
>>
>> Andrew Dinn, please approve this one. :-)
>>
>> http://cr.openjdk.java.net/~aph/8219993.2/
> That looks ok modulo one detail I don't really understand which, I
> think, applies to both old and new code.
>
> The stub target address gets updated by NativeMovConstReg::set_data
> which calls pd_patch_instruction. When that is called in some patching
> thread how is it guaranteed that some other reading/executing thread
> does not observe partial writes of the movz+movk+movk sequence?
It's only written once, when the c2i stub is first used. After that it
is only rewritten at a safepoint, and we assert this. It's written
synchronously by the first thread that encounters it, and there is a
lock to prevent races.
--
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
More information about the aarch64-port-dev
mailing list