From patchwork Tue Oct 24 13:21:05 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: 157463 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1938487vqx; Tue, 24 Oct 2023 06:23:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFytm9goph+y/pU6fP/Oq++y+JR2ATAzLkHva6BK1dXyMl2KPx10ZgV5GPGOOV1lIJMCCEi X-Received: by 2002:a05:6870:3b0f:b0:1ea:1e74:c377 with SMTP id gh15-20020a0568703b0f00b001ea1e74c377mr14959998oab.36.1698153828112; 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=00p49KDFW6My9fr2VAMshdYw60V5gPzQc1xhnbhl1snNKzTs3vewUvwlJBUsKq5ufS 1WK5Mnz8/anWVVgYvZCD0sAdmQW5CeXLpbpfInwxmXp54gzgwqodss0j0rbbTXsF9sEF x8tNIP4oRlT/jX3PUaIV9cAe4DXptxF0snY2vC4OOQPVNi+HjdsOIHfsdsDs4ls3UySz QBH3wQAaoTtO1DCq/DPuWP97pUa17T5HSiyj+zklTSm01jM55mQG5xQpb+KKFLtis+Yf AyI7EBzwEXBeCCkP1FD4zszhwvenzsOJVkIyJrLLXe5zih12h62E2+Ck/4kiCgMLxU67 TeAw== 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=Os9nervEGesNBnaCxZVF2pLXxPzyMz+w9LD3FtcxP28=; fh=LWlv3U+xZ3+vQt4tlJRIlKl5VzN7iFjjE/bzRmlxKDA=; b=V5rlclY8uOO58uPoATUb3w+1Xq2dfPE9dGaxTpwIwxkTt5jJqCQR3uoM4meG7ke4U9 zRTwXoe7T7m8QRdsSgtqN1v8CTgfxiNphkXXLtuARBJd/GNdArPuFQxLCi4sga4Nf54k Hc9asRVPsD25uL0VT0rI4uQOSo3PZNXPooCBvxQMQrwHBSKuVn6abbvrcoFuzKTXFGKO BGoqcDtqSZGhlRoG9U7zNeGBlYs9DYOA02OYHKmUtMXsgaXwL21VhAHQGBkgs0E5aqgT Tupo3wkRAUomiSmuEiZi91ajNpREqwCLxKnCo/UC8wQDKcojA0mh2ZZP9o07sMGQpdEQ RkWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=OOeUeWTA; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=etDfPrBf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id z10-20020a65664a000000b005657ba564bdsi8196380pgv.826.2023.10.24.06.23.47 (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.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=OOeUeWTA; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=etDfPrBf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id D08A98063BEC; Tue, 24 Oct 2023 06:23:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343572AbjJXNXA (ORCPT + 26 others); Tue, 24 Oct 2023 09:23:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234588AbjJXNWE (ORCPT ); Tue, 24 Oct 2023 09:22:04 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A88319AC; Tue, 24 Oct 2023 06:21:07 -0700 (PDT) Date: Tue, 24 Oct 2023 13:21:05 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1698153666; 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=Os9nervEGesNBnaCxZVF2pLXxPzyMz+w9LD3FtcxP28=; b=OOeUeWTAhiQfa41rfwqXRRoSlpgtBCxhcqKCustsSpSoNYx1HcuBy8FqILDyxa1lxNKGgE dLXJJFkCrS7xMb+5B6vdvajFErfMEIZWGn9+VnG27upoAYZOt5yDZQ/QStG9GrTPXdDD/a qkavxHaaSMd9xPkl0HHvG7qBWsUgn6dDNn6NsACapiURebrJ2HbnDuFPQhSN3U0J2L4/2Z E1PVcRZUzqKTd66BAY3pjS/5z9sAF8uHf/8qwsWgvAcj9ybNsZcWp9JPMuKrk3Bz2VMsYO cjz2O1z7NxmUuaPxUkNaQJBZe0DIZcBxxmdYsr4dJfkshMuyPvXOItQvPIpGGg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1698153666; 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=Os9nervEGesNBnaCxZVF2pLXxPzyMz+w9LD3FtcxP28=; b=etDfPrBfb3hDAj64/q+Bq6QA7foOedLlGSkng7P2aPq1Aj/MSSbwZprVkrFO6HYb+oRSPO FgCtXQMO5htVTaBQ== 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/intel: Reuse intel_cpu_collect_info() Cc: Thomas Gleixner , "Borislav Petkov (AMD)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231002115902.741173606@linutronix.de> References: <20231002115902.741173606@linutronix.de> MIME-Version: 1.0 Message-ID: <169815366539.3135.421513578622495350.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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 24 Oct 2023 06:23:45 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778653443590584341 X-GMAIL-MSGID: 1780643348436426397 The following commit has been merged into the x86/microcode branch of tip: Commit-ID: 11f96ac4c21e701650c7d8349b252973185ac6ce Gitweb: https://git.kernel.org/tip/11f96ac4c21e701650c7d8349b252973185ac6ce Author: Thomas Gleixner AuthorDate: Mon, 02 Oct 2023 13:59:49 +02:00 Committer: Borislav Petkov (AMD) CommitterDate: Tue, 24 Oct 2023 15:05:54 +02:00 x86/microcode/intel: Reuse intel_cpu_collect_info() No point for an almost duplicate function. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231002115902.741173606@linutronix.de --- arch/x86/kernel/cpu/microcode/intel.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c index 5aa7f5e..47a96c0 100644 --- a/arch/x86/kernel/cpu/microcode/intel.c +++ b/arch/x86/kernel/cpu/microcode/intel.c @@ -435,21 +435,7 @@ void reload_ucode_intel(void) static int collect_cpu_info(int cpu_num, struct cpu_signature *csig) { - struct cpuinfo_x86 *c = &cpu_data(cpu_num); - unsigned int val[2]; - - memset(csig, 0, sizeof(*csig)); - - csig->sig = cpuid_eax(0x00000001); - - if ((c->x86_model >= 5) || (c->x86 > 6)) { - /* get processor flags from MSR 0x17 */ - rdmsr(MSR_IA32_PLATFORM_ID, val[0], val[1]); - csig->pf = 1 << ((val[1] >> 18) & 7); - } - - csig->rev = c->microcode; - + intel_collect_cpu_info(csig); return 0; }