changeset 5729:6547c22e85df

8029190: VM_Version::determine_features() asserts on Fujitsu Sparc64 CPUs Summary: fix code to allow testing on Fujitsu Sparc64 CPUs Reviewed-by: kvn
author sgabdura
date Thu, 04 Sep 2014 09:04:21 +0200
parents aad3fc05d972
children c6b5db6389c9
files src/cpu/sparc/vm/vm_version_sparc.cpp src/cpu/sparc/vm/vm_version_sparc.hpp src/share/vm/runtime/arguments.cpp
diffstat 3 files changed, 28 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/sparc/vm/vm_version_sparc.cpp	Fri Aug 29 12:40:56 2014 -0400
+++ b/src/cpu/sparc/vm/vm_version_sparc.cpp	Thu Sep 04 09:04:21 2014 +0200
@@ -98,6 +98,27 @@
   _supports_cx8 = has_v9();
   _supports_atomic_getset4 = true; // swap instruction
 
+  // There are Fujitsu Sparc64 CPUs which support blk_init as well so
+  // we have to take this check out of the 'is_niagara()' block below.
+  if (has_blk_init()) {
+    // When using CMS or G1, we cannot use memset() in BOT updates
+    // because the sun4v/CMT version in libc_psr uses BIS which
+    // exposes "phantom zeros" to concurrent readers. See 6948537.
+    if (FLAG_IS_DEFAULT(UseMemSetInBOT) && (UseConcMarkSweepGC || UseG1GC)) {
+      FLAG_SET_DEFAULT(UseMemSetInBOT, false);
+    }
+    // Issue a stern warning if the user has explicitly set
+    // UseMemSetInBOT (it is known to cause issues), but allow
+    // use for experimentation and debugging.
+    if (UseConcMarkSweepGC || UseG1GC) {
+      if (UseMemSetInBOT) {
+        assert(!FLAG_IS_DEFAULT(UseMemSetInBOT), "Error");
+        warning("Experimental flag -XX:+UseMemSetInBOT is known to cause instability"
+                " on sun4v; please understand that you are using at your own risk!");
+      }
+    }
+  }
+
   if (is_niagara()) {
     // Indirect branch is the same cost as direct
     if (FLAG_IS_DEFAULT(UseInlineCaches)) {
@@ -107,12 +128,6 @@
     if (FLAG_IS_DEFAULT(OptoLoopAlignment)) {
       FLAG_SET_DEFAULT(OptoLoopAlignment, 4);
     }
-    // When using CMS or G1, we cannot use memset() in BOT updates
-    // because the sun4v/CMT version in libc_psr uses BIS which
-    // exposes "phantom zeros" to concurrent readers. See 6948537.
-    if (FLAG_IS_DEFAULT(UseMemSetInBOT) && (UseConcMarkSweepGC || UseG1GC)) {
-      FLAG_SET_DEFAULT(UseMemSetInBOT, false);
-    }
 #ifdef _LP64
     // 32-bit oops don't make sense for the 64-bit VM on sparc
     // since the 32-bit VM has the same registers and smaller objects.
--- a/src/cpu/sparc/vm/vm_version_sparc.hpp	Fri Aug 29 12:40:56 2014 -0400
+++ b/src/cpu/sparc/vm/vm_version_sparc.hpp	Thu Sep 04 09:04:21 2014 +0200
@@ -96,7 +96,13 @@
   static bool is_M_family(int features) { return (features & M_family_m) != 0; }
   static bool is_T_family(int features) { return (features & T_family_m) != 0; }
   static bool is_niagara() { return is_T_family(_features); }
-  DEBUG_ONLY( static bool is_niagara(int features)  { return (features & sun4v_m) != 0; } )
+#ifdef ASSERT
+  static bool is_niagara(int features)  {
+    // 'sun4v_m' may be defined on both Sun/Oracle Sparc CPUs as well as
+    // on Fujitsu Sparc64 CPUs, but only Sun/Oracle Sparcs can be 'niagaras'.
+    return (features & sun4v_m) != 0 && (features & sparc64_family_m) == 0;
+  }
+#endif
 
   // Returns true if it is niagara1 (T1).
   static bool is_T1_model(int features) { return is_T_family(features) && ((features & T1_model_m) != 0); }
--- a/src/share/vm/runtime/arguments.cpp	Fri Aug 29 12:40:56 2014 -0400
+++ b/src/share/vm/runtime/arguments.cpp	Thu Sep 04 09:04:21 2014 +0200
@@ -2084,19 +2084,6 @@
   status = status && verify_min_value(ValueMapInitialSize, 1, "ValueMapInitialSize");
 #endif
 
-#ifdef SPARC
-  if (UseConcMarkSweepGC || UseG1GC) {
-    // Issue a stern warning if the user has explicitly set
-    // UseMemSetInBOT (it is known to cause issues), but allow
-    // use for experimentation and debugging.
-    if (VM_Version::is_sun4v() && UseMemSetInBOT) {
-      assert(!FLAG_IS_DEFAULT(UseMemSetInBOT), "Error");
-      warning("Experimental flag -XX:+UseMemSetInBOT is known to cause instability"
-          " on sun4v; please understand that you are using at your own risk!");
-    }
-  }
-#endif // SPARC
-
   // check native memory tracking flags
   if (PrintNMTStatistics && MemTracker::tracking_level() == MemTracker::NMT_off) {
     warning("PrintNMTStatistics is disabled, because native memory tracking is not enabled");