[v2,01/16] x86/cet: Check user_shstk in /proc/cpuinfo

Message ID 20231216165325.2584919-2-hjl.tools@gmail.com
State Committed
Commit 0b850186fd3177311f10dcb938b668cc750fa3be
Headers
Series x86/cet: Update CET kernel interface |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent

Commit Message

H.J. Lu Dec. 16, 2023, 4:53 p.m. UTC
  Linux kernel reports CPU shadow stack feature in /proc/cpuinfo as
user_shstk, instead of shstk.
---
 sysdeps/x86/tst-cpu-features-cpuinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

H.J. Lu Dec. 16, 2023, 4:59 p.m. UTC | #1
On Sat, Dec 16, 2023 at 8:53 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> Linux kernel reports CPU shadow stack feature in /proc/cpuinfo as
> user_shstk, instead of shstk.
> ---
>  sysdeps/x86/tst-cpu-features-cpuinfo.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sysdeps/x86/tst-cpu-features-cpuinfo.c b/sysdeps/x86/tst-cpu-features-cpuinfo.c
> index 18d64375ca..1d6c647b70 100644
> --- a/sysdeps/x86/tst-cpu-features-cpuinfo.c
> +++ b/sysdeps/x86/tst-cpu-features-cpuinfo.c
> @@ -246,7 +246,7 @@ do_test (int argc, char **argv)
>    fails += CHECK_PROC (sgx, SGX);
>    fails += CHECK_PROC (sgx_lc, SGX_LC);
>    fails += CHECK_PROC (sha_ni, SHA);
> -  fails += CHECK_PROC (shstk, SHSTK);
> +  fails += CHECK_PROC (user_shstk, SHSTK);
>    fails += CHECK_PROC (smap, SMAP);
>    fails += CHECK_PROC (smep, SMEP);
>    fails += CHECK_PROC (smx, SMX);
> --
> 2.43.0
>

On Tiger Lake, /proc/cpuinfo reports

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx
pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl
xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq
dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid
sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx
f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l2 cdp_l2
ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid
ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdt_a
avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt
avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves
split_lock_detect user_shstk dtherm ida arat pln pts hwp hwp_notify
hwp_act_window hwp_epp hwp_pkg_req vnmi avx512vbmi umip pku ospke
avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg
avx512_vpopcntdq rdpid movdiri movdir64b fsrm avx512_vp2intersect
md_clear ibt flush_l1d arch_capabilities

I will check it tomorrow if there is no objection.

Thanks.
  

Patch

diff --git a/sysdeps/x86/tst-cpu-features-cpuinfo.c b/sysdeps/x86/tst-cpu-features-cpuinfo.c
index 18d64375ca..1d6c647b70 100644
--- a/sysdeps/x86/tst-cpu-features-cpuinfo.c
+++ b/sysdeps/x86/tst-cpu-features-cpuinfo.c
@@ -246,7 +246,7 @@  do_test (int argc, char **argv)
   fails += CHECK_PROC (sgx, SGX);
   fails += CHECK_PROC (sgx_lc, SGX_LC);
   fails += CHECK_PROC (sha_ni, SHA);
-  fails += CHECK_PROC (shstk, SHSTK);
+  fails += CHECK_PROC (user_shstk, SHSTK);
   fails += CHECK_PROC (smap, SMAP);
   fails += CHECK_PROC (smep, SMEP);
   fails += CHECK_PROC (smx, SMX);