From nobody Sat Sep 13 01:55:45 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 1E1B1C05027 for ; Mon, 6 Feb 2023 13:00:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230234AbjBFNAS (ORCPT ); Mon, 6 Feb 2023 08:00:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230202AbjBFNAL (ORCPT ); Mon, 6 Feb 2023 08:00:11 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0CC323329; Mon, 6 Feb 2023 05:00:09 -0800 (PST) Date: Mon, 06 Feb 2023 13:00:06 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1675688406; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zPPSWF1IR2b3xSpi294gSyVTszfWLwynEyv+R7qzIpM=; b=x/Xwi1fALjBqNYEHLVG22nlw03tsfhyL5Fr6JnQke2X5IdLuK22/Fws+yPdUWaGRule0qx uw3hHewaOGTuIbhN8zeUj+bc8O0leL+nBOe0c+462Q+4KOYgEvvI7dHf8GuFCmCkMenMJ4 gPEovob00xjkDKrYEwcQj74HDZYwfj+ccTa5nHe+/0sr6IVz/WFriCbjYoYuk/hQkp3RDX Tf1ZAKoxJlaZDgv8GLxq+5D0YpLpOkgtg11CRctuE9a4hkteZafabfzV4oGY3VMkbJzi2W 8XYXesMOMODLIxP95E+VOefPp+/uvBapaSTTvtu3ZUOlyZzpeIb1SVZy8rtS/Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1675688406; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zPPSWF1IR2b3xSpi294gSyVTszfWLwynEyv+R7qzIpM=; b=pjny2TDUwOkKx8H/FTCDpQfLlAXMjvoS1lhDXanTx9EjAdKcXPSxD2FCn4RBjB6NfqNdn3 B4ThcAy2ft0XTSDQ== From: "tip-bot2 for Borislav Petkov (AMD)" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/microcode] x86/microcode/amd: Remove load_microcode_amd()'s bsp parameter Cc: "Borislav Petkov (AMD)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230130161709.11615-2-bp@alien8.de> References: <20230130161709.11615-2-bp@alien8.de> MIME-Version: 1.0 Message-ID: <167568840642.4906.3159553171121184156.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/microcode branch of tip: Commit-ID: 2355370cd941cbb20882cc3f34460f9f2b8f9a18 Gitweb: https://git.kernel.org/tip/2355370cd941cbb20882cc3f34460f9f2= b8f9a18 Author: Borislav Petkov (AMD) AuthorDate: Tue, 17 Jan 2023 23:59:24 +01:00 Committer: Borislav Petkov (AMD) CommitterDate: Mon, 06 Feb 2023 11:13:04 +01:00 x86/microcode/amd: Remove load_microcode_amd()'s bsp parameter It is always the BSP. No functional changes. Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230130161709.11615-2-bp@alien8.de --- 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 d144f91..c2ac6c4 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) early_apply_microcode(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 @@ -851,8 +850,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; @@ -876,10 +874,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 @@ -906,14 +900,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 @@ -926,7 +915,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);