]>
git.ipfire.org Git - people/mfischer/ipfire-2.x.git/blob - src/initscripts/system/smt
2 ########################################################################
3 # Begin $rc_base/init.d/smt
4 ########################################################################
9 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/main
/security
)
13 # Nothing to do here when SMT is forced on
14 if [ "${ENABLE_SMT}" = "on" ]; then
18 # Nothing to do when SMT is not enabled or not supported anyways
19 if [ "$(</sys/devices/system/cpu/smt/control)" != "on" ]; then
23 # Do not disable SMT inside virtual machines
24 if running_on_hypervisor
; then
28 # Disable SMT when the processor is vulnerable to Foreshadow or Fallout/ZombieLoad/RIDL
29 for vuln
in l1tf mds
; do
30 if [ -r "/sys/devices/system/cpu/vulnerabilities/${vuln}" ] && \
31 [[ "$(</sys/devices/system/cpu/vulnerabilities/${vuln})" =~
"SMT vulnerable" ]]; then
33 boot_mesg
"Disabling Simultaneous Multi-Threading (SMT)..."
34 echo "forceoff" > /sys
/devices
/system
/cpu
/smt
/control
37 # No need to check any further when we have disabled SMT already
44 echo "Usage: ${0} {start}"
49 # End $rc_base/init.d/smt