]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
smt: Do not disable SMT in virtual machines
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 21 Jul 2020 10:36:41 +0000 (10:36 +0000)
committerArne Fitzenreiter <arne_f@ipfire.org>
Wed, 5 Aug 2020 18:51:43 +0000 (18:51 +0000)
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>
src/initscripts/system/smt

index cc4128b2d90f45b5b8b31e10362962daa7bceec1..bfa7d57b3e925f46053bbb6b63a90c5bec77b983 100644 (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}" ] && \