]> git.baikalelectronics.ru Git - kernel.git/commit
x86/microcode/AMD: Apply the patch early on every logical thread
authorBorislav Petkov <bp@suse.de>
Wed, 5 Oct 2022 10:00:08 +0000 (12:00 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 29 Oct 2022 08:20:34 +0000 (10:20 +0200)
commitce089cdf8950d3a079de0e598802023ff5387ea2
treecdd296e714eea80a5a6905c2ced98d319c715e72
parent4ed280d9fa79e24f0349278a59ee33d58bb1f6c4
x86/microcode/AMD: Apply the patch early on every logical thread

commit af86df31c6fa8c7a0ee948df012e5af7a4304d50 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: 3f703fdbc470 ("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>
arch/x86/kernel/cpu/microcode/amd.c