< prev index next >

src/hotspot/cpu/s390/vm_version_s390.cpp

Print this page




 499         for (unsigned int i = 0; i < MsgDigest::_featureBits; i++) {
 500           if (test_feature_bit(&_msgdigest_features[2], i, (int)MsgDigest::_featureBits)) {
 501             switch (i) {
 502               case MsgDigest::_Query:  tty->print_cr("      available: KLMD Query");   break;
 503               case MsgDigest::_SHA1:   tty->print_cr("      available: KLMD SHA-1");   break;
 504               case MsgDigest::_SHA256: tty->print_cr("      available: KLMD SHA-256"); break;
 505               case MsgDigest::_SHA512: tty->print_cr("      available: KLMD SHA-512"); break;
 506               default: tty->print_cr("      available: unknown code %d", i);  break;
 507             }
 508           }
 509         }
 510       }
 511     }
 512     if (ContendedPaddingWidth > 0) {
 513       tty->cr();
 514       tty->print_cr("ContendedPaddingWidth " INTX_FORMAT, ContendedPaddingWidth);
 515     }
 516   }
 517 }
 518 
 519 void VM_Version::print_platform_virtualization_info(outputStream* st) {
 520   // /proc/sysinfo contains interesting information about
 521   // - LPAR
 522   // - whole "Box" (CPUs )
 523   // - z/VM / KVM (VM<nn>); this is not available in an LPAR-only setup
 524   const char* kw[] = { "LPAR", "CPUs", "VM", NULL };
 525   const char* info_file = "/proc/sysinfo";
 526 
 527   if (!print_matching_lines_from_file(info_file, st, kw)) {
 528     st->print_cr("  <%s Not Available>", info_file);
 529   }
 530 }
 531 
 532 void VM_Version::print_features() {
 533   print_features_internal("Version:");
 534 }
 535 
 536 void VM_Version::reset_features(bool reset) {
 537   if (reset) {
 538     for (unsigned int i = 0; i < _features_buffer_len; i++) {
 539       VM_Version::_features[i] = 0;
 540     }
 541   }
 542 }
 543 
 544 void VM_Version::set_features_z900(bool reset) {
 545   reset_features(reset);
 546 
 547   set_has_long_displacement();
 548   set_has_ETF2();
 549 }
 550 
 551 void VM_Version::set_features_z990(bool reset) {


 787   a->z_km(Z_R2,Z_R2);                        // get available KM functions
 788   a->z_la(Z_R1,16,Z_R1);                     // next param block addr
 789   a->z_kmc(Z_R2,Z_R2);                       // get available KMC functions
 790   a->z_lghi(Z_RET,4);
 791   a->z_br(Z_R14);
 792 
 793   // Use EXTRACT CPU ATTRIBUTE instruction to get information about cache layout.
 794   a->bind(getCPUFEATURES);
 795   a->z_xgr(Z_R0,Z_R0);                       // as recommended in instruction documentation
 796   a->z_ecag(Z_RET,Z_R0,0,Z_ARG3);            // Extract information as requested by Z_ARG1 contents.
 797   a->z_br(Z_R14);
 798 
 799   // Use a vector instruction to verify OS support. Will fail with SIGFPE if OS support is missing.
 800   a->bind(getVECTORFEATURES);
 801   a->z_vtm(Z_V0,Z_V0);                       // non-destructive vector instruction. Will cause SIGFPE if not supported.
 802   a->z_br(Z_R14);
 803 
 804   address code_end = a->pc();
 805   a->flush();
 806 
 807   cbuf.insts()->set_end(code_end);
 808 
 809   // Print the detection code.
 810   bool printVerbose = Verbose || PrintAssembly || PrintStubCode;
 811   if (printVerbose) {
 812     ttyLocker ttyl;
 813     tty->print_cr("Decoding CPU feature detection stub at " INTPTR_FORMAT " before execution:", p2i(code));
 814     tty->print_cr("Stub length is %ld bytes, codebuffer reserves %d bytes, %ld bytes spare.",
 815                   code_end-code, cbuf_size, cbuf_size-(code_end-code));
 816 
 817     // Use existing decode function. This enables the [MachCode] format which is needed to DecodeErrorFile.
 818     Disassembler::decode(&cbuf, code, code_end, tty);
 819   }
 820 
 821   // Prepare for detection code execution and clear work buffer.
 822   _nfeatures        = 0;
 823   _ncipher_features = 0;
 824   unsigned long  buffer[buf_len];
 825 
 826   for (int i = 0; i < buf_len; i++) {
 827     buffer[i] = 0L;
 828   }
 829 
 830   // execute code
 831   // Illegal instructions will be replaced by 0 in signal handler.
 832   // In case of problems, call_getFeatures will return a not-positive result.
 833   long used_len = call_getFeatures(buffer, buf_len, 0);
 834 
 835   bool ok;
 836   if (used_len == 1) {
 837     ok = true;
 838   } else if (used_len > 1) {




 499         for (unsigned int i = 0; i < MsgDigest::_featureBits; i++) {
 500           if (test_feature_bit(&_msgdigest_features[2], i, (int)MsgDigest::_featureBits)) {
 501             switch (i) {
 502               case MsgDigest::_Query:  tty->print_cr("      available: KLMD Query");   break;
 503               case MsgDigest::_SHA1:   tty->print_cr("      available: KLMD SHA-1");   break;
 504               case MsgDigest::_SHA256: tty->print_cr("      available: KLMD SHA-256"); break;
 505               case MsgDigest::_SHA512: tty->print_cr("      available: KLMD SHA-512"); break;
 506               default: tty->print_cr("      available: unknown code %d", i);  break;
 507             }
 508           }
 509         }
 510       }
 511     }
 512     if (ContendedPaddingWidth > 0) {
 513       tty->cr();
 514       tty->print_cr("ContendedPaddingWidth " INTX_FORMAT, ContendedPaddingWidth);
 515     }
 516   }
 517 }
 518 













 519 void VM_Version::print_features() {
 520   print_features_internal("Version:");
 521 }
 522 
 523 void VM_Version::reset_features(bool reset) {
 524   if (reset) {
 525     for (unsigned int i = 0; i < _features_buffer_len; i++) {
 526       VM_Version::_features[i] = 0;
 527     }
 528   }
 529 }
 530 
 531 void VM_Version::set_features_z900(bool reset) {
 532   reset_features(reset);
 533 
 534   set_has_long_displacement();
 535   set_has_ETF2();
 536 }
 537 
 538 void VM_Version::set_features_z990(bool reset) {


 774   a->z_km(Z_R2,Z_R2);                        // get available KM functions
 775   a->z_la(Z_R1,16,Z_R1);                     // next param block addr
 776   a->z_kmc(Z_R2,Z_R2);                       // get available KMC functions
 777   a->z_lghi(Z_RET,4);
 778   a->z_br(Z_R14);
 779 
 780   // Use EXTRACT CPU ATTRIBUTE instruction to get information about cache layout.
 781   a->bind(getCPUFEATURES);
 782   a->z_xgr(Z_R0,Z_R0);                       // as recommended in instruction documentation
 783   a->z_ecag(Z_RET,Z_R0,0,Z_ARG3);            // Extract information as requested by Z_ARG1 contents.
 784   a->z_br(Z_R14);
 785 
 786   // Use a vector instruction to verify OS support. Will fail with SIGFPE if OS support is missing.
 787   a->bind(getVECTORFEATURES);
 788   a->z_vtm(Z_V0,Z_V0);                       // non-destructive vector instruction. Will cause SIGFPE if not supported.
 789   a->z_br(Z_R14);
 790 
 791   address code_end = a->pc();
 792   a->flush();
 793 


 794   // Print the detection code.
 795   bool printVerbose = Verbose || PrintAssembly || PrintStubCode;
 796   if (printVerbose) {
 797     ttyLocker ttyl;
 798     tty->print_cr("Decoding CPU feature detection stub at " INTPTR_FORMAT " before execution:", p2i(code));
 799     tty->print_cr("Stub length is %ld bytes, codebuffer reserves %d bytes, %ld bytes spare.",
 800                   code_end-code, cbuf_size, cbuf_size-(code_end-code));
 801 
 802     // Use existing decode function. This enables the [Code] format which is needed to DecodeErrorFile.
 803     Disassembler::decode((u_char*)code, (u_char*)code_end, tty);
 804   }
 805 
 806   // Prepare for detection code execution and clear work buffer.
 807   _nfeatures        = 0;
 808   _ncipher_features = 0;
 809   unsigned long  buffer[buf_len];
 810 
 811   for (int i = 0; i < buf_len; i++) {
 812     buffer[i] = 0L;
 813   }
 814 
 815   // execute code
 816   // Illegal instructions will be replaced by 0 in signal handler.
 817   // In case of problems, call_getFeatures will return a not-positive result.
 818   long used_len = call_getFeatures(buffer, buf_len, 0);
 819 
 820   bool ok;
 821   if (used_len == 1) {
 822     ok = true;
 823   } else if (used_len > 1) {


< prev index next >