From nobody Sat Sep 13 22:24:26 2025 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 70FFAC54EAA for ; Mon, 30 Jan 2023 16:17:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235784AbjA3QRW (ORCPT ); Mon, 30 Jan 2023 11:17:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230202AbjA3QRT (ORCPT ); Mon, 30 Jan 2023 11:17:19 -0500 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CC772726 for ; Mon, 30 Jan 2023 08:17:17 -0800 (PST) Received: from zn.tnic (p5de8e9fe.dip0.t-ipconnect.de [93.232.233.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 18EBB1EC0645; Mon, 30 Jan 2023 17:17:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1675095436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1SYkUvMceHmQv4CWJzaHm7dllYvbghnGU+k2S37WGWE=; b=PQabSffDgDJpaBVkhERnOz7WPcn3aTjUShARnx32aKil7Q30xd3/zFlTIULwGVFVRWo1RN qqgZ+nvPKKszrV0tU9tmMK2RBb7kFz2p1PlfAJy7DNDeQKVZ9frANGhVcV1DcthLo0YHz5 IFdorUK/5e1zoYiMmJMAtOeyYvrEWOE= From: Borislav Petkov To: X86 ML Cc: LKML Subject: [PATCH 1/4] x86/microcode/amd: Remove load_microcode_amd()'s bsp parameter Date: Mon, 30 Jan 2023 17:17:06 +0100 Message-Id: <20230130161709.11615-2-bp@alien8.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230130161709.11615-1-bp@alien8.de> References: <20230130161709.11615-1-bp@alien8.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: "Borislav Petkov (AMD)" It is always the BSP. No functional changes. Signed-off-by: Borislav Petkov (AMD) --- arch/x86/kernel/cpu/microcode/amd.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/micr= ocode/amd.c index 56471f750762..f41ea46475ac 100644 --- a/arch/x86/kernel/cpu/microcode/amd.c +++ b/arch/x86/kernel/cpu/microcode/amd.c @@ -553,8 +553,7 @@ void load_ucode_amd_ap(unsigned int cpuid_1_eax) apply_microcode_early_amd(cpuid_1_eax, cp.data, cp.size, false); } =20 -static enum ucode_state -load_microcode_amd(bool save, u8 family, const u8 *data, size_t size); +static enum ucode_state load_microcode_amd(u8 family, const u8 *data, size= _t size); =20 int __init save_microcode_in_initrd_amd(unsigned int cpuid_1_eax) { @@ -572,7 +571,7 @@ int __init save_microcode_in_initrd_amd(unsigned int cp= uid_1_eax) if (!desc.mc) return -EINVAL; =20 - ret =3D load_microcode_amd(true, x86_family(cpuid_1_eax), desc.data, desc= .size); + ret =3D load_microcode_amd(x86_family(cpuid_1_eax), desc.data, desc.size); if (ret > UCODE_UPDATED) return -EINVAL; =20 @@ -850,8 +849,7 @@ static enum ucode_state __load_microcode_amd(u8 family,= const u8 *data, return UCODE_OK; } =20 -static enum ucode_state -load_microcode_amd(bool save, u8 family, const u8 *data, size_t size) +static enum ucode_state load_microcode_amd(u8 family, const u8 *data, size= _t size) { struct ucode_patch *p; enum ucode_state ret; @@ -875,10 +873,6 @@ load_microcode_amd(bool save, u8 family, const u8 *dat= a, size_t size) ret =3D UCODE_NEW; } =20 - /* save BSP's matching patch for early load */ - if (!save) - return ret; - memset(amd_ucode_patch, 0, PATCH_MAX_SIZE); memcpy(amd_ucode_patch, p->data, min_t(u32, p->size, PATCH_MAX_SIZE)); =20 @@ -905,14 +899,9 @@ static enum ucode_state request_microcode_amd(int cpu,= struct device *device) { char fw_name[36] =3D "amd-ucode/microcode_amd.bin"; struct cpuinfo_x86 *c =3D &cpu_data(cpu); - bool bsp =3D c->cpu_index =3D=3D boot_cpu_data.cpu_index; enum ucode_state ret =3D UCODE_NFOUND; const struct firmware *fw; =20 - /* reload ucode container only on the boot cpu */ - if (!bsp) - return UCODE_OK; - if (c->x86 >=3D 0x15) snprintf(fw_name, sizeof(fw_name), "amd-ucode/microcode_amd_fam%.2xh.bin= ", c->x86); =20 @@ -925,7 +914,7 @@ static enum ucode_state request_microcode_amd(int cpu, = struct device *device) if (!verify_container(fw->data, fw->size, false)) goto fw_release; =20 - ret =3D load_microcode_amd(bsp, c->x86, fw->data, fw->size); + ret =3D load_microcode_amd(c->x86, fw->data, fw->size); =20 fw_release: release_firmware(fw); --=20 2.35.1