From patchwork Fri Oct 20 11:37:55 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: 156056 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp992326vqb; Fri, 20 Oct 2023 04:42:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE5dndA13jbSmWnLf+RxYB/o0Wl4DxNVtIscVcdncHcOZURuKoShBBRcni4HteUoEZboybU X-Received: by 2002:a17:90a:d443:b0:27c:f309:f381 with SMTP id cz3-20020a17090ad44300b0027cf309f381mr1599117pjb.6.1697802124500; Fri, 20 Oct 2023 04:42:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697802124; cv=none; d=google.com; s=arc-20160816; b=aLfXFRE4YGCVy+rLmFlA2QDjvRAm27/sRV9ISV1EdeZCUUgbtwxFTHsxdPCzWopBSk R+45ssw1weqnb0tx/Ytg4XrCLKxITEsYsENW4DrHYzCvDCBQvF2xtYE44jl/iqEz7s4r NmuU5G2R7juz3BxLrSA5gWww29tt9dT9CgPeZK0ZtEH6WZYslKaOWtu08PocPFd+hsud GMJzaXz8Ne1Vz2+IXeRaoh+aTNaU3MsRTzpKATiulkO91c14rHes77CHCVpfU1evdVS3 i0P66ma9Mmmo7nGppStCZCm4T8BkrLoAz8EvyJ2PfuPVQCs+X9ckyLP28CPFimNI3UWH /Dpw== 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=t8+QVuQZ3+FiNfDUREWz5giVzmYwA78wRPkybcBT2Ek=; fh=LWlv3U+xZ3+vQt4tlJRIlKl5VzN7iFjjE/bzRmlxKDA=; b=Szm6uualLPx5/bP7smtcofZbc/a6yBSw/xyZnHr965d3TvL4e4Be7gB0S4OZ9B0uKj RwUPdkap7qLbjeU9Ux2oMWEUJ7t0J3w5dS6DFcXGtiVV5AZtVcKfQx/z9gl4kqLjJwrF afzNKg2otHa14dlUUZs0RgnXtymkZKv6I6YAcZfRsr522xt8v2EaZYsoAhPd1M37I49X mUNS7tSw8iIOd+k8SjgO2fIRksyrK9bSEgTLQXKxALKA8cZHMsOMCbKWIfg/25lxA1fs ifjhLfdMRRPXYt+YprO75HkHj8Tn1MDOMPdICtSnxxcLXRvKQZDHRKOnvSo8dsm5xfuc iabw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="2R/FccQp"; dkim=neutral (no key) header.i=@linutronix.de header.b="s97PNXC/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id r2-20020a632b02000000b005add209e106si1609805pgr.442.2023.10.20.04.42.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 04:42:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="2R/FccQp"; dkim=neutral (no key) header.i=@linutronix.de header.b="s97PNXC/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id F29A183C6341; Fri, 20 Oct 2023 04:41:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377299AbjJTLl1 (ORCPT + 25 others); Fri, 20 Oct 2023 07:41:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377215AbjJTLlY (ORCPT ); Fri, 20 Oct 2023 07:41:24 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFF5D10F4; Fri, 20 Oct 2023 04:38:28 -0700 (PDT) Date: Fri, 20 Oct 2023 11:37:55 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1697801876; 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=t8+QVuQZ3+FiNfDUREWz5giVzmYwA78wRPkybcBT2Ek=; b=2R/FccQp0WMeAm6YJLiivhWJQf+UnA35/cOjTK3vG0T9sFioHiap4SiNbkfwguMS+gbz3T Jh9GqQoh9aU280oSCnW6W8qG0meiM/fmiPc/UCIjPEtIWNOJmLlcaDhKcIpsRsLEA8XCfL ZQY5NzrU19GD/cdpg4vrmeix8oh/n1PCI0rvSTpFZvAcnclh2YyaYdzQPEHnugzxq9jhoq 6TSWIN1fMN3M2tNr58d481FSqgC2qvDU1e0UWIAOq7q8b2fwfGqT7Qk0WuTvRKYJfuChzF cZmvtlwSYXHAbTWNtfjsfDk1rQ7OyAD4SBBiaC+akF433SRZ8DtcSh7Nwasp9A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1697801876; 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=t8+QVuQZ3+FiNfDUREWz5giVzmYwA78wRPkybcBT2Ek=; b=s97PNXC/zyF3OQ7ljP1TWmXjHFAxesbIv+e9+O3rGXdgIWm31lA7kVcALuKvYGHLcLB9x5 KOT4eiWunbefHpCw== 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: <169780187573.3135.2892527778268998057.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 morse.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 (morse.vger.email [0.0.0.0]); Fri, 20 Oct 2023 04:41:57 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779381626905443552 X-GMAIL-MSGID: 1780274560291508059 The following commit has been merged into the x86/microcode branch of tip: Commit-ID: e0dd49a0eb690820e9d0eef0ad7b6ae435cf6549 Gitweb: https://git.kernel.org/tip/e0dd49a0eb690820e9d0eef0ad7b6ae435cf6549 Author: Thomas Gleixner AuthorDate: Tue, 10 Oct 2023 17:08:41 +02:00 Committer: Borislav Petkov (AMD) CommitterDate: Thu, 19 Oct 2023 15:40:00 +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;