https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104998

            Bug ID: 104998
           Summary: Incorrect __cpuid usage
           Product: gcc
           Version: 11.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: crazylht at gmail dot com
  Target Milestone: ---
            Target: x86-64

get_available_features has

  /* Get Advanced Features at level 0x19 (eax = 0x19).  */
  if (max_cpuid_level >= 0x19)
    {   
      set_feature (FEATURE_AESKLE);
      __cpuid (19, eax, ebx, ecx, edx);
               ^^^ Should be 0x19.
      /* Check if OS support keylocker.  */
      if (ebx & bit_AESKLE)
        {
          if (ebx & bit_WIDEKL)
            set_feature (FEATURE_WIDEKL);
          if (has_kl)
            set_feature (FEATURE_KL);
        }
    }

Reply via email to