[aarch64-port-dev ] 8219993: AArch64: Compiled CI stubs are unsafely modified
Andrew Dinn
adinn at redhat.com
Wed Mar 27 10:04:53 UTC 2019
On 27/03/2019 09:56, Andrew Haley wrote:
> 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.
Ok, looks good then.
regards,
Andrew Dinn
-----------
Senior Principal Software Engineer
Red Hat UK Ltd
Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander
More information about the aarch64-port-dev
mailing list