linux/arch
Borislav Petkov 0fb04676c4 x86/microcode/AMD: Apply the patch early on every logical thread
commit e7ad18d116 upstream.

Currently, the patch application logic checks whether the revision
needs to be applied on each logical CPU (SMT thread). Therefore, on SMT
designs where the microcode engine is shared between the two threads,
the application happens only on one of them as that is enough to update
the shared microcode engine.

However, there are microcode patches which do per-thread modification,
see Link tag below.

Therefore, drop the revision check and try applying on each thread. This
is what the BIOS does too so this method is very much tested.

Btw, change only the early paths. On the late loading paths, there's no
point in doing per-thread modification because if is it some case like
in the bugzilla below - removing a CPUID flag - the kernel cannot go and
un-use features it has detected are there early. For that, one should
use early loading anyway.

  [ bp: Fixes does not contain the oldest commit which did check for
    equality but that is good enough. ]

Fixes: 8801b3fcb5 ("x86/microcode/AMD: Rework container parsing")
Reported-by:  Ștefan Talpalaru <stefantalpalaru@yahoo.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Tested-by:  Ștefan Talpalaru <stefantalpalaru@yahoo.com>
Cc: <stable@vger.kernel.org>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216211
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-10-30 09:41:15 +01:00
..
alpha tty: the rest, stop using tty_schedule_flip() 2022-07-29 17:19:28 +02:00
arc ARC: entry: fix syscall_trace_exit argument 2022-04-27 13:53:55 +02:00
arm ARM: dts: imx6sx: add missing properties for sram 2022-10-26 13:25:51 +02:00
arm64 arm64: topology: fix possible overflow in amu_fie_setup() 2022-10-26 13:25:55 +02:00
c6x
csky csky/kprobe: reclaim insn_slot on kprobe unregistration 2022-08-25 11:38:16 +02:00
h8300
hexagon hexagon: select ARCH_WANT_LD_ORPHAN_WARN 2022-08-21 15:15:33 +02:00
ia64 ia64: export memory_add_physaddr_to_nid to fix cxl build error 2022-10-26 13:25:29 +02:00
m68k Revert "m68knommu: only set CONFIG_ISA_DMA_API for ColdFire sub-arch" 2022-07-29 17:19:09 +02:00
microblaze uaccess: fix nios2 and microblaze get_user_8() 2022-04-08 14:40:08 +02:00
mips MIPS: BCM47XX: Cast memcmp() of function to (void *) 2022-10-26 13:25:44 +02:00
nds32 nds32: fix access_ok() checks in get/put_user 2022-03-28 09:57:10 +02:00
nios2 nios2: add force_successful_syscall_return() 2022-08-25 11:38:04 +02:00
openrisc openrisc: start CPU timer early in boot 2022-06-09 10:20:55 +02:00
parisc parisc: Flush kernel data mapping in set_pte_at() when installing pte for user page 2022-09-23 14:16:56 +02:00
powerpc powerpc: Fix SPE Power ISA properties for e500v1 platforms 2022-10-26 13:25:41 +02:00
riscv riscv: Pass -mno-relax only on lld < 15.0.0 2022-10-26 13:25:10 +02:00
s390 s390: fix nospec table alignments 2022-09-08 11:11:40 +02:00
sh sh: machvec: Use char[] for section boundaries 2022-10-26 13:25:17 +02:00
sparc sparc: use fallback for random_get_entropy() instead of zero 2022-05-30 09:33:42 +02:00
um UM: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK 2022-10-26 13:25:10 +02:00
x86 x86/microcode/AMD: Apply the patch early on every logical thread 2022-10-30 09:41:15 +01:00
xtensa xtensa: iss: fix handling error cases in iss_net_configure() 2022-08-21 15:15:59 +02:00
.gitignore
Kconfig