From patchwork Fri Oct 28 14:26:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 12350 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp864865wru; Fri, 28 Oct 2022 07:31:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5wpeeuVc3In91dJvkqqybPyrEJWV9s0h3rh+0mkpZwrqX+Hmtoko18jjt7gzHUPxRRjt11 X-Received: by 2002:a17:902:7446:b0:186:a3a1:782d with SMTP id e6-20020a170902744600b00186a3a1782dmr28125117plt.76.1666967506702; Fri, 28 Oct 2022 07:31:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666967506; cv=none; d=google.com; s=arc-20160816; b=nagtDGoGXu/7Z2zIbqSdrLwaWnqOGXCgwFF80NTKBeMaa2devpavR1RViPxH95rBd9 +5vSVT1QfH+5d2233SzLcvvbLsNLF1uzHtTSAMGTkLsrozfoe/LRycHYbOXQlxdWlw6r rhqkSJ+IJxJSxpFBQVNCqPoKzf2845uBWqnFZ9hGLPOxkGLJwsR4J8860NnZCHkQWKEE 1yUWHRr/7CKDRonkDtF60wKaUkEDrcQz+tawd16xUACWNU4DS0vvsjtGIMgx2FW31bIC 09GqOH70+xP7q2mS1znE/rgBlFjm6zC67kp+bB9dEOwqhr8p3ZEmWCnnRffDZnxhWfcX WOFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QJIf89KSwzJWm9JqbRoQ+vSQXO2nZLHSd4du3DdJICo=; b=Caj+EIbalKlLQjFutxW+24YtUwBn5biV0J6MHLNNfGg7B+UnyBSKpKhoQgK7h5ew5w CfyV3Uki/PTq7QnMaeAASfQDBXKWB3SjoKR88OKU/gTZQwShYXwPCkwEaMLen1hzOi6Y Pba5sYfeX9+sB/qmewiy9bU0bDyI0YC8xKT9WaOfSC0dR/AcZ2hMSOwyISF32LdWIPLw 1J9IeWaT0sOP+i6cX0Kwzf7ZffWxDhevm6ohq1bvLCGX2whFiOlKS8R/uo2RF4CBg6sj mULT8DnY/vT7OkXctUNGtKBQF/Gigvwp6JHiBrtJmPAYU/KVIsRNi9yn9CKrnkvutPPC +56w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=l2sh8wzl; 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=NONE dis=NONE) header.from=alien8.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q64-20020a634343000000b00453d2790c49si2384632pga.11.2022.10.28.07.31.33; Fri, 28 Oct 2022 07:31:46 -0700 (PDT) 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=@alien8.de header.s=dkim header.b=l2sh8wzl; 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=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230462AbiJ1O2D (ORCPT + 99 others); Fri, 28 Oct 2022 10:28:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230482AbiJ1O1X (ORCPT ); Fri, 28 Oct 2022 10:27:23 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95C517E028 for ; Fri, 28 Oct 2022 07:26:48 -0700 (PDT) Received: from zn.tnic (p200300ea9733e7ce329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9733:e7ce:329c:23ff:fea6:a903]) (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 414261EC072E; Fri, 28 Oct 2022 16:26:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1666967207; 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=QJIf89KSwzJWm9JqbRoQ+vSQXO2nZLHSd4du3DdJICo=; b=l2sh8wzlwUyITJW1IwqsQNYoMAxHJabFqa9JcBCzsoMFU6FytznN4AvqxCYCF308eyMISO uxQXjX8ASrYzDN72pmNWB0lDUdWX6BTFZiQA0cev1fDp6gyIjeVb7qsUTca6mW2ZJjiC5X uBcnqPhrUvvUWez+onMJ4eF/fhqLbdQ= From: Borislav Petkov To: Ashok Raj Cc: X86 ML , LKML Subject: [PATCH 3/5] x86/microcode: Kill refresh_fw Date: Fri, 28 Oct 2022 16:26:36 +0200 Message-Id: <20221028142638.28498-4-bp@alien8.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221028142638.28498-1-bp@alien8.de> References: <20221028142638.28498-1-bp@alien8.de> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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?1747942120312507130?= X-GMAIL-MSGID: =?utf-8?q?1747942120312507130?= From: Borislav Petkov request_microcode_fw() can always request firmware now so drop this superfluous argument. Signed-off-by: Borislav Petkov --- arch/x86/include/asm/microcode.h | 3 +-- arch/x86/kernel/cpu/microcode/amd.c | 5 ++--- arch/x86/kernel/cpu/microcode/core.c | 2 +- arch/x86/kernel/cpu/microcode/intel.c | 3 +-- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/arch/x86/include/asm/microcode.h b/arch/x86/include/asm/microcode.h index 74ecc2bd6cd0..d4c36fbd1d39 100644 --- a/arch/x86/include/asm/microcode.h +++ b/arch/x86/include/asm/microcode.h @@ -33,8 +33,7 @@ enum ucode_state { }; struct microcode_ops { - enum ucode_state (*request_microcode_fw) (int cpu, struct device *, - bool refresh_fw); + enum ucode_state (*request_microcode_fw) (int cpu, struct device *); void (*microcode_fini_cpu) (int cpu); diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c index e7410e98fc1f..b103d5e5f447 100644 --- a/arch/x86/kernel/cpu/microcode/amd.c +++ b/arch/x86/kernel/cpu/microcode/amd.c @@ -891,8 +891,7 @@ load_microcode_amd(bool save, u8 family, const u8 *data, size_t size) * * These might be larger than 2K. */ -static enum ucode_state request_microcode_amd(int cpu, struct device *device, - bool refresh_fw) +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); @@ -901,7 +900,7 @@ static enum ucode_state request_microcode_amd(int cpu, struct device *device, const struct firmware *fw; /* reload ucode container only on the boot cpu */ - if (!refresh_fw || !bsp) + if (!bsp) return UCODE_OK; if (c->x86 >= 0x15) diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c index 63f7678743be..7c41e0132fa1 100644 --- a/arch/x86/kernel/cpu/microcode/core.c +++ b/arch/x86/kernel/cpu/microcode/core.c @@ -477,7 +477,7 @@ static ssize_t reload_store(struct device *dev, if (ret) goto put; - tmp_ret = microcode_ops->request_microcode_fw(bsp, µcode_pdev->dev, true); + tmp_ret = microcode_ops->request_microcode_fw(bsp, µcode_pdev->dev); if (tmp_ret != UCODE_NEW) goto put; diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c index 1fcbd671f1df..8c35c70029bf 100644 --- a/arch/x86/kernel/cpu/microcode/intel.c +++ b/arch/x86/kernel/cpu/microcode/intel.c @@ -885,8 +885,7 @@ static bool is_blacklisted(unsigned int cpu) return false; } -static enum ucode_state request_microcode_fw(int cpu, struct device *device, - bool refresh_fw) +static enum ucode_state request_microcode_fw(int cpu, struct device *device) { struct cpuinfo_x86 *c = &cpu_data(cpu); const struct firmware *firmware;