Wed, 01 Aug 2012 14:10:32 -0700
7188227: VM should recognize M-series SPARC
Summary: Check kstat data for SPARC-M.
Reviewed-by: roland
src/cpu/sparc/vm/vm_version_sparc.hpp | file | annotate | diff | comparison | revisions | |
src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/cpu/sparc/vm/vm_version_sparc.hpp Mon Jul 30 09:49:25 2012 -0700 1.2 +++ b/src/cpu/sparc/vm/vm_version_sparc.hpp Wed Aug 01 14:10:32 2012 -0700 1.3 @@ -44,10 +44,11 @@ 1.4 fmaf_instructions = 10, 1.5 fmau_instructions = 11, 1.6 vis3_instructions = 12, 1.7 - sparc64_family = 13, 1.8 - T_family = 14, 1.9 - T1_model = 15, 1.10 - cbcond_instructions = 16 1.11 + cbcond_instructions = 13, 1.12 + sparc64_family = 14, 1.13 + M_family = 15, 1.14 + T_family = 16, 1.15 + T1_model = 17 1.16 }; 1.17 1.18 enum Feature_Flag_Set { 1.19 @@ -67,10 +68,11 @@ 1.20 fmaf_instructions_m = 1 << fmaf_instructions, 1.21 fmau_instructions_m = 1 << fmau_instructions, 1.22 vis3_instructions_m = 1 << vis3_instructions, 1.23 + cbcond_instructions_m = 1 << cbcond_instructions, 1.24 sparc64_family_m = 1 << sparc64_family, 1.25 + M_family_m = 1 << M_family, 1.26 T_family_m = 1 << T_family, 1.27 T1_model_m = 1 << T1_model, 1.28 - cbcond_instructions_m = 1 << cbcond_instructions, 1.29 1.30 generic_v8_m = v8_instructions_m | hardware_mul32_m | hardware_div32_m | hardware_fsmuld_m, 1.31 generic_v9_m = generic_v8_m | v9_instructions_m, 1.32 @@ -89,6 +91,7 @@ 1.33 static int platform_features(int features); 1.34 1.35 // Returns true if the platform is in the niagara line (T series) 1.36 + static bool is_M_family(int features) { return (features & M_family_m) != 0; } 1.37 static bool is_T_family(int features) { return (features & T_family_m) != 0; } 1.38 static bool is_niagara() { return is_T_family(_features); } 1.39 DEBUG_ONLY( static bool is_niagara(int features) { return (features & sun4v_m) != 0; } )
2.1 --- a/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp Mon Jul 30 09:49:25 2012 -0700 2.2 +++ b/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp Wed Aug 01 14:10:32 2012 -0700 2.3 @@ -201,13 +201,23 @@ 2.4 impl[i] = (char)toupper((uint)impl[i]); 2.5 if (strstr(impl, "SPARC64") != NULL) { 2.6 features |= sparc64_family_m; 2.7 + } else if (strstr(impl, "SPARC-M") != NULL) { 2.8 + // M-series SPARC is based on T-series. 2.9 + features |= (M_family_m | T_family_m); 2.10 } else if (strstr(impl, "SPARC-T") != NULL) { 2.11 features |= T_family_m; 2.12 if (strstr(impl, "SPARC-T1") != NULL) { 2.13 features |= T1_model_m; 2.14 } 2.15 } else { 2.16 - assert(strstr(impl, "SPARC") != NULL, "should be sparc"); 2.17 + if (strstr(impl, "SPARC") == NULL) { 2.18 +#ifndef PRODUCT 2.19 + // kstat on Solaris 8 virtual machines (branded zones) 2.20 + // returns "(unsupported)" implementation. 2.21 + warning("kstat cpu_info implementation = '%s', should contain SPARC", impl); 2.22 +#endif 2.23 + implementation = "SPARC"; 2.24 + } 2.25 } 2.26 free((void*)impl); 2.27 break;