From nobody Fri Jan 2 16:44:03 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53886CD8CA8 for ; Tue, 10 Oct 2023 15:09:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233389AbjJJPI4 (ORCPT ); Tue, 10 Oct 2023 11:08:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233294AbjJJPIv (ORCPT ); Tue, 10 Oct 2023 11:08:51 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E8F9B7 for ; Tue, 10 Oct 2023 08:08:45 -0700 (PDT) Message-ID: <20231010150702.433454320@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1696950522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=/dRmcfKTBD1nPb/bBtlpyqt18JVyxAdIVX4toDGASiY=; b=DzcjhKjec/HHmzId8VVPKDDwwFMm/I+4Yd/trZfPPuxIgG+eObrHAnLgf0/u2vF2ZJoSJ1 xqqmNksAUH2KKabDwfwHcceeYK9fDzwvc7QxQqOxkR4LtLQRq6c9gdpOKVspbQq7nEZYPV h58lNiXIQGpkHkmBi5T/lVX+phVETaWnmodWj7dstXfMboi1lk7SyBiyoZQb6/xvgwJ7Sl 66XmQFXS0wnfJPjLAuK14jws7qITYQ/URCZyTF82JJFyLQRXQLPcsWU6mmZrWGBwvKVETF Dic3its1C/wUQpG88IbFXkXOP4kFsWZ1ItzKRXREtZWzlgD1skc4S6K55IugAg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1696950522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=/dRmcfKTBD1nPb/bBtlpyqt18JVyxAdIVX4toDGASiY=; b=IGTbKaraLoDpbolKmIG2d1HTGDgUpBWIx+aPe56XLk/PWuYYQEMayKIqnWQR1A4s8uUGdu DN/k2H6kz754k4BQ== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Borislav Petkov Subject: [patch 1/5] x86/microcode/amd: Use correct per CPU ucode_cpu_info References: <20231010145130.987300357@linutronix.de> MIME-Version: 1.0 Date: Tue, 10 Oct 2023 17:08:41 +0200 (CEST) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" find_blobs_in_containers() is invoked on every CPU but overwrites uncoditionally 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 --- arch/x86/kernel/cpu/microcode/amd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/arch/x86/kernel/cpu/microcode/amd.c +++ b/arch/x86/kernel/cpu/microcode/amd.c @@ -503,9 +503,6 @@ static void find_blobs_in_containers(uns if (!get_builtin_microcode(&cp, x86_family(cpuid_1_eax))) cp =3D find_microcode_in_initrd(ucode_path); =20 - /* Needed in load_microcode_amd() */ - ucode_cpu_info->cpu_sig.sig =3D cpuid_1_eax; - *ret =3D cp; } =20 @@ -513,6 +510,9 @@ static void apply_ucode_from_containers( { struct cpio_data cp =3D { }; =20 + /* Needed in load_microcode_amd() */ + ucode_cpu_info[smp_processor_id()].cpu_sig.sig =3D cpuid_1_eax; + find_blobs_in_containers(cpuid_1_eax, &cp); if (!(cp.data && cp.size)) return;