[aarch64-port-dev ] 8219993: AArch64: Compiled CI stubs are unsafely modified
Andrew Haley
aph at redhat.com
Wed Mar 6 15:23:22 UTC 2019
According to the Arm manual, except in a few limited cases it is not
safe to modify code while it is being executed. We mostly get this
right, but our CompiledStaticCall stubs are patched at runtime by
rewriting immediate loads. We can fix this by moving the rewritable
data fields into memory so that they are loaded by means of load(mem)
rather than mov(immediate data).
After this patch, CI stubs look like:
dmb ld
ldr rmethod, L1
ldr rscratch1, L2
br [rscratch1]
L1: .data 0
L2: .data 0
When we modify such a stub we rewrite the two data fields to the
method metadata and the interpreter entry point, execute a memory
fence, then rewrite the compiled jump to point to the stub.
http://cr.openjdk.java.net/~aph/8219006.1/
--
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