< prev index next >

src/cpu/s390/vm/vm_version_s390.cpp

Print this page
rev 12273 : 8169317: [s390] Various minor bug fixes and adaptions.


 254   if (is_z9()) {
 255     _features_string = "System z G3-z9   (LDISP_fast, ExtImm), out-of-support as of 2016-04-01";
 256     ambiguity++;
 257   }
 258   if (is_z990()) {
 259     _features_string = "System z G2-z990 (LDISP_fast), out-of-support as of 2014-07-01";
 260     ambiguity++;
 261   }
 262   if (is_z900()) {
 263     _features_string = "System z G1-z900 (LDISP), out-of-support as of 2014-07-01";
 264     ambiguity++;
 265   }
 266 
 267   if (ambiguity == 0) {
 268     _features_string = "z/Architecture (unknown generation)";
 269   } else if (ambiguity > 1) {
 270     tty->print_cr("*** WARNING *** Ambiguous z/Architecture detection, ambiguity = %d", ambiguity);
 271     tty->print_cr("                oldest detected generation is %s", _features_string);
 272     _features_string = "z/Architecture (ambiguous detection)";
 273   }

























 274 }
 275 
 276 // featureBuffer - bit array indicating availability of various features
 277 // featureNum    - bit index of feature to be tested
 278 //                 Featurenum < 0 requests test for any nonzero bit in featureBuffer.
 279 // bufLen        - length of featureBuffer in bits
 280 bool VM_Version::test_feature_bit(unsigned long* featureBuffer, int featureNum, unsigned int bufLen) {
 281   assert(bufLen > 0,             "buffer len must be positive");
 282   assert((bufLen & 0x0007) == 0, "unaligned buffer len");
 283   assert(((intptr_t)featureBuffer&0x0007) == 0, "unaligned feature buffer");
 284   if (featureNum < 0) {
 285     // Any bit set at all?
 286     bool anyBit = false;
 287     for (size_t i = 0; i < bufLen/(8*sizeof(long)); i++) {
 288       anyBit = anyBit || (featureBuffer[i] != 0);
 289     }
 290     return anyBit;
 291   } else {
 292     assert((unsigned int)featureNum < bufLen,    "feature index out of range");
 293     unsigned char* byteBuffer = (unsigned char*)featureBuffer;


 352     if (has_MiscInstrExt()             ) tty->print_cr("available: %s", "Miscelaneous Instruction Extensions");
 353     if (has_ExecutionHint()            ) tty->print_cr("  available: %s", "Execution Hints (branch prediction)");
 354     if (has_ProcessorAssist()          ) tty->print_cr("  available: %s", "Processor Assists");
 355     if (has_LoadAndTrap()              ) tty->print_cr("  available: %s", "Load and Trap");
 356     if (has_TxMem()                    ) tty->print_cr("available: %s", "Transactional Memory");
 357     if (has_InterlockedAccessV2()      ) tty->print_cr("  available: %s", "InterlockedAccess V2 (fast)");
 358     if (has_DFPZonedConversion()       ) tty->print_cr("  available: %s", "DFP Zoned Conversions");
 359     // z13
 360     if (has_LoadStoreConditional2()    ) tty->print_cr("available: %s", "Load/Store Conditional 2");
 361     if (has_CryptoExt5()               ) tty->print_cr("available: %s", "Crypto Extensions 5");
 362     if (has_DFPPackedConversion()      ) tty->print_cr("available: %s", "DFP Packed Conversions");
 363     if (has_VectorFacility()           ) tty->print_cr("available: %s", "Vector Facility");
 364     // test switches
 365     if (has_TestFeature1Impl()         ) tty->print_cr("available: %s", "TestFeature1Impl");
 366     if (has_TestFeature2Impl()         ) tty->print_cr("available: %s", "TestFeature2Impl");
 367     if (has_TestFeature4Impl()         ) tty->print_cr("available: %s", "TestFeature4Impl");
 368     if (has_TestFeature8Impl()         ) tty->print_cr("available: %s", "TestFeature8Impl");
 369 
 370     if (has_Crypto()) {
 371       tty->cr();
 372       tty->print_cr("detailled availability of %s capabilities:", "CryptoFacility");
 373       if (test_feature_bit(&_cipher_features[0], -1, 2*Cipher::_featureBits)) {
 374         tty->cr();
 375         tty->print_cr("  available: %s", "Message Cipher Functions");
 376       }
 377       if (test_feature_bit(&_cipher_features[0], -1, (int)Cipher::_featureBits)) {
 378         tty->print_cr("    available Crypto Features of KM  (Cipher Message):");
 379         for (unsigned int i = 0; i < Cipher::_featureBits; i++) {
 380           if (test_feature_bit(&_cipher_features[0], i, (int)Cipher::_featureBits)) {
 381             switch (i) {
 382               case Cipher::_Query:              tty->print_cr("      available: KM   Query");                  break;
 383               case Cipher::_DEA:                tty->print_cr("      available: KM   DEA");                    break;
 384               case Cipher::_TDEA128:            tty->print_cr("      available: KM   TDEA-128");               break;
 385               case Cipher::_TDEA192:            tty->print_cr("      available: KM   TDEA-192");               break;
 386               case Cipher::_EncryptedDEA:       tty->print_cr("      available: KM   Encrypted DEA");          break;
 387               case Cipher::_EncryptedDEA128:    tty->print_cr("      available: KM   Encrypted DEA-128");      break;
 388               case Cipher::_EncryptedDEA192:    tty->print_cr("      available: KM   Encrypted DEA-192");      break;
 389               case Cipher::_AES128:             tty->print_cr("      available: KM   AES-128");                break;
 390               case Cipher::_AES192:             tty->print_cr("      available: KM   AES-192");                break;
 391               case Cipher::_AES256:             tty->print_cr("      available: KM   AES-256");                break;
 392               case Cipher::_EnccryptedAES128:   tty->print_cr("      available: KM   Encrypted-AES-128");      break;


 461       }
 462     }
 463     if (ContendedPaddingWidth > 0) {
 464       tty->cr();
 465       tty->print_cr("ContendedPaddingWidth " INTX_FORMAT, ContendedPaddingWidth);
 466     }
 467   }
 468 }
 469 
 470 void VM_Version::print_features() {
 471   print_features_internal("Version:");
 472 }
 473 
 474 void VM_Version::reset_features(bool reset) {
 475   if (reset) {
 476     for (unsigned int i = 0; i < _features_buffer_len; i++) {
 477       VM_Version::_features[i] = 0;
 478     }
 479   }
 480 }
 481 
 482 
 483 void VM_Version::set_features_z900(bool reset) {
 484   reset_features(reset);
 485 
 486   set_has_long_displacement();
 487   set_has_ETF2();
 488 }
 489 
 490 void VM_Version::set_features_z990(bool reset) {
 491   reset_features(reset);
 492 
 493   set_features_z900(false);
 494   set_has_ETF3();
 495   set_has_long_displacement_fast();
 496   set_has_HFPMultiplyAndAdd();
 497 }
 498 
 499 void VM_Version::set_features_z9(bool reset) {
 500   reset_features(reset);
 501 




 254   if (is_z9()) {
 255     _features_string = "System z G3-z9   (LDISP_fast, ExtImm), out-of-support as of 2016-04-01";
 256     ambiguity++;
 257   }
 258   if (is_z990()) {
 259     _features_string = "System z G2-z990 (LDISP_fast), out-of-support as of 2014-07-01";
 260     ambiguity++;
 261   }
 262   if (is_z900()) {
 263     _features_string = "System z G1-z900 (LDISP), out-of-support as of 2014-07-01";
 264     ambiguity++;
 265   }
 266 
 267   if (ambiguity == 0) {
 268     _features_string = "z/Architecture (unknown generation)";
 269   } else if (ambiguity > 1) {
 270     tty->print_cr("*** WARNING *** Ambiguous z/Architecture detection, ambiguity = %d", ambiguity);
 271     tty->print_cr("                oldest detected generation is %s", _features_string);
 272     _features_string = "z/Architecture (ambiguous detection)";
 273   }
 274 
 275   if (has_Crypto_AES()) {
 276     char buf[256];
 277     assert(strlen(_features_string) + 4 + 3*4 + 1 < sizeof(buf), "increase buffer size");
 278     jio_snprintf(buf, sizeof(buf), "%s aes%s%s%s", // String 'aes' must be surrounded by spaces so that jtreg tests recognize it.
 279                  _features_string,
 280                  has_Crypto_AES128() ? " 128" : "",
 281                  has_Crypto_AES192() ? " 192" : "",
 282                  has_Crypto_AES256() ? " 256" : "");
 283     _features_string = os::strdup(buf);
 284   }
 285 
 286   if (has_Crypto_SHA()) {
 287     char buf[256];
 288     assert(strlen(_features_string) + 4 + 2 + 2*4 + 6 + 1 < sizeof(buf), "increase buffer size");
 289     // String 'sha1' etc must be surrounded by spaces so that jtreg tests recognize it.
 290     jio_snprintf(buf, sizeof(buf), "%s %s%s%s%s",
 291                  _features_string,
 292                  has_Crypto_SHA1()   ? " sha1"   : "",
 293                  has_Crypto_SHA256() ? " sha256" : "",
 294                  has_Crypto_SHA512() ? " sha512" : "",
 295                  has_Crypto_GHASH()  ? " ghash"  : "");
 296     if (has_Crypto_AES()) { os::free((void *)_features_string); }
 297     _features_string = os::strdup(buf);
 298   }
 299 }
 300 
 301 // featureBuffer - bit array indicating availability of various features
 302 // featureNum    - bit index of feature to be tested
 303 //                 Featurenum < 0 requests test for any nonzero bit in featureBuffer.
 304 // bufLen        - length of featureBuffer in bits
 305 bool VM_Version::test_feature_bit(unsigned long* featureBuffer, int featureNum, unsigned int bufLen) {
 306   assert(bufLen > 0,             "buffer len must be positive");
 307   assert((bufLen & 0x0007) == 0, "unaligned buffer len");
 308   assert(((intptr_t)featureBuffer&0x0007) == 0, "unaligned feature buffer");
 309   if (featureNum < 0) {
 310     // Any bit set at all?
 311     bool anyBit = false;
 312     for (size_t i = 0; i < bufLen/(8*sizeof(long)); i++) {
 313       anyBit = anyBit || (featureBuffer[i] != 0);
 314     }
 315     return anyBit;
 316   } else {
 317     assert((unsigned int)featureNum < bufLen,    "feature index out of range");
 318     unsigned char* byteBuffer = (unsigned char*)featureBuffer;


 377     if (has_MiscInstrExt()             ) tty->print_cr("available: %s", "Miscelaneous Instruction Extensions");
 378     if (has_ExecutionHint()            ) tty->print_cr("  available: %s", "Execution Hints (branch prediction)");
 379     if (has_ProcessorAssist()          ) tty->print_cr("  available: %s", "Processor Assists");
 380     if (has_LoadAndTrap()              ) tty->print_cr("  available: %s", "Load and Trap");
 381     if (has_TxMem()                    ) tty->print_cr("available: %s", "Transactional Memory");
 382     if (has_InterlockedAccessV2()      ) tty->print_cr("  available: %s", "InterlockedAccess V2 (fast)");
 383     if (has_DFPZonedConversion()       ) tty->print_cr("  available: %s", "DFP Zoned Conversions");
 384     // z13
 385     if (has_LoadStoreConditional2()    ) tty->print_cr("available: %s", "Load/Store Conditional 2");
 386     if (has_CryptoExt5()               ) tty->print_cr("available: %s", "Crypto Extensions 5");
 387     if (has_DFPPackedConversion()      ) tty->print_cr("available: %s", "DFP Packed Conversions");
 388     if (has_VectorFacility()           ) tty->print_cr("available: %s", "Vector Facility");
 389     // test switches
 390     if (has_TestFeature1Impl()         ) tty->print_cr("available: %s", "TestFeature1Impl");
 391     if (has_TestFeature2Impl()         ) tty->print_cr("available: %s", "TestFeature2Impl");
 392     if (has_TestFeature4Impl()         ) tty->print_cr("available: %s", "TestFeature4Impl");
 393     if (has_TestFeature8Impl()         ) tty->print_cr("available: %s", "TestFeature8Impl");
 394 
 395     if (has_Crypto()) {
 396       tty->cr();
 397       tty->print_cr("detailed availability of %s capabilities:", "CryptoFacility");
 398       if (test_feature_bit(&_cipher_features[0], -1, 2*Cipher::_featureBits)) {
 399         tty->cr();
 400         tty->print_cr("  available: %s", "Message Cipher Functions");
 401       }
 402       if (test_feature_bit(&_cipher_features[0], -1, (int)Cipher::_featureBits)) {
 403         tty->print_cr("    available Crypto Features of KM  (Cipher Message):");
 404         for (unsigned int i = 0; i < Cipher::_featureBits; i++) {
 405           if (test_feature_bit(&_cipher_features[0], i, (int)Cipher::_featureBits)) {
 406             switch (i) {
 407               case Cipher::_Query:              tty->print_cr("      available: KM   Query");                  break;
 408               case Cipher::_DEA:                tty->print_cr("      available: KM   DEA");                    break;
 409               case Cipher::_TDEA128:            tty->print_cr("      available: KM   TDEA-128");               break;
 410               case Cipher::_TDEA192:            tty->print_cr("      available: KM   TDEA-192");               break;
 411               case Cipher::_EncryptedDEA:       tty->print_cr("      available: KM   Encrypted DEA");          break;
 412               case Cipher::_EncryptedDEA128:    tty->print_cr("      available: KM   Encrypted DEA-128");      break;
 413               case Cipher::_EncryptedDEA192:    tty->print_cr("      available: KM   Encrypted DEA-192");      break;
 414               case Cipher::_AES128:             tty->print_cr("      available: KM   AES-128");                break;
 415               case Cipher::_AES192:             tty->print_cr("      available: KM   AES-192");                break;
 416               case Cipher::_AES256:             tty->print_cr("      available: KM   AES-256");                break;
 417               case Cipher::_EnccryptedAES128:   tty->print_cr("      available: KM   Encrypted-AES-128");      break;


 486       }
 487     }
 488     if (ContendedPaddingWidth > 0) {
 489       tty->cr();
 490       tty->print_cr("ContendedPaddingWidth " INTX_FORMAT, ContendedPaddingWidth);
 491     }
 492   }
 493 }
 494 
 495 void VM_Version::print_features() {
 496   print_features_internal("Version:");
 497 }
 498 
 499 void VM_Version::reset_features(bool reset) {
 500   if (reset) {
 501     for (unsigned int i = 0; i < _features_buffer_len; i++) {
 502       VM_Version::_features[i] = 0;
 503     }
 504   }
 505 }

 506 
 507 void VM_Version::set_features_z900(bool reset) {
 508   reset_features(reset);
 509 
 510   set_has_long_displacement();
 511   set_has_ETF2();
 512 }
 513 
 514 void VM_Version::set_features_z990(bool reset) {
 515   reset_features(reset);
 516 
 517   set_features_z900(false);
 518   set_has_ETF3();
 519   set_has_long_displacement_fast();
 520   set_has_HFPMultiplyAndAdd();
 521 }
 522 
 523 void VM_Version::set_features_z9(bool reset) {
 524   reset_features(reset);
 525 


< prev index next >