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

x86: frequency extraction from cpu brand string is incomplete

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 16
    • 11, 12, 13, 14, 15, 16
    • hotspot
    • b22
    • x86
    • generic

      VM_Version_Ext::max_qualified_cpu_freq_from_brand_string() attempts to extract and return the CPU frequency, by inspecting the CPU brand string (as per the document "Intel® Processor Identification and the CPUID Instruction. Application note 845 May 2012").

      There is a bug with the current implementation, because it is naive in using the following construct:

      const char* Hz_location = strchr(brand_string, 'H');

      This likely works for most CPU models / brands, but not when the brand string is of the following form (for example):

      "Intel(R) Core(TM) i7-9850H CPU @ 2.60GHz"

      The 'H' in "9850H" will be matched, but since there is no 'z' in the next position, the code will fall through and report a frequency of 0.

            mgronlun Markus Grönlund
            mgronlun Markus Grönlund
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: