Skip to content

cpu: Fix default mitigation behavior

Sean Christopherson lkml stable 2 versions – Applied

Status from this message: The following commit has been merged into the x86/urgent branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 6 repliesApplied
  2. v12 patches 10 repliesSuperseded

Changes in v2 from the cover letter

- Rework the Kconfigs so that there's a single user-visible CPU_MITIGATION config. [Everyone]
- Define CPU_MITIGATIONS in arch/Kconfig. [Josh]
- Completely compile out the cpu_mitigations code if CPU_MITIGATIONS=n, e.g. to make impossible to end up in a half-baked state where cpu_mitigations ends up enabled but the kernel wasn't compiled with mitigations enabled.

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/2cpu: Re-enable CPU mitigations by default for !X86 architecturesarch/Kconfig arch/x86/Kconfig kernel/cpu.c+16 -71 reply
2/2cpu: Ignore "mitigations" kernel parameter if CPU_MITIGATIONS=nDocumentation/admin-guide/kernel-parameters.txt arch/x86/Kconfig include/linux/cpu.h +1 more+30 -54 replies

Reviews trailers per patch

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

PatchBorislav Petkov (AMD)Josh Poimboeuf
SeriesA-b
1/2A-b
2/2

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/2] cpu: Fix default mitigation behavior

Linus, I Cc'd you on this as patch 1 fixes a goof that causes mitigations to be completely disabled on all !x86 architectures, and it'd be nice to fix that in rc5. There was a decent bit of discussion on how exactly to juggle the Kconfigs, and so I don't expect anyone to include this in a pull request for rc5.

The discussion didn't fully resolve, i.e. this hasn't gotten a thumbs up from the affected parties, but I think/hope my approach here is minimal enough for other architectures (just restores previous behavior), and shouldn't result in a huge amount of churn if we decide to go in a different direction.

TL;DR: please grab patch 1 directly if you think it's worth squeezing into rc5, and isn't completely crazy.

Thanks!

Patch 2 is probably 6.9 material, but is definitely not rc5 material. It disallows retroactively enabling mitigations via command line if the kernel was built with CPU_MITIGATIONS=n, as it's infeasible for x86 to provide sane, predictable behavior for this scenario.

v2:
- Rework the Kconfigs so that there's a single user-visible CPU_MITIGATION config. [Everyone]
- Define CPU_MITIGATIONS in arch/Kconfig. [Josh]
- Completely compile out the cpu_mitigations code if CPU_MITIGATIONS=n, e.g. to make impossible to end up in a half-baked state where cpu_mitigations ends up enabled but the kernel wasn't compiled with mitigations enabled.

v1: https://lore.kernel.org/all/[email protected]

Sean Christopherson (2):
cpu: Re-enable CPU mitigations by default for !X86 architectures
cpu: Ignore "mitigations" kernel parameter if CPU_MITIGATIONS=n

 .../admin-guide/kernel-parameters.txt         |  3 +++
 arch/Kconfig                                  |  8 ++++++++
 arch/x86/Kconfig                              | 19 ++++++++++++-------
 include/linux/cpu.h                           | 11 +++++++++++
 kernel/cpu.c                                  | 13 ++++++++++---
 5 files changed, 44 insertions(+), 10 deletions(-)

base-commit: 96fca68c4fbf77a8185eb10f7557e23352732ea2

Signature · 1 line
2.44.0.769.g3c40516874-goog