diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2022-03-21 06:50:14 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2022-03-21 14:50:02 -0700 |
commit | d0363a80690a299179d010c1d8a6d6430e7eb73f (patch) | |
tree | 655ccf651f4191ce8c4b829f346f74935e3ea41c /gcc/common | |
parent | 24d51e749570dcb85bd43d3b528f58ad6141de26 (diff) | |
download | gcc-d0363a80690a299179d010c1d8a6d6430e7eb73f.zip gcc-d0363a80690a299179d010c1d8a6d6430e7eb73f.tar.gz gcc-d0363a80690a299179d010c1d8a6d6430e7eb73f.tar.bz2 |
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.
Diffstat (limited to 'gcc/common')
-rw-r--r-- | gcc/common/config/i386/cpuinfo.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/common/config/i386/cpuinfo.h b/gcc/common/config/i386/cpuinfo.h index 61b1a0f..239759d 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) |