smt: Do not disable SMT in virtual machines

Processors in virtual machines are *virtual*. Therefore this
only degrades the performance of the guest, but does not increase
it's security.

This patch always leaves SMT enabled in all virtual environments.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
Michael Tremer
2020-07-21 10:36:41 +00:00
committed by Arne Fitzenreiter
parent 138c94a96d
commit 8531a9503c

View File

@@ -20,6 +20,11 @@ case "${1}" in
exit 0
fi 2>/dev/null
# Do not disable SMT inside virtual machines
if [ -d "/sys/hypervisor" ]; then
exit 0
fi
# Disable SMT when the processor is vulnerable to Foreshadow or Fallout/ZombieLoad/RIDL
for vuln in l1tf mds; do
if [ -r "/sys/devices/system/cpu/vulnerabilities/${vuln}" ] && \