about summary refs log tree commit diff
path: root/sysdeps/x86/tst-get-cpu-features.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2020-09-15 05:49:27 -0700
committerH.J. Lu <hjl.tools@gmail.com>2020-09-16 05:56:10 -0700
commitf2c679d4b2c73a95f437c705f960a4af1fa23498 (patch)
tree1f30bd0a05a25caa79dda87c9330fb7c6de901bd /sysdeps/x86/tst-get-cpu-features.c
parenta140ff9162f353e804d6a8c83c8f3c18511850dd (diff)
downloadglibc-f2c679d4b2c73a95f437c705f960a4af1fa23498.tar.gz
glibc-f2c679d4b2c73a95f437c705f960a4af1fa23498.tar.xz
glibc-f2c679d4b2c73a95f437c705f960a4af1fa23498.zip
<sys/platform/x86.h>: Add Intel Key Locker support
Add Intel Key Locker:

https://software.intel.com/content/www/us/en/develop/download/intel-key-locker-specification.html

support to <sys/platform/x86.h>.  Intel Key Locker has

1. KL: AES Key Locker instructions.
2. WIDE_KL: AES wide Key Locker instructions.
3. AESKLE: AES Key Locker instructions are enabled by OS.

Applications should use

if (CPU_FEATURE_USABLE (KL))

and

if (CPU_FEATURE_USABLE (WIDE_KL))

to check if AES Key Locker instructions and AES wide Key Locker
instructions are usable.
Diffstat (limited to 'sysdeps/x86/tst-get-cpu-features.c')
-rw-r--r--sysdeps/x86/tst-get-cpu-features.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sysdeps/x86/tst-get-cpu-features.c b/sysdeps/x86/tst-get-cpu-features.c
index 3447d17e23..a3225a00e6 100644
--- a/sysdeps/x86/tst-get-cpu-features.c
+++ b/sysdeps/x86/tst-get-cpu-features.c
@@ -172,6 +172,7 @@ do_test (void)
   CHECK_CPU_FEATURE (AVX512_BITALG);
   CHECK_CPU_FEATURE (AVX512_VPOPCNTDQ);
   CHECK_CPU_FEATURE (RDPID);
+  CHECK_CPU_FEATURE (KL);
   CHECK_CPU_FEATURE (CLDEMOTE);
   CHECK_CPU_FEATURE (MOVDIRI);
   CHECK_CPU_FEATURE (MOVDIR64B);
@@ -219,6 +220,8 @@ do_test (void)
   CHECK_CPU_FEATURE (INVARIANT_TSC);
   CHECK_CPU_FEATURE (WBNOINVD);
   CHECK_CPU_FEATURE (AVX512_BF16);
+  CHECK_CPU_FEATURE (AESKLE);
+  CHECK_CPU_FEATURE (WIDE_KL);
 
   printf ("Usable CPU features:\n");
   CHECK_CPU_FEATURE_USABLE (SSE3);
@@ -325,6 +328,7 @@ do_test (void)
   CHECK_CPU_FEATURE_USABLE (AVX512_BITALG);
   CHECK_CPU_FEATURE_USABLE (AVX512_VPOPCNTDQ);
   CHECK_CPU_FEATURE_USABLE (RDPID);
+  CHECK_CPU_FEATURE_USABLE (KL);
   CHECK_CPU_FEATURE_USABLE (CLDEMOTE);
   CHECK_CPU_FEATURE_USABLE (MOVDIRI);
   CHECK_CPU_FEATURE_USABLE (MOVDIR64B);
@@ -372,6 +376,8 @@ do_test (void)
   CHECK_CPU_FEATURE_USABLE (INVARIANT_TSC);
   CHECK_CPU_FEATURE_USABLE (WBNOINVD);
   CHECK_CPU_FEATURE_USABLE (AVX512_BF16);
+  CHECK_CPU_FEATURE_USABLE (AESKLE);
+  CHECK_CPU_FEATURE_USABLE (WIDE_KL);
 
   return 0;
 }