Skip to content

x86/cpu: Take Intel platform into account for old microcode checks

Dave Hansen lkml 4 versions – Applied

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

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest4 patches 8 repliesApplied
  2. v34 patches 0 repliesSuperseded
  3. v26 patches 22 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v16 patches28 repliesSuperseded

Changes from v2 from the cover letter

* Move new helpers from .h into .c file. This avoids the #include dependency issues for now. That can be dealt with another day.
* Rename x86_platform_id to have an intel_ prefix and add a union to make it clear that AMD can use the space for something else

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/4x86/microcode: Refactor platform ID enumeration into a helperarch/x86/kernel/cpu/microcode/intel.c+42 -115 replies
2/4x86/cpu: Add platform ID to CPU info structurearch/x86/include/asm/microcode.h arch/x86/include/asm/processor.h arch/x86/kernel/cpu/intel.c +1 more+9 -13 replies
3/4x86/cpu: Add platform ID to CPU matching structurearch/x86/kernel/cpu/match.c include/linux/mod_devicetable.h+5 -00 replies
4/4x86/microcode: Add platform mask to Intel microcode "old" listarch/x86/kernel/cpu/microcode/intel-ucode-defs.h+238 -1600 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchSohil MehtaZhao LiuPawan Gupta
1/4R-b R-b
2/4R-b R-b
3/4R-b
4/4R-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v4 thread

Cover letter [PATCH v4 0/4] x86/cpu: Take Intel platform into account for old microcode checks

Chagnes from v3:
* Fix handling of the Pentium II's "no platform" goofiness.
Note: this was found in a Github Copilot review of the series. I wrote the solution.
* Rebase to 7.0-rc2

Changes from v2:
* Move new helpers from .h into .c file. This avoids the #include dependency issues for now. That can be dealt with another day.
* Rename x86_platform_id to have an intel_ prefix and add a union to make it clear that AMD can use the space for something else

Changes from v1:
* Fix non-x86 PECI compile issues by lifting some x86 macros into an arch-independent header.
* Make intel_get_platform_id() match its name and return an ID, not a mask.
* Sort #includes
* Move ->x86_platform_id comment

The platform ID vs. platform mask confusion meant that v1 worked by total accident. If you tested v1, I'd really appreciate you retest this as well.

--

There was a report[1] that CPUs running updated microcode were being reported as running old microcode. The reason is that the old microcode list neglects to take the platform ID into account.

The platform ID is an Intel-only construct that allows CPUs that otherwise have the same model/family/stepping to take different microcode revisions. The microcode loader itself already checks this. Only the recent "old_microcode" checker failed here.

Treat the platform ID as a peer of model/family/stepping. Store it in 'struct cpuinfo_x86', enable matching on it with with 'struct x86_cpu_id', and flesh out the 'old_microcode' list with it.

This fixes the report of an inaccurate, false positive in the 'old_microcode' vulnerability file.

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

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Dave Hansen <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Tony Luck <[email protected]>
Cc Pawan Gupta <[email protected]>
Cc "Peter Zijlstra (Intel)" <[email protected]>
Cc Jon Kohler <[email protected]>
 arch/x86/include/asm/microcode.h                 |    2 
 arch/x86/include/asm/processor.h                 |    5 
 arch/x86/kernel/cpu/intel.c                      |    1 
 arch/x86/kernel/cpu/match.c                      |    3 
 arch/x86/kernel/cpu/microcode/intel-ucode-defs.h |  398 +++++++++++++----------
 arch/x86/kernel/cpu/microcode/intel.c            |   55 ++-
 include/linux/mod_devicetable.h                  |    2 
 7 files changed, 294 insertions(+), 172 deletions(-)