From patchwork Mon Feb 6 13:00:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 53228 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2224874wrn; Mon, 6 Feb 2023 05:09:40 -0800 (PST) X-Google-Smtp-Source: AK7set9p4UKFbPotJmC2uRvHhrepQmUb+fda+wZFgK/gN888SM2qT+UPExQECQuWU2Vi2ENHXdVl X-Received: by 2002:a05:6a21:86a7:b0:bf:a57b:6a16 with SMTP id ox39-20020a056a2186a700b000bfa57b6a16mr12839056pzb.45.1675688980445; Mon, 06 Feb 2023 05:09:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675688980; cv=none; d=google.com; s=arc-20160816; b=AqTJKC959icSKxHLqcZiw+xc35BnRDVi17OVOCZ7ATksFzSkr62+3wGOtdQ650xZZz ydAfYB1oSnU8B/wX/HFpcSsHwgWSDywRFj8cOd4o7KbGGzWNAUKoXy7xES/kDNcbKDSE RgfrwNQ2fKvqKxLp6jv5nr1eD2f4Szbf3z62c8lmQb/8TxvXhr9pHbEkl68ZwH96mwVC ASlySv/G9yPFpHDIPvR9+grF3JMr5JERe3oW9aPT6Mm50GnR8WgDFD5fUZhVgUggeOph ajSMV++81jkhfMofujC4cPfhXRwLUZtFtg7HpfmMu27Zgc1DzmczF/jj4C3NkMav6KOx mDjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=zPPSWF1IR2b3xSpi294gSyVTszfWLwynEyv+R7qzIpM=; b=Ro7Awn2sj4qTO+ZAER66FlC3WN+hNfO6XkknR+So0xCSiTxhhUFDnEHgTAIt0owkk5 7gXbes5jqVfEbW0AEyoJQtf6TIvZfi5K8yJRxYEQQxo0PqSCySb2E9PRMDBVBEGZjVoV RRo9WVY1CkIbWWc83XPOc/upvoeOIEWfz4qePjyM+6BccHiUhMFjFUOGkvSpoENLK4iV LFrLRfGsZ4qroOzIH3pev4wNShrFxN5K0Od52ffDde8JbTK5dptuDUpZgu3kjSfgweIp mRNa6Z8rTe4qQinFjIp756cWqC+f8xhAXB77JiUuy2UnmVo6T/wrlf+iNjOsKkAwWA7z SMAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="x/Xwi1fA"; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u69-20020a638548000000b004fac1169a7esi6283208pgd.284.2023.02.06.05.09.19; Mon, 06 Feb 2023 05:09:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="x/Xwi1fA"; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230196AbjBFNAS (ORCPT + 99 others); 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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756465695174159866?= X-GMAIL-MSGID: =?utf-8?q?1757087248010422411?= The following commit has been merged into the x86/microcode branch of tip: Commit-ID: 2355370cd941cbb20882cc3f34460f9f2b8f9a18 Gitweb: https://git.kernel.org/tip/2355370cd941cbb20882cc3f34460f9f2b8f9a18 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/microcode/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); } -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); 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 cpuid_1_eax) if (!desc.mc) return -EINVAL; - ret = load_microcode_amd(true, x86_family(cpuid_1_eax), desc.data, desc.size); + ret = load_microcode_amd(x86_family(cpuid_1_eax), desc.data, desc.size); if (ret > UCODE_UPDATED) return -EINVAL; @@ -851,8 +850,7 @@ static enum ucode_state __load_microcode_amd(u8 family, const u8 *data, return UCODE_OK; } -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 *data, size_t size) ret = UCODE_NEW; } - /* 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)); @@ -906,14 +900,9 @@ static enum ucode_state request_microcode_amd(int cpu, struct device *device) { char fw_name[36] = "amd-ucode/microcode_amd.bin"; struct cpuinfo_x86 *c = &cpu_data(cpu); - bool bsp = c->cpu_index == boot_cpu_data.cpu_index; enum ucode_state ret = UCODE_NFOUND; const struct firmware *fw; - /* reload ucode container only on the boot cpu */ - if (!bsp) - return UCODE_OK; - if (c->x86 >= 0x15) snprintf(fw_name, sizeof(fw_name), "amd-ucode/microcode_amd_fam%.2xh.bin", c->x86); @@ -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; - ret = load_microcode_amd(bsp, c->x86, fw->data, fw->size); + ret = load_microcode_amd(c->x86, fw->data, fw->size); fw_release: release_firmware(fw);