aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStéphane Lesimple <speed47_github@speed47.net>2018-01-14 15:44:11 +0100
committerStéphane Lesimple <speed47_github@speed47.net>2018-01-14 15:47:51 +0100
commit749f432d32c8a31fa7c0456ff4b26f06f5db2185 (patch)
tree35008518aa5898951a694e6c5a1b4f07bab83356
parenta422b53d7c6d2cedb382e946427d4020d6b0c107 (diff)
downloadspectre-meltdown-checker-749f432d32c8a31fa7c0456ff4b26f06f5db2185.tar.lz
spectre-meltdown-checker-749f432d32c8a31fa7c0456ff4b26f06f5db2185.tar.xz
spectre-meltdown-checker-749f432d32c8a31fa7c0456ff4b26f06f5db2185.zip
also check for spec_ctrl flag in cpuinfo
-rwxr-xr-xspectre-meltdown-checker.sh22
1 files changed, 15 insertions, 7 deletions
diff --git a/spectre-meltdown-checker.sh b/spectre-meltdown-checker.sh
index b017e4c..e852fa0 100755
--- a/spectre-meltdown-checker.sh
+++ b/spectre-meltdown-checker.sh
@@ -142,6 +142,11 @@ _verbose()
_echo 2 "$@"
}
+_verbose_nol()
+{
+ _echo_nol 2 "$@"
+}
+
_debug()
{
_echo 3 "\033[34m(debug) $@\033[0m"
@@ -664,7 +669,8 @@ check_variant2()
sys_interface_available=1
else
_info "* Mitigation 1"
- _info_nol "* Hardware (CPU microcode) support for mitigation [SPEC_CTRL MSR]: "
+ _info "* Hardware (CPU microcode) support for mitigation"
+ _info_nol "* The SPEC_CTRL MSR is available: "
if [ ! -e /dev/cpu/0/msr ]; then
# try to load the module ourselves (and remember it so we can rmmod it afterwards)
modprobe msr 2>/dev/null && insmod_msr=1
@@ -691,7 +697,7 @@ check_variant2()
fi
# CPUID test
- _info_nol "* Hardware (CPU microcode) support for mitigation [CPUID bit]: "
+ _info_nol "* The SPEC_CTRL CPUID feature bit is set: "
if [ ! -e /dev/cpu/0/cpuid ]; then
# try to load the module ourselves (and remember it so we can rmmod it afterwards)
modprobe cpuid 2>/dev/null && insmod_cpuid=1
@@ -720,11 +726,13 @@ check_variant2()
fi
# hardware support according to kernel
- _info_nol "* Hardware (CPU microcode) support for mitigation [cpuinfo flag]: "
- if grep -qw spec_ctrl /proc/cpuinfo; then
- pstatus green YES
- else
- pstatus red NO
+ if [ "$opt_verbose" -ge 2 ]; then
+ _verbose_nol "* The kernel has set the spec_ctrl flag in cpuinfo: "
+ if grep -qw spec_ctrl /proc/cpuinfo; then
+ pstatus green YES
+ else
+ pstatus red NO
+ fi
fi
_info_nol "* Kernel support for IBRS: "