]> git.dujemihanovic.xyz Git - linux.git/commit
x86/CPU/AMD: Check vendor in the AMD microcode callback
authorBorislav Petkov (AMD) <bp@alien8.de>
Fri, 1 Dec 2023 18:37:27 +0000 (19:37 +0100)
committerBorislav Petkov (AMD) <bp@alien8.de>
Sat, 2 Dec 2023 10:40:24 +0000 (11:40 +0100)
commit9b8493dc43044376716d789d07699f17d538a7c4
treee9c41860c984bb5c3e2b0ce63c815784a528ddad
parent27d25348d42161837be08fc63b04a2559d2e781c
x86/CPU/AMD: Check vendor in the AMD microcode callback

Commit in Fixes added an AMD-specific microcode callback. However, it
didn't check the CPU vendor the kernel runs on explicitly.

The only reason the Zenbleed check in it didn't run on other x86 vendors
hardware was pure coincidental luck:

  if (!cpu_has_amd_erratum(c, amd_zenbleed))
  return;

gives true on other vendors because they don't have those families and
models.

However, with the removal of the cpu_has_amd_erratum() in

  05f5f73936fa ("x86/CPU/AMD: Drop now unused CPU erratum checking function")

that coincidental condition is gone, leading to the zenbleed check
getting executed on other vendors too.

Add the explicit vendor check for the whole callback as it should've
been done in the first place.

Fixes: 522b1d69219d ("x86/cpu/amd: Add a Zenbleed fix")
Cc: <stable@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20231201184226.16749-1-bp@alien8.de
arch/x86/kernel/cpu/amd.c