diff mbox series

[12/19] <sys/platform/x86.h>: Add WRMSRNS support

Message ID 20230405162144.984598-13-hjl.tools@gmail.com
State New
Headers show
Series <sys/platform/x86.h>: Update CPUID features | expand

Commit Message

H.J. Lu April 5, 2023, 4:21 p.m. UTC
Add WRMSRNS support to <sys/platform/x86.h>.
---
 manual/platform.texi               | 3 +++
 sysdeps/x86/bits/platform/x86.h    | 1 +
 sysdeps/x86/tst-get-cpu-features.c | 1 +
 3 files changed, 5 insertions(+)

Comments

Noah Goldstein April 5, 2023, 9:04 p.m. UTC | #1
On Wed, Apr 5, 2023 at 11:23 AM H.J. Lu via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
> Add WRMSRNS support to <sys/platform/x86.h>.
> ---
>  manual/platform.texi               | 3 +++
>  sysdeps/x86/bits/platform/x86.h    | 1 +
>  sysdeps/x86/tst-get-cpu-features.c | 1 +
>  3 files changed, 5 insertions(+)
>
> diff --git a/manual/platform.texi b/manual/platform.texi
> index ecee3a7b39..af79f5eb4d 100644
> --- a/manual/platform.texi
> +++ b/manual/platform.texi
> @@ -679,6 +679,9 @@ using a TSC deadline value.
>  @item
>  @code{WIDE_KL} -- AES wide Key Locker instructions.
>
> +@item
> +@code{WRMSRNS} -- WRMSRNS instruction.
> +
>  @item
>  @code{X2APIC} -- x2APIC.
>
> diff --git a/sysdeps/x86/bits/platform/x86.h b/sysdeps/x86/bits/platform/x86.h
> index 74b7f951e1..2a15ad937a 100644
> --- a/sysdeps/x86/bits/platform/x86.h
> +++ b/sysdeps/x86/bits/platform/x86.h
> @@ -297,6 +297,7 @@ enum
>    x86_cpu_FZLRM                        = x86_cpu_index_7_ecx_1_eax + 10,
>    x86_cpu_FSRS                 = x86_cpu_index_7_ecx_1_eax + 11,
>    x86_cpu_FSRCS                        = x86_cpu_index_7_ecx_1_eax + 12,
> +  x86_cpu_WRMSRNS              = x86_cpu_index_7_ecx_1_eax + 19,
>    x86_cpu_HRESET               = x86_cpu_index_7_ecx_1_eax + 22,
>    x86_cpu_LAM                  = x86_cpu_index_7_ecx_1_eax + 26,
>
> diff --git a/sysdeps/x86/tst-get-cpu-features.c b/sysdeps/x86/tst-get-cpu-features.c
> index 329d4aafb4..9c436eaa64 100644
> --- a/sysdeps/x86/tst-get-cpu-features.c
> +++ b/sysdeps/x86/tst-get-cpu-features.c
> @@ -209,6 +209,7 @@ do_test (void)
>    CHECK_CPU_FEATURE_PRESENT (FZLRM);
>    CHECK_CPU_FEATURE_PRESENT (FSRS);
>    CHECK_CPU_FEATURE_PRESENT (FSRCS);
> +  CHECK_CPU_FEATURE_PRESENT (WRMSRNS);
>    CHECK_CPU_FEATURE_PRESENT (HRESET);
>    CHECK_CPU_FEATURE_PRESENT (LAM);
>    CHECK_CPU_FEATURE_PRESENT (AESKLE);
> --
> 2.39.2
>

LGTM
Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
diff mbox series

Patch

diff --git a/manual/platform.texi b/manual/platform.texi
index ecee3a7b39..af79f5eb4d 100644
--- a/manual/platform.texi
+++ b/manual/platform.texi
@@ -679,6 +679,9 @@  using a TSC deadline value.
 @item
 @code{WIDE_KL} -- AES wide Key Locker instructions.
 
+@item
+@code{WRMSRNS} -- WRMSRNS instruction.
+
 @item
 @code{X2APIC} -- x2APIC.
 
diff --git a/sysdeps/x86/bits/platform/x86.h b/sysdeps/x86/bits/platform/x86.h
index 74b7f951e1..2a15ad937a 100644
--- a/sysdeps/x86/bits/platform/x86.h
+++ b/sysdeps/x86/bits/platform/x86.h
@@ -297,6 +297,7 @@  enum
   x86_cpu_FZLRM			= x86_cpu_index_7_ecx_1_eax + 10,
   x86_cpu_FSRS			= x86_cpu_index_7_ecx_1_eax + 11,
   x86_cpu_FSRCS			= x86_cpu_index_7_ecx_1_eax + 12,
+  x86_cpu_WRMSRNS		= x86_cpu_index_7_ecx_1_eax + 19,
   x86_cpu_HRESET		= x86_cpu_index_7_ecx_1_eax + 22,
   x86_cpu_LAM			= x86_cpu_index_7_ecx_1_eax + 26,
 
diff --git a/sysdeps/x86/tst-get-cpu-features.c b/sysdeps/x86/tst-get-cpu-features.c
index 329d4aafb4..9c436eaa64 100644
--- a/sysdeps/x86/tst-get-cpu-features.c
+++ b/sysdeps/x86/tst-get-cpu-features.c
@@ -209,6 +209,7 @@  do_test (void)
   CHECK_CPU_FEATURE_PRESENT (FZLRM);
   CHECK_CPU_FEATURE_PRESENT (FSRS);
   CHECK_CPU_FEATURE_PRESENT (FSRCS);
+  CHECK_CPU_FEATURE_PRESENT (WRMSRNS);
   CHECK_CPU_FEATURE_PRESENT (HRESET);
   CHECK_CPU_FEATURE_PRESENT (LAM);
   CHECK_CPU_FEATURE_PRESENT (AESKLE);