[aarch64-port-dev ] Question about ISB usage in the aarch64 port
Andrew Haley
aph at redhat.com
Thu Nov 21 10:03:58 UTC 2019
On 11/15/19 8:33 AM, Yangfei (Felix) wrote:
> I am witnessing some SIGILL jvm crashes on my aarch64 platform.
> I looked at the ISB usage, especially this one: https://mail.openjdk.java.net/pipermail/aarch64-port-dev/2014-September/001376.html
> One of changes is adding one ISB after the native call returns:
Yes, I did that.
> 1100 static void rt_call(MacroAssembler* masm, address dest, int gpargs, int fpargs, int type) {
> 1101 CodeBlob *cb = CodeCache::find_blob(dest);
> 1102 if (cb) {
> 1103 __ far_call(RuntimeAddress(dest));
> 1104 } else {
> 1105 assert((unsigned)gpargs < 256, "eek!");
> 1106 assert((unsigned)fpargs < 32, "eek!");
> 1107 __ lea(rscratch1, RuntimeAddress(dest));
> 1108 __ blr(rscratch1);
> 1109 __ maybe_isb(); < ========
> 1110 }
> 1111 }
>
>
> The rt_call function is used in generate_native_wrapper to make the
> JNI call.
> As I didn’t see the barrier for the ppc or arm port. I would like
> to know more details here. Does anyone still remember?
What question are you asking? The ISB is there because the callout
might run concurrently with a safepoint, during which time the code
cache may be changed by some other thread. While we are in native code
safepoints can run in other threads without us knowing.
> Also the ISB is planted only in the else block. I assume this is
> also necessary for the if block. Correct?
No. The if block is for calls within the AArch64 Java runtime, so we
stay in Java, and there shouldn't be any ISB needed. Any part of the
Java runtime that loads or generates code does its own ISB.
--
Andrew Haley (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
More information about the aarch64-port-dev
mailing list