From patchwork Tue Oct 24 13:21:03 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: 157464 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1938490vqx; Tue, 24 Oct 2023 06:23:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHJENi420G9vNO0mgr/Vk6BW0SJ17m0BjQF5+rz9VbMolOHgwTV/7LBK6DNPgL80n1QucId X-Received: by 2002:a05:6a00:174c:b0:6ba:2ba7:b9cb with SMTP id j12-20020a056a00174c00b006ba2ba7b9cbmr14233758pfc.12.1698153828390; Tue, 24 Oct 2023 06:23:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698153828; cv=none; d=google.com; s=arc-20160816; b=o0hDUUznZMw7c+3K28lzCmAICQtn4rtCN9z3jFx0VP4v6fOYkNDgp76TcxMFzC/UjC 4PK2UryDuhdntMdB6s4e8GwG2mANqQMEKtfpU46T1h9k6vLocpc0LRupu/c7ciyIUR4t SsKPtcH56GuFL3t+umRpd9K9a0nYNBPn/L/BJ2ZhtS40KMQFML3l5S678yZTKclwxhnU rHNzS3uPXZC4P8CY2x6xq4bh73gUkab3fmot3ntY+Kyg80FBIBFiK917UgwOmZxQ9WSA EKfYE79EiXUrSyfYZDbg0/n9q5hiRqGG9tscaHDR6ok0T7HTixZ/pcX+XITCpcJI4jiZ ZpQA== 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=RHkCXTH24NyaO/g37ph9L853bwbDbAPXpoqm9V4BbAI=; fh=LWlv3U+xZ3+vQt4tlJRIlKl5VzN7iFjjE/bzRmlxKDA=; b=FVQikHLEgAAD55Hmxw5TT//96epPac/dIozGgZ9gH+gyw/RJ4YXzhdFSinjMfraW9t LsjOmdFyjcWVwQAzi/pkVxg7Qejf3HN0Hg/buEfy77oQ79zSUjXAkMy5CRdC1ScI0ncO oiI42MqQoNPc8KOfy+JgQ+ivDm4i1wSZsYwe7WMRjaK9u968nCiJV+EUESOOWsque8xX DZmsbssIh+Z3E9ZV6dIeYWBdMOL09sRV+xyRL5FREskjKw9poU4mOCK6NpusINiW4hox WqJB+5oF8g7U8p86dCeHRuCctNvNaiMIJ/mrOSXdXZhkW29Jbo2fMD7V/DrUuiuaueQw F1tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=xQrIyTAM; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id s130-20020a637788000000b0057cf9be76c2si8623852pgc.580.2023.10.24.06.23.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 06:23:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=xQrIyTAM; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 114B380A49A9; Tue, 24 Oct 2023 06:23:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234701AbjJXNWx (ORCPT + 26 others); Tue, 24 Oct 2023 09:22:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234592AbjJXNWC (ORCPT ); Tue, 24 Oct 2023 09:22:02 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F17901996; Tue, 24 Oct 2023 06:21:06 -0700 (PDT) Date: Tue, 24 Oct 2023 13:21:03 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1698153664; 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=RHkCXTH24NyaO/g37ph9L853bwbDbAPXpoqm9V4BbAI=; b=xQrIyTAMZ/ywRVTrsjvQRwpa91AihXbpMK8KLqDJDITxQY4yhBGP3T5JiCpwP5CeTKcui6 rTIdE47NepxgymCPvWw2NYdYzVylsIuZo5xGhRoKhs3QUktEHiHT5IwXVhivL2taOX6Pdq mp3ebjtNIa2VpYoJbVQCqni7RiwI1Q9dGKABWWRpiUfrhjrT5sV2ofesepsO8KG2BFbkgj AgtqP+AyFhmzQlV7GjzQNIdnHlrA5Gw9bA/NLXxLeNduRvJ+KALN/WwWSQ8qUwKjq7eBtV 3WdPYFF0eFmSEY3Xgth25plgyeko/WsZMaHyUSH9Dt2pvH3K69Dms53syTZ1Zw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1698153664; 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=RHkCXTH24NyaO/g37ph9L853bwbDbAPXpoqm9V4BbAI=; b=MP2aJJr7GuokitrlMyBFfIAsrFHIw8LwL3C0C/C65fB2kpc+LezgedJEivO40X+MpZKDNi yc7Pm1wqYfTvKzDg== From: "tip-bot2 for Thomas Gleixner" 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: Use correct per CPU ucode_cpu_info Cc: Thomas Gleixner , "Borislav Petkov (AMD)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231010150702.433454320@linutronix.de> References: <20231010150702.433454320@linutronix.de> MIME-Version: 1.0 Message-ID: <169815366328.3135.16050455974212164815.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 24 Oct 2023 06:23:35 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779381626905443552 X-GMAIL-MSGID: 1780643348846963521 The following commit has been merged into the x86/microcode branch of tip: Commit-ID: ecfd41089348fa4cc767dc588367e9fdf8cb6b9d Gitweb: https://git.kernel.org/tip/ecfd41089348fa4cc767dc588367e9fdf8cb6b9d Author: Thomas Gleixner AuthorDate: Tue, 10 Oct 2023 17:08:41 +02:00 Committer: Borislav Petkov (AMD) CommitterDate: Tue, 24 Oct 2023 15:05:54 +02:00 x86/microcode/amd: Use correct per CPU ucode_cpu_info find_blobs_in_containers() is invoked on every CPU but overwrites unconditionally 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 Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231010150702.433454320@linutronix.de --- arch/x86/kernel/cpu/microcode/amd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c index b827390..56d8bd6 100644 --- 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(unsigned int cpuid_1_eax, struct cpio_data if (!get_builtin_microcode(&cp, x86_family(cpuid_1_eax))) cp = find_microcode_in_initrd(ucode_path); - /* Needed in load_microcode_amd() */ - ucode_cpu_info->cpu_sig.sig = cpuid_1_eax; - *ret = cp; } @@ -513,6 +510,9 @@ static void apply_ucode_from_containers(unsigned int cpuid_1_eax) { struct cpio_data cp = { }; + /* Needed in load_microcode_amd() */ + ucode_cpu_info[smp_processor_id()].cpu_sig.sig = cpuid_1_eax; + find_blobs_in_containers(cpuid_1_eax, &cp); if (!(cp.data && cp.size)) return;