1
0
mirror of https://github.com/speed47/spectre-meltdown-checker synced 2024-12-23 12:54:26 +01:00

feat: hw check: add IPRED, RRSBA, BHI features check

This commit is contained in:
Stéphane Lesimple 2022-03-19 18:39:44 +01:00
parent 1a909def5d
commit e8b3f498fc

View File

@ -2865,6 +2865,48 @@ check_cpu()
fi fi
fi fi
if is_intel; then
_info " * Indirect Branch Predictor Controls"
_info_nol " * Indirect Predictor Disable feature is available: "
read_cpuid 0x7 0x2 $EDX 1 1 1; ret=$?
if [ $ret -eq 0 ]; then
cpuid_ipred_ctrl=1
pstatus green YES "IPRED_CTRL feature bit"
elif [ $ret -eq 2 ]; then
cpuid_ipred_ctrl=-1
pstatus yellow UNKNOWN "is cpuid kernel module available?"
else
cpuid_ipred_ctrl=0
pstatus yellow NO
fi
_info_nol " * Bottomless RSB Disable feature is available: "
read_cpuid 0x7 0x2 $EDX 2 1 1; ret=$?
if [ $ret -eq 0 ]; then
cpuid_rrsba=1
pstatus green YES "RRSBA_CTRL feature bit"
elif [ $ret -eq 2 ]; then
cpuid_rrsba=-1
pstatus yellow UNKNOWN "is cpuid kernel module available?"
else
cpuid_rrsba=0
pstatus yellow NO
fi
_info_nol " * BHB-Focused Indirect Predictor Disable feature is available: "
read_cpuid 0x7 0x2 $EDX 2 1 1; ret=$?
if [ $ret -eq 0 ]; then
cpuid_bhi=1
pstatus green YES "BHI_CTRL feature bit"
elif [ $ret -eq 2 ]; then
cpuid_bhi=-1
pstatus yellow UNKNOWN "is cpuid kernel module available?"
else
cpuid_bhi=0
pstatus yellow NO
fi
fi
if is_intel; then if is_intel; then
_info " * Enhanced IBRS (IBRS_ALL)" _info " * Enhanced IBRS (IBRS_ALL)"
_info_nol " * CPU indicates ARCH_CAPABILITIES MSR availability: " _info_nol " * CPU indicates ARCH_CAPABILITIES MSR availability: "