This script provides a convenient way to disable and enable SMT (known as Hyper-Threading on Intel chips) on the fly. This allows to turn off SMT when desired to improve security on Intel chips (L1TF and MDS can’t be fully mitigated without disabling HT).
This script uses sysfs, and will work only with the Linux kernel. It’s written
in GNU Bash, and uses nproc
, which might not be available in non-GNU
coreutils.
Put the smt
file from this repository somewhere in your PATH
. Since this
script requires root access, you might want to setuid it.
smt [on|off]