From e09d0cf2215cff2c59428a05bfbc18797e204b84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lesimple?= Date: Tue, 31 Mar 2026 22:08:02 +0200 Subject: [PATCH] enh: check_cpu: look for cap_stibp and cap_autoibrs --- src/libs/400_hw_check.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/libs/400_hw_check.sh b/src/libs/400_hw_check.sh index cd1d1b4..e92776e 100644 --- a/src/libs/400_hw_check.sh +++ b/src/libs/400_hw_check.sh @@ -481,26 +481,27 @@ check_cpu() { pr_info_nol " * CPU indicates STIBP capability: " # intel: A processor supports STIBP if it enumerates CPUID (EAX=7H,ECX=0):EDX[27] as 1 # amd: 8000_0008 EBX[15]=1 + cap_stibp='' if is_intel; then read_cpuid 0x7 0x0 $EDX 27 1 1 ret=$? if [ $ret = $READ_CPUID_RET_OK ]; then pstatus green YES "Intel STIBP feature bit" - #cpuid_stibp='Intel STIBP' + cap_stibp='Intel STIBP' fi elif is_amd; then read_cpuid 0x80000008 0x0 $EBX 15 1 1 ret=$? if [ $ret = $READ_CPUID_RET_OK ]; then pstatus green YES "AMD STIBP feature bit" - #cpuid_stibp='AMD STIBP' + cap_stibp='AMD STIBP' fi elif is_hygon; then read_cpuid 0x80000008 0x0 $EBX 15 1 1 ret=$? if [ $ret = $READ_CPUID_RET_OK ]; then pstatus green YES "HYGON STIBP feature bit" - #cpuid_stibp='HYGON STIBP' + cap_stibp='HYGON STIBP' fi else ret=invalid @@ -1006,6 +1007,20 @@ check_cpu() { else pstatus yellow UNKNOWN "$ret_read_cpuid_msg" fi + + pr_info_nol " * CPU indicates AutoIBRS capability: " + cap_autoibrs='' + read_cpuid 0x80000021 0x0 $EAX 8 1 1 + ret=$? + if [ $ret = $READ_CPUID_RET_OK ]; then + pstatus green YES + cap_autoibrs=1 + elif [ $ret = $READ_CPUID_RET_KO ]; then + pstatus yellow NO + cap_autoibrs=0 + else + pstatus yellow UNKNOWN "$ret_read_cpuid_msg" + fi fi pr_info_nol " * CPU supports Transactional Synchronization Extensions (TSX): "