From patchwork Wed Oct 11 09:01: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: 151220 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp394888vqb; Wed, 11 Oct 2023 02:01:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHW/77Z68i4Kor3dQ9B+ZP4g8LOFyN9RLiXOLdr/4emUWCifoogzfgeF0EfQphAKmHumMdU X-Received: by 2002:a17:90a:3c8f:b0:269:34a6:d4ca with SMTP id g15-20020a17090a3c8f00b0026934a6d4camr18269631pjc.0.1697014897128; Wed, 11 Oct 2023 02:01:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697014897; cv=none; d=google.com; s=arc-20160816; b=o64SFOw70XpUZKjNbYC+tUoP8+7nqHO2RU+VuUE3ApLwvDA+V0vF6HxGe85Q1iOEno qHqaODAfIyrizq7xk34khCtrL0PscIEexA7xndhzclCX2eA1QBLw6YbWHTkmegbJ0Df6 1+77hcxn6KQEpi8OP9ROSDgrN6pTivJd+jkI+0eWWXHOZ6eGGDurvebctosOFnpxXRsl qC7a0cco2t40+dc5MAnVRrt9GJUqc4PecMzhGTMZliqi9rUhY0qd5Trn0cVQUuE0HUdt sCyo4+cBwLaGOYvM5CeETUWwktl8abja991rNEKgQ6SYHRbvDctYPXdTHoitX8z4gyKq xPzA== 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=9+W7LmK13kuQHjba0aXrO/nn+kMn14TbwlhICOETVIY=; fh=LWlv3U+xZ3+vQt4tlJRIlKl5VzN7iFjjE/bzRmlxKDA=; b=z8+KJ5M1QwwYmAsIKAFwnrGYP27RyIBx/5NPzOw0sIV6iJoBFNYXmxbFHg+AHeq21c jfgSjPA8QnI2vqsmOiG7gQdHnfDjQBKYJVgADFQ+cKr+PzrWyyFOZowDyxT0XajrC7t3 6ICcdTi04mMHfsNqzRuomXZmZ17SuAhz/cON5I/3YdEPynXyCAt1r876P8kEvYccQ8o+ XN95ZTFwCpWtmVhOEDRZLpo3+3QMwAAMxUD+pzKo6ibiE9j21XoWo8abUBi9Xd12sBjW po1C6U9B+UVxd/c3Dj3hr9BPVCHyP4ThTPcHK/+PYUuFORAjfzDNTIWUNh7mzYhy9FGM PSyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=cxzAUO8s; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=oxHt8BCj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id md17-20020a17090b23d100b00276f10d241fsi997412pjb.37.2023.10.11.02.01.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 02:01:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=cxzAUO8s; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=oxHt8BCj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id D651B81B75F9; Wed, 11 Oct 2023 02:01:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345652AbjJKJBX (ORCPT + 19 others); Wed, 11 Oct 2023 05:01:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345866AbjJKJBL (ORCPT ); Wed, 11 Oct 2023 05:01:11 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9B33CC; Wed, 11 Oct 2023 02:01:05 -0700 (PDT) Date: Wed, 11 Oct 2023 09:01:03 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1697014864; 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=9+W7LmK13kuQHjba0aXrO/nn+kMn14TbwlhICOETVIY=; b=cxzAUO8sy6iMpc2ARvf70RZ9hLiC4C6AJKQzwpZFtU0d0q6GmLiix4fuHZ7F9+Ek8K+p8R N/8Gl6x32z4IVSYqyd3Nw1ysrETfj15tP8+yAt4w6GcbonymXU0eTsYJxPXO0EXt/cFNes UmrSDomSkEA7zXUQTnflfHi9qsxsEyeOrq8pywK32C7BvvRmY+56ybYeVR9QDyVKs9sBMV 2Kq1Pbx30OKiIkZSVF9aFN58K0pB95b5biRRJumd1fUKDRfPidgh3Brawz4ORRK9niy4oL eQxWm9U5Yo6yBeOcU/FFlohIAp7RcUbvI/xM5voehSc2wwFJOxpjBswmYTKNXQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1697014864; 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=9+W7LmK13kuQHjba0aXrO/nn+kMn14TbwlhICOETVIY=; b=oxHt8BCjCrkYcg/NtZylWNEsI7lR6SDfYmKjePJG9VH74yODawlI7BKv29MoODgYmkCcZO t7iWM2LTXhNOccCQ== 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: <169701486308.3135.13026498326049431565.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 11 Oct 2023 02:01:35 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779381626905443552 X-GMAIL-MSGID: 1779449092640439621 The following commit has been merged into the x86/microcode branch of tip: Commit-ID: 8c4ac53f1d8bcb3bd4b5c2f338eb068f505d6816 Gitweb: https://git.kernel.org/tip/8c4ac53f1d8bcb3bd4b5c2f338eb068f505d6816 Author: Thomas Gleixner AuthorDate: Tue, 10 Oct 2023 17:08:41 +02:00 Committer: Borislav Petkov (AMD) CommitterDate: Tue, 10 Oct 2023 19:39:32 +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 a2776f2..f6ed2c5 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;