1
0
Fork 0
remarkable-linux/arch/x86/kernel/cpu
Jiri Kosina fc083988b6 x86/bugs, kvm: Introduce boot-time control of L1TF mitigations
commit d90a7a0ec8 upstream

Introduce the 'l1tf=' kernel command line option to allow for boot-time
switching of mitigation that is used on processors affected by L1TF.

The possible values are:

  full
	Provides all available mitigations for the L1TF vulnerability. Disables
	SMT and enables all mitigations in the hypervisors. SMT control via
	/sys/devices/system/cpu/smt/control is still possible after boot.
	Hypervisors will issue a warning when the first VM is started in
	a potentially insecure configuration, i.e. SMT enabled or L1D flush
	disabled.

  full,force
	Same as 'full', but disables SMT control. Implies the 'nosmt=force'
	command line option. sysfs control of SMT and the hypervisor flush
	control is disabled.

  flush
	Leaves SMT enabled and enables the conditional hypervisor mitigation.
	Hypervisors will issue a warning when the first VM is started in a
	potentially insecure configuration, i.e. SMT enabled or L1D flush
	disabled.

  flush,nosmt
	Disables SMT and enables the conditional hypervisor mitigation. SMT
	control via /sys/devices/system/cpu/smt/control is still possible
	after boot. If SMT is reenabled or flushing disabled at runtime
	hypervisors will issue a warning.

  flush,nowarn
	Same as 'flush', but hypervisors will not warn when
	a VM is started in a potentially insecure configuration.

  off
	Disables hypervisor mitigations and doesn't emit any warnings.

Default is 'flush'.

Let KVM adhere to these semantics, which means:

  - 'lt1f=full,force'	: Performe L1D flushes. No runtime control
    			  possible.

  - 'l1tf=full'
  - 'l1tf-flush'
  - 'l1tf=flush,nosmt'	: Perform L1D flushes and warn on VM start if
			  SMT has been runtime enabled or L1D flushing
			  has been run-time enabled

  - 'l1tf=flush,nowarn'	: Perform L1D flushes and no warnings are emitted.

  - 'l1tf=off'		: L1D flushes are not performed and no warnings
			  are emitted.

KVM can always override the L1D flushing behavior using its 'vmentry_l1d_flush'
module parameter except when lt1f=full,force is set.

This makes KVM's private 'nosmt' option redundant, and as it is a bit
non-systematic anyway (this is something to control globally, not on
hypervisor level), remove that option.

Add the missing Documentation entry for the l1tf vulnerability sysfs file
while at it.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Jiri Kosina <jkosina@suse.cz>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lkml.kernel.org/r/20180713142323.202758176@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-15 18:12:56 +02:00
..
mcheck x86/MCE: Remove min interval polling limitation 2018-07-25 11:25:07 +02:00
microcode x86/microcode: Make the late update update_lock a raw lock for RT 2018-08-03 07:50:28 +02:00
mtrr x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping 2018-02-22 15:42:24 +01:00
.gitignore
Makefile x86 / CPU: Always show current CPU frequency in /proc/cpuinfo 2018-01-10 09:31:20 +01:00
amd.c x86/CPU/AMD: Move TOPOEXT reenablement before reading smp_num_siblings 2018-08-15 18:12:53 +02:00
aperfmperf.c x86 / CPU: Always show current CPU frequency in /proc/cpuinfo 2018-01-10 09:31:20 +01:00
bugs.c x86/bugs, kvm: Introduce boot-time control of L1TF mitigations 2018-08-15 18:12:56 +02:00
centaur.c x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping 2018-02-22 15:42:24 +01:00
common.c x86/cpu/common: Provide detect_ht_early() 2018-08-15 18:12:52 +02:00
cpu.h x86/cpu/topology: Provide detect_extended_topology_early() 2018-08-15 18:12:52 +02:00
cpuid-deps.c x86/cpuid: Replace set/clear_bit32() 2017-12-25 14:26:19 +01:00
cyrix.c x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping 2018-02-22 15:42:24 +01:00
hypervisor.c x86/virt: Add enum for hypervisors to replace x86_hyper 2017-12-25 14:26:20 +01:00
intel.c x86/cpu/intel: Evaluate smp_num_siblings early 2018-08-15 18:12:52 +02:00
intel_cacheinfo.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
intel_rdt.c x86/intel_rdt: Enable CMT and MBM on new Skylake stepping 2018-06-26 08:06:32 +08:00
intel_rdt.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
intel_rdt_ctrlmondata.c x86/intel_rdt/mbm: Add mbm counter initialization 2017-08-01 22:41:29 +02:00
intel_rdt_monitor.c x86/intel_rdt/cqm: Improve limbo list processing 2017-08-16 12:05:41 +02:00
intel_rdt_rdtgroup.c x86/intel_rdt: Fix incorrect returned value when creating rdgroup sub-directory in resctrl file system 2018-05-30 07:52:02 +02:00
match.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mkcapflags.sh License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mshyperv.c x86/virt: Add enum for hypervisors to replace x86_hyper 2017-12-25 14:26:20 +01:00
perfctr-watchdog.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
powerflags.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
proc.c x86/cpu: Change type of x86_cache_size variable to unsigned int 2018-02-22 15:42:24 +01:00
rdrand.c x86, asm: Use CC_SET()/CC_OUT() and static_cpu_has() in archrandom.h 2016-06-08 12:41:20 -07:00
scattered.c x86/cpufeatures: Add CPUID_7_EDX CPUID leaf 2018-02-07 11:12:18 -08:00
topology.c x86/cpu/topology: Provide detect_extended_topology_early() 2018-08-15 18:12:52 +02:00
transmeta.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
umc.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vmware.c x86/virt: Add enum for hypervisors to replace x86_hyper 2017-12-25 14:26:20 +01:00