public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: H.J. Lu <hjl@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-7742] x86: Properly check FEATURE_AESKLE
Date: Mon, 21 Mar 2022 21:50:45 +0000 (GMT)	[thread overview]
Message-ID: <20220321215045.165063857419@sourceware.org> (raw)

https://gcc.gnu.org/g:d0363a80690a299179d010c1d8a6d6430e7eb73f

commit r12-7742-gd0363a80690a299179d010c1d8a6d6430e7eb73f
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Mar 21 06:50:14 2022 -0700

    x86: Properly check FEATURE_AESKLE
    
    1. Pass 0x19 to __cpuid for bit_AESKLE.
    2. Enable FEATURE_AESKLE only if bit_AESKLE is set.
    
            PR target/104998
            * common/config/i386/cpuinfo.h (get_available_features): Pass
            0x19 to __cpuid for bit_AESKLE.  Enable FEATURE_AESKLE only if
            bit_AESKLE is set.

Diff:
---
 gcc/common/config/i386/cpuinfo.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/common/config/i386/cpuinfo.h b/gcc/common/config/i386/cpuinfo.h
index 61b1a0f291c..239759dc766 100644
--- a/gcc/common/config/i386/cpuinfo.h
+++ b/gcc/common/config/i386/cpuinfo.h
@@ -779,11 +779,11 @@ get_available_features (struct __processor_model *cpu_model,
   /* Get Advanced Features at level 0x19 (eax = 0x19).  */
   if (max_cpuid_level >= 0x19)
     {
-      set_feature (FEATURE_AESKLE);
-      __cpuid (19, eax, ebx, ecx, edx);
+      __cpuid (0x19, eax, ebx, ecx, edx);
       /* Check if OS support keylocker.  */
       if (ebx & bit_AESKLE)
 	{
+	  set_feature (FEATURE_AESKLE);
 	  if (ebx & bit_WIDEKL)
 	    set_feature (FEATURE_WIDEKL);
 	  if (has_kl)


                 reply	other threads:[~2022-03-21 21:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220321215045.165063857419@sourceware.org \
    --to=hjl@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).