[PATCH RFC 0/5] cpu/speculation: Add 'cpu_spec_mitigations=' cmdline options

From: Josh Poimboeuf
Date: Thu Apr 04 2019 - 12:45:09 EST


Keeping track of the number of mitigations for all the CPU speculation
bugs has become overwhelming for many users. It's getting more and more
complicated to decide which mitigations are needed for a given
architecture. Complicating matters is the fact that each arch tends to
it own custom way to mitigate the same vulnerability.

Most users fall into a few basic categories:

a) they want all CPU speculation mitigations off;

b) they want all reasonable mitigations on, with SMT enabled even if
it's vulnerable; or

c) they want all reasonable mitigations on, with SMT disabled if
vulnerable.

Define a set of curated, arch-independent options, each of which is an
aggregation of existing options:

- cpu_spec_mitigations=off: Disable all mitigations.

- cpu_spec_mitigations=auto: [default] Enable all the default
mitigations, but leave SMT enabled, even if it's vulnerable.

- cpu_spec_mitigations=auto,nosmt: Enable all the default mitigations,
disabling SMT if needed by a mitigation.


Josh Poimboeuf (5):
cpu/speculation: Add 'cpu_spec_mitigations=' cmdline options
x86/speculation: Add support for 'cpu_spec_mitigations=' cmdline
options
powerpc/speculation: Add support for 'cpu_spec_mitigations=' cmdline
options
s390/speculation: Add support for 'cpu_spec_mitigations=' cmdline
options
arm64/speculation: Add support for 'cpu_spec_mitigations=' cmdline
options

.../admin-guide/kernel-parameters.txt | 42 +++++++++++++++++++
arch/arm64/kernel/cpu_errata.c | 4 ++
arch/arm64/kernel/cpufeature.c | 6 +++
arch/powerpc/kernel/security.c | 6 +--
arch/powerpc/kernel/setup_64.c | 2 +-
arch/s390/kernel/nospec-branch.c | 4 +-
arch/x86/include/asm/processor.h | 1 +
arch/x86/kernel/cpu/bugs.c | 32 ++++++++++++--
arch/x86/kvm/vmx/vmx.c | 2 +
arch/x86/mm/pti.c | 4 +-
include/linux/cpu.h | 8 ++++
kernel/cpu.c | 15 +++++++
12 files changed, 116 insertions(+), 10 deletions(-)

--
2.17.2