Skip to content

Commit ecfd410

Browse files
KAGA-KOKObp3tk0v
authored andcommitted
x86/microcode/amd: Use correct per CPU ucode_cpu_info
find_blobs_in_containers() is invoked on every CPU but overwrites unconditionally ucode_cpu_info of CPU0. Fix this by using the proper CPU data and move the assignment into the call site apply_ucode_from_containers() so that the function can be reused. Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent b48b26f commit ecfd410

File tree

1 file changed

+3
-3
lines changed
  • arch/x86/kernel/cpu/microcode

1 file changed

+3
-3
lines changed

arch/x86/kernel/cpu/microcode/amd.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -503,16 +503,16 @@ static void find_blobs_in_containers(unsigned int cpuid_1_eax, struct cpio_data
503503
if (!get_builtin_microcode(&cp, x86_family(cpuid_1_eax)))
504504
cp = find_microcode_in_initrd(ucode_path);
505505

506-
/* Needed in load_microcode_amd() */
507-
ucode_cpu_info->cpu_sig.sig = cpuid_1_eax;
508-
509506
*ret = cp;
510507
}
511508

512509
static void apply_ucode_from_containers(unsigned int cpuid_1_eax)
513510
{
514511
struct cpio_data cp = { };
515512

513+
/* Needed in load_microcode_amd() */
514+
ucode_cpu_info[smp_processor_id()].cpu_sig.sig = cpuid_1_eax;
515+
516516
find_blobs_in_containers(cpuid_1_eax, &cp);
517517
if (!(cp.data && cp.size))
518518
return;

0 commit comments

Comments
 (0)