ibrs can't be enabled on no ibrs cpu

If the cpu is identified, and does not support SPEC_CTRL or IBRS, then ibrs can't be enabled, even if supported by the kernel.
Instead of reporting IBRS enabled and active UNKNOWN, report IBRS enabled and active NO.
This commit is contained in:
rrobgill 2018-05-06 15:47:45 +10:00 committed by GitHub
parent 3568293570
commit 9063a7fd20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -2121,6 +2121,10 @@ check_variant2_linux()
if [ "$ibpb_enabled" = 2 ]; then if [ "$ibpb_enabled" = 2 ]; then
# if ibpb=2, ibrs is forcefully=0 # if ibpb=2, ibrs is forcefully=0
pstatus blue NO "IBPB used instead of IBRS in all kernel entrypoints" pstatus blue NO "IBPB used instead of IBRS in all kernel entrypoints"
else
if [ ! "$cpuid_ibrs" = 'SPEC_CTRL' ] && [ ! "cpuid_ibrs" = 'IBRS_SUPPORT' ] && [ ! "cpuid_spec_ctrl" = -1 ]; then
pstatus yellow NO;
_debug "ibrs: known cpu not supporting SPEC-CTRL or IBRS";
else else
# 0 means disabled # 0 means disabled
# 1 is enabled only for kernel space # 1 is enabled only for kernel space
@ -2140,6 +2144,7 @@ check_variant2_linux()
*) pstatus yellow UNKNOWN;; *) pstatus yellow UNKNOWN;;
esac esac
fi fi
fi
else else
pstatus blue N/A "not testable in offline mode" pstatus blue N/A "not testable in offline mode"
fi fi