7188227: VM should recognize M-series SPARC

Check kstat data for SPARC-M.

Reviewed-by: roland
This commit is contained in:
Vladimir Kozlov 2012-08-01 14:10:32 -07:00
parent 5e05a0d592
commit ebeff89a89
2 changed files with 19 additions and 6 deletions

View file

@ -44,10 +44,11 @@ protected:
fmaf_instructions = 10, fmaf_instructions = 10,
fmau_instructions = 11, fmau_instructions = 11,
vis3_instructions = 12, vis3_instructions = 12,
sparc64_family = 13, cbcond_instructions = 13,
T_family = 14, sparc64_family = 14,
T1_model = 15, M_family = 15,
cbcond_instructions = 16 T_family = 16,
T1_model = 17
}; };
enum Feature_Flag_Set { enum Feature_Flag_Set {
@ -67,10 +68,11 @@ protected:
fmaf_instructions_m = 1 << fmaf_instructions, fmaf_instructions_m = 1 << fmaf_instructions,
fmau_instructions_m = 1 << fmau_instructions, fmau_instructions_m = 1 << fmau_instructions,
vis3_instructions_m = 1 << vis3_instructions, vis3_instructions_m = 1 << vis3_instructions,
cbcond_instructions_m = 1 << cbcond_instructions,
sparc64_family_m = 1 << sparc64_family, sparc64_family_m = 1 << sparc64_family,
M_family_m = 1 << M_family,
T_family_m = 1 << T_family, T_family_m = 1 << T_family,
T1_model_m = 1 << T1_model, 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_v8_m = v8_instructions_m | hardware_mul32_m | hardware_div32_m | hardware_fsmuld_m,
generic_v9_m = generic_v8_m | v9_instructions_m, generic_v9_m = generic_v8_m | v9_instructions_m,
@ -89,6 +91,7 @@ protected:
static int platform_features(int features); static int platform_features(int features);
// Returns true if the platform is in the niagara line (T series) // 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_T_family(int features) { return (features & T_family_m) != 0; }
static bool is_niagara() { return is_T_family(_features); } static bool is_niagara() { return is_T_family(_features); }
DEBUG_ONLY( static bool is_niagara(int features) { return (features & sun4v_m) != 0; } ) DEBUG_ONLY( static bool is_niagara(int features) { return (features & sun4v_m) != 0; } )

View file

@ -201,13 +201,23 @@ int VM_Version::platform_features(int features) {
impl[i] = (char)toupper((uint)impl[i]); impl[i] = (char)toupper((uint)impl[i]);
if (strstr(impl, "SPARC64") != NULL) { if (strstr(impl, "SPARC64") != NULL) {
features |= sparc64_family_m; 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) { } else if (strstr(impl, "SPARC-T") != NULL) {
features |= T_family_m; features |= T_family_m;
if (strstr(impl, "SPARC-T1") != NULL) { if (strstr(impl, "SPARC-T1") != NULL) {
features |= T1_model_m; features |= T1_model_m;
} }
} else { } 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); free((void*)impl);
break; break;