1
0
mirror of https://github.com/speed47/spectre-meltdown-checker synced 2024-11-06 22:23:41 +01:00

enh: display ucode info even when not blacklisted

This commit is contained in:
Stéphane Lesimple 2018-01-31 16:21:32 +01:00
parent 4d29607630
commit b1fdf88f28

View File

@ -791,6 +791,7 @@ is_ucode_blacklisted()
# now, check each known bad microcode # now, check each known bad microcode
# source: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/x86/kernel/cpu/intel.c#n105 # source: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/x86/kernel/cpu/intel.c#n105
# model,stepping,microcode # model,stepping,microcode
ucode_found="model $cpu_model stepping $cpu_stepping ucode $cpu_ucode"
set -u set -u
for tuple in \ for tuple in \
$INTEL_FAM6_KABYLAKE_DESKTOP,0x0B,0x84 \ $INTEL_FAM6_KABYLAKE_DESKTOP,0x0B,0x84 \
@ -822,7 +823,6 @@ is_ucode_blacklisted()
ucode=$(echo $tuple | cut -d, -f3) ucode=$(echo $tuple | cut -d, -f3)
if [ "$cpu_model" = "$model" ] && [ "$cpu_stepping" = "$stepping" ] && echo "$cpu_ucode" | grep -qi "^$ucode$"; then if [ "$cpu_model" = "$model" ] && [ "$cpu_stepping" = "$stepping" ] && echo "$cpu_ucode" | grep -qi "^$ucode$"; then
_debug "is_ucode_blacklisted: we have a match! ($cpu_model/$cpu_stepping/$cpu_ucode)" _debug "is_ucode_blacklisted: we have a match! ($cpu_model/$cpu_stepping/$cpu_ucode)"
bad_ucode_found="Intel CPU Family 6 Model $cpu_model Stepping $cpu_stepping with microcode $cpu_ucode"
set +u set +u
return 0 return 0
fi fi
@ -1186,7 +1186,7 @@ check_cpu()
_info_nol " * CPU microcode is known to cause stability problems: " _info_nol " * CPU microcode is known to cause stability problems: "
if is_ucode_blacklisted; then if is_ucode_blacklisted; then
pstatus red YES "$bad_ucode_found" pstatus red YES "$ucode_found"
_warn _warn
_warn "The microcode your CPU is running on is known to cause instability problems," _warn "The microcode your CPU is running on is known to cause instability problems,"
_warn "such as intempestive reboots or random crashes." _warn "such as intempestive reboots or random crashes."
@ -1194,7 +1194,7 @@ check_cpu()
_warn "the mitigations for Spectre), or upgrade to a newer one if available." _warn "the mitigations for Spectre), or upgrade to a newer one if available."
_warn _warn
else else
pstatus green NO pstatus green NO "$ucode_found"
fi fi
_info "* CPU vulnerability to the three speculative execution attacks variants" _info "* CPU vulnerability to the three speculative execution attacks variants"