Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8186579

VM_Version::platform_features() needs update on linux-sparc

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 10
    • Fix Version/s: 10
    • Component/s: hotspot
    • Labels:
      None

      Description

      Trying to build the standard server variant on linux-sparc currently fails with:

      === Output from failing command(s) repeated here ===
      /usr/bin/printf "* For target hotspot_variant-server_libjvm_objs_vm_version_linux_sparc.o:\n"
      * For target hotspot_variant-server_libjvm_objs_vm_version_linux_sparc.o:
      (/bin/grep -v -e "^Note: including file:" < /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-server-release/make-support/failure-logs/hotspot_variant-server_libjvm_objs_vm_version_linux_sparc.o.log || true) | /usr/bin/head -n 12
      /home/glaubitz/openjdk/hs/hotspot/src/os_cpu/linux_sparc/vm/vm_version_linux_sparc.cpp:65:5: error: prototype for ‘int VM_Version::platform_features(int)’ does not match any in class ‘VM_Version’
       int VM_Version::platform_features(int features) {
           ^~~~~~~~~~
      In file included from /home/glaubitz/openjdk/hs/hotspot/src/os_cpu/linux_sparc/vm/vm_version_linux_sparc.cpp:28:0:
      /home/glaubitz/openjdk/hs/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp:196:15: error: candidate is: static void VM_Version::platform_features()
         static void platform_features();
                     ^~~~~~~~~~~~~~~~~
      /home/glaubitz/openjdk/hs/hotspot/src/os_cpu/linux_sparc/vm/vm_version_linux_sparc.cpp:61:13: warning: ‘bool detect_blkinit()’ defined but not used [-Wunused-function]
       static bool detect_blkinit() {
                   ^~~~~~~~~~~~~~
      /home/glaubitz/openjdk/hs/hotspot/src/os_cpu/linux_sparc/vm/vm_version_linux_sparc.cpp:57:13: warning: ‘bool detect_M_family()’ defined but not used [-Wunused-function]
       static bool detect_M_family() {
      if test `/usr/bin/wc -l < /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-server-release/make-support/failure-logs/hotspot_variant-server_libjvm_objs_vm_version_linux_sparc.o.log` -gt 12; then /bin/echo " ... (rest of output omitted)" ; fi
         ... (rest of output omitted)
      /usr/bin/printf "\n* All command lines available in /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-server-release/make-support/failure-logs.\n"

      * All command lines available in /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-server-release/make-support/failure-logs.
      /usr/bin/printf "=== End of repeated output ===\n"
      === End of repeated output ===

      This happens because VM_Version::platform_features() recently changed its signature from "int platform_features(int)" to "void platform_features()" on solaris-sparc. And since the signature has to match on both solaris-sparc and linux-sparc, the function needs to be updated for linux-sparc.

      A minimalist fix for this issue is very simple:

      diff -r eed8aa5e12df src/os_cpu/linux_sparc/vm/vm_version_linux_sparc.cpp
      --- a/src/os_cpu/linux_sparc/vm/vm_version_linux_sparc.cpp Tue Aug 22 08:37:17 2017 -0400
      +++ b/src/os_cpu/linux_sparc/vm/vm_version_linux_sparc.cpp Tue Aug 22 18:28:10 2017 +0300
      @@ -62,23 +62,8 @@
         return cpuinfo_field_contains("cpucaps", "blkinit");
       }
       
      -int VM_Version::platform_features(int features) {
      - // Default to generic v9
      - features = generic_v9_m;
      -
      - if (detect_niagara()) {
      - log_info(os, cpu)("Detected Linux on Niagara");
      - features = niagara1_m | T_family_m;
      - }
      +void VM_Version::platform_features() {
      + uint64_t features = ISA_v9_msk; // Basic SPARC-V9 required (V8 not supported).
       
      - if (detect_M_family()) {
      - log_info(os, cpu)("Detected Linux on M family");
      - features = sun4v_m | generic_v9_m | M_family_m | T_family_m;
      - }
      -
      - if (detect_blkinit()) {
      - features |= blk_init_instructions_m;
      - }
      -
      - return features;
      + _features = features;
       }

      However, this way, platform_features() will just always report the machine to be sparcv9 without being able to report additional, individual CPU features.

      I am currently working on a patch which will also report additional CPU features so platform_features() on linux-sparc will have similar functionality as on solaris-sparc.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              glaubitz John Paul Adrian Glaubitz
              Reporter:
              glaubitz John Paul Adrian Glaubitz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: