Skip to content

cpu/speculation: Add 'mitigations=' cmdline option

Josh Poimboeuf linux-arch linux-arm-kernel linux-s390 linuxppc-dev lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest5 patches 9 repliesIn review

Changes in v2 from the cover letter

- docs improvements: [Randy, Michael]
- Rename to "mitigations=" [Michael]
- Add cpu_mitigations_off() function wrapper [Michael]
- x86: Simplify logic [Boris]
- powerpc: Fix no_rfi_flush checking bug (use '&&' instead of '||')
- arm64: Rebase onto Jeremy Linton's v7 patches [Will]
- arm64: "kpti command line option" [Steve P]
- arm64: Add nospectre_v2 support

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5cpu/speculation: Add 'mitigations=' cmdline optionDocumentation/admin-guide/kernel-parameters.txt include/linux/cpu.h kernel/cpu.c+63 -02 replies
2/5x86/speculation: Support 'mitigations=' cmdline optionDocumentation/admin-guide/kernel-parameters.txt arch/x86/kernel/cpu/bugs.c arch/x86/mm/pti.c+23 -80 replies
3/5powerpc/speculation: Support 'mitigations=' cmdline optionDocumentation/admin-guide/kernel-parameters.txt arch/powerpc/kernel/security.c arch/powerpc/kernel/setup_64.c+9 -80 replies
4/5s390/speculation: Support 'mitigations=' cmdline optionDocumentation/admin-guide/kernel-parameters.txt arch/s390/kernel/nospec-branch.c+5 -30 replies
5/5arm64/speculation: Support 'mitigations=' cmdline optionDocumentation/admin-guide/kernel-parameters.txt arch/arm64/kernel/cpu_errata.c arch/arm64/kernel/cpufeature.c+17 -512 replies

Reviews trailers per patch

None of the 5 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJiri Kosina
SeriesT-b R-b
1/5
2/5
3/5
4/5
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/5] cpu/speculation: Add 'mitigations=' cmdline option

v2:
- docs improvements: [Randy, Michael]
- Rename to "mitigations=" [Michael]
- Add cpu_mitigations_off() function wrapper [Michael]
- x86: Simplify logic [Boris]
- powerpc: Fix no_rfi_flush checking bug (use '&&' instead of '||')
- arm64: Rebase onto Jeremy Linton's v7 patches [Will]
- arm64: "kpti command line option" [Steve P]
- arm64: Add nospectre_v2 support

-----------

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 have its own custom way to mitigate the same vulnerability.

Most users fall into a few basic categories:

a) they want all 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:

- mitigations=off: Disable all mitigations.

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

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

Josh Poimboeuf (5):
cpu/speculation: Add 'mitigations=' cmdline option x86/speculation: Support 'mitigations=' cmdline option powerpc/speculation: Support 'mitigations=' cmdline option s390/speculation: Support 'mitigations=' cmdline option arm64/speculation: Support 'mitigations=' cmdline option

 .../admin-guide/kernel-parameters.txt         | 34 +++++++++++++++++++
 arch/arm64/kernel/cpu_errata.c                |  6 +++-
 arch/arm64/kernel/cpufeature.c                |  8 ++++-
 arch/powerpc/kernel/security.c                |  6 ++--
 arch/powerpc/kernel/setup_64.c                |  2 +-
 arch/s390/kernel/nospec-branch.c              |  3 +-
 arch/x86/kernel/cpu/bugs.c                    | 11 ++++--
 arch/x86/mm/pti.c                             |  4 ++-
 include/linux/cpu.h                           | 24 +++++++++++++
 kernel/cpu.c                                  | 15 ++++++++
 10 files changed, 103 insertions(+), 10 deletions(-)
Signature · 1 line
2.17.2