JDK-8218185 : aarch64: missing LoadStore barrier in TemplateTable::putfield_or_static
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 8-aarch64,11,13
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: aarch64
  • Submitted: 2019-02-01
  • Updated: 2021-02-01
  • Resolved: 2019-02-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13 Other
11.0.5Fixed 13 b07Fixed openjdk8u292Fixed
Related Reports
Relates :  
Relates :  
Description
Reported by lunliu93@gmail.com :

I noticed in the template interpreter only a StoreStore barrier is used
before a volatile write. According to JMM cookbook I think a LoadStore
barrier is also needed to prevent reordering between a normal read and a
volatile write. In the template interpreter it seems like LoadLoad |
LoadStore barriers are inserted after both normal read and volatile read so
it should be fine but I think this might cause a problem if the compiler
generates a normal read using dmb barriers and the interpreter is executing
the volatile write. Could this be a potential bug?

I am browsing aarch64-port/jdk8u code with the following changeset as the
lastest change
changeset:   9947:1d411780111d
tag:         tip
user:        fyang
date:        Mon Dec 24 13:42:31 2018 +0800
summary:     8209414: AArch64: method handle invocation does not respect
JVMTI interp_only mode

This could be fixed by a simple patch below
diff -r 1d411780111d src/cpu/aarch64/vm/templateTable_aarch64.cpp
--- a/src/cpu/aarch64/vm/templateTable_aarch64.cpp      Mon Dec 24 13:42:31
2018 +0800
+++ b/src/cpu/aarch64/vm/templateTable_aarch64.cpp      Wed Jan 30 21:34:47
2019 +0100
@@ -2633,7 +2633,7 @@
   {
     Label notVolatile;
     __ tbz(r5, ConstantPoolCacheEntry::is_volatile_shift, notVolatile);
-    __ membar(MacroAssembler::StoreStore);
+    __ membar(MacroAssembler::StoreStore | LoadStore);
     __ bind(notVolatile);
   }
Comments
Fix Request (11u) This patch is already in 13 and 8u-aarch64, but not in 11u. Backporting it to 11u keeps codebases in sync, which simplifies future backports. Patch applies cleanly to 11u, passes tier1 (with some unrelated failures).
20-06-2019