changeset 3537:8cb110fd7627

7188227: VM should recognize M-series SPARC Summary: Check kstat data for SPARC-M. Reviewed-by: roland
author kvn
date Wed, 01 Aug 2012 14:10:32 -0700
parents 6c5b7a6becc8
children b72784e722ff
files src/cpu/sparc/vm/vm_version_sparc.hpp src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp
diffstat 2 files changed, 19 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/sparc/vm/vm_version_sparc.hpp	Mon Jul 30 09:49:25 2012 -0700
+++ b/src/cpu/sparc/vm/vm_version_sparc.hpp	Wed Aug 01 14:10:32 2012 -0700
@@ -44,10 +44,11 @@
     fmaf_instructions    = 10,
     fmau_instructions    = 11,
     vis3_instructions    = 12,
-    sparc64_family       = 13,
-    T_family             = 14,
-    T1_model             = 15,
-    cbcond_instructions  = 16
+    cbcond_instructions  = 13,
+    sparc64_family       = 14,
+    M_family             = 15,
+    T_family             = 16,
+    T1_model             = 17
   };
 
   enum Feature_Flag_Set {
@@ -67,10 +68,11 @@
     fmaf_instructions_m     = 1 << fmaf_instructions,
     fmau_instructions_m     = 1 << fmau_instructions,
     vis3_instructions_m     = 1 << vis3_instructions,
+    cbcond_instructions_m   = 1 << cbcond_instructions,
     sparc64_family_m        = 1 << sparc64_family,
+    M_family_m              = 1 << M_family,
     T_family_m              = 1 << T_family,
     T1_model_m              = 1 << T1_model,
-    cbcond_instructions_m   = 1 << cbcond_instructions,
 
     generic_v8_m        = v8_instructions_m | hardware_mul32_m | hardware_div32_m | hardware_fsmuld_m,
     generic_v9_m        = generic_v8_m | v9_instructions_m,
@@ -89,6 +91,7 @@
   static int  platform_features(int features);
 
   // Returns true if the platform is in the niagara line (T series)
+  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; } )
--- a/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp	Mon Jul 30 09:49:25 2012 -0700
+++ b/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp	Wed Aug 01 14:10:32 2012 -0700
@@ -201,13 +201,23 @@
               impl[i] = (char)toupper((uint)impl[i]);
             if (strstr(impl, "SPARC64") != NULL) {
               features |= sparc64_family_m;
+            } else if (strstr(impl, "SPARC-M") != NULL) {
+              // M-series SPARC is based on T-series.
+              features |= (M_family_m | T_family_m);
             } else if (strstr(impl, "SPARC-T") != NULL) {
               features |= T_family_m;
               if (strstr(impl, "SPARC-T1") != NULL) {
                 features |= T1_model_m;
               }
             } else {
-              assert(strstr(impl, "SPARC") != NULL, "should be sparc");
+              if (strstr(impl, "SPARC") == NULL) {
+#ifndef PRODUCT
+                // kstat on Solaris 8 virtual machines (branded zones)
+                // returns "(unsupported)" implementation.
+                warning("kstat cpu_info implementation = '%s', should contain SPARC", impl);
+#endif
+                implementation = "SPARC";
+              }
             }
             free((void*)impl);
             break;