Uploaded image for project: 'Funtoo Linux'
  1. Funtoo Linux
  2. FL-11324

gcc haswell profile enables hle instruction set (-mhle) but haswell no longer supports hle

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • Hide
      gcc -march=haswell -Q --help=target

      look for -mhle [enabled] in the list of cflags
      Show
      gcc -march=haswell -Q --help=target look for -mhle [enabled] in the list of cflags

      I've written a python script to determine the most appropriate stage3 for the CPU the script is run on. During testing, the script has flagged up that the haswell, broadwell and skylake stage3s all require the HLE instruction set (tested CPU was tiger lake, which does NOT support this), however an already working skylake stage3 install on the CPU caused me to investigate the discrepancy.

      My research has indicated that in 2014, Intel chose to disable HLE via microcode update for the entire generation, due to an errata. Some early broadwells also suffer the same errata and also had HLE disabled. Therefore, although the profile for haswell enables HLE instructions, the CPUs don't actually support it anymore.

      Further research has also revealed that there have since been further errata on other generations (2018), and a major security vulnerability in HLE (2021), that have resulted in Intel issuing further microcode updates to disable HLE for various generations, with the consequence that very few of the CPU lines that originally supported it still do, however they have not removed the cpuflag in every case, so some CPUs may still advertise HLE, but attempting to use it will result in an aborted transaction.

      I've not been able to find any evidence of this actually causing an issue with software (or even software that actually USES HLE other than a single dissassembler), but it's still something that gcc is clearly expecting to be present, and actually isn't.

      I've made my script ignore the presence of HLE in the profile, but I think consideration should be given to removing it from the gcc profile (-mno-hle might be enough), certainly on haswell where it's been microcoded out of just about every single SKU

            Unassigned Unassigned
            loonylion loonylion
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: