aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStéphane Lesimple <speed47_github@speed47.net>2018-01-14 16:36:51 +0100
committerStéphane Lesimple <speed47_github@speed47.net>2018-01-14 16:36:51 +0100
commit71213c11b3d396c6dc43f43b133ea2f56a46bf39 (patch)
treea8b4c854e7277c1d359649de09879349f2badb97
parent749f432d32c8a31fa7c0456ff4b26f06f5db2185 (diff)
downloadspectre-meltdown-checker-71213c11b3d396c6dc43f43b133ea2f56a46bf39.tar.lz
spectre-meltdown-checker-71213c11b3d396c6dc43f43b133ea2f56a46bf39.tar.xz
spectre-meltdown-checker-71213c11b3d396c6dc43f43b133ea2f56a46bf39.zip
ibrs: check for spec_ctrl_ibrs in cpuinfo
-rwxr-xr-xspectre-meltdown-checker.sh22
1 files changed, 19 insertions, 3 deletions
diff --git a/spectre-meltdown-checker.sh b/spectre-meltdown-checker.sh
index e852fa0..5468915 100755
--- a/spectre-meltdown-checker.sh
+++ b/spectre-meltdown-checker.sh
@@ -728,10 +728,14 @@ check_variant2()
# hardware support according to kernel
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
+ if [ "$opt_live" = 1 ]; then
+ if grep -qw spec_ctrl /proc/cpuinfo; then
+ pstatus green YES
+ else
+ pstatus red NO
+ fi
else
- pstatus red NO
+ pstatus blue N/A "not testable in offline mode"
fi
fi
@@ -756,6 +760,18 @@ check_variant2()
_debug "ibrs: file $ibrs_file doesn't exist"
fi
done
+ # on some newer kernels, the spec_ctrl_ibrs flag in /proc/cpuinfo
+ # is set when ibrs has been administratively enabled (usually from cmdline)
+ # which in that case means ibrs is supported *and* enabled for kernel & user
+ # as per the ibrs patch series v3
+ if [ "$ibrs_supported" = 0 ]; then
+ if grep -qw spec_ctrl_ibrs /proc/cpuinfo; then
+ _debug "ibrs: found spec_ctrl_ibrs flag in /proc/cpuinfo"
+ ibrs_supported=1
+ # enabled=2 -> kernel & user
+ ibrs_enabled=2
+ fi
+ fi
fi
if [ "$ibrs_supported" != 1 -a -n "$opt_map" ]; then
if grep -q spec_ctrl "$opt_map"; then