From patchwork Mon Oct 9 12:29:51 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: 150050 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1833486vqo; Mon, 9 Oct 2023 05:31:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFf+LqSw7koVW3s/7XbtRR1qkPTh2CHAA6AW+Gbs/CjkAjH85qFzu4acajcuDCm1arhB43F X-Received: by 2002:a17:90a:5415:b0:279:5a3:d5f with SMTP id z21-20020a17090a541500b0027905a30d5fmr19710389pjh.9.1696854717748; Mon, 09 Oct 2023 05:31:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696854717; cv=none; d=google.com; s=arc-20160816; b=kQZYurl2YWlPqk6DltwUnkI4E5LPB0rqnEEHzWyw/af+qnReeZRAcunGFEu25jGPMO JYBbuZCBu6xp3661lJdRePjacTVbqpVUZS4PjMyEZBUZ32I6nehqanl6zUYuP6tlqa9w gPz6xJP/LUls/ugy40k+r+CFR73s4FEk7YhDRgtada8a3OakvhZT8MiODFhd6nhiEvEW AjBet0eRyLNTCJjVTE37IGpMqYrYxYp6/pBPUdUyEoEbCiQt3JasT5U5PkbP9T1NcOCO XoNacbqoNd1HuBX3056dJ0rSo0M1Ax4vVDTyGtr6Gq5cwMkG117CS2099vSYzkCHRzvG KVbg== 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=rTXhovNOZIDWGC4c0VkQwIbPl1uuIwZBpJ37xYxm70U=; fh=LWlv3U+xZ3+vQt4tlJRIlKl5VzN7iFjjE/bzRmlxKDA=; b=cnNIk10BxZwPaZIojt8PG5WrATGpZNeteTh/lLF1yoh6RbRLzIn+4iaWqii/L8FGOR wKwN6jhj0yaoFfTuk8+Rap/SQx8J7PToUPDmbm/qg1RbyBTTPYfsyu+o/Om6H/5ViwSt pKjjjuBGoGAlYJLv/LEGwJ8rejOr/DURezbMgSK/dkAraMYzQgcKRSoAzk+5wCj/YlxV 9PCxrGadYL+6x0/cp4hx6w4PfQ/isUFU6bQPmikiJ2DPDGAt7J2tAP9kcJx1ZnWP4Zak jNymcED20wqFI2qdc0fzkqegME2eSsLZ+aWk+fxMwpWqOEUlH+4yhFQUCjYlD1DI8jj4 itNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=fj513qKL; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id t13-20020a17090aae0d00b002791035445esi9217354pjq.76.2023.10.09.05.31.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 05:31:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=fj513qKL; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 E76AE80740D2; Mon, 9 Oct 2023 05:31:46 -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 S1376592AbjJIMae (ORCPT + 18 others); Mon, 9 Oct 2023 08:30:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346591AbjJIM3z (ORCPT ); Mon, 9 Oct 2023 08:29:55 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6114BEB; Mon, 9 Oct 2023 05:29:53 -0700 (PDT) Date: Mon, 09 Oct 2023 12:29:51 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1696854592; 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=rTXhovNOZIDWGC4c0VkQwIbPl1uuIwZBpJ37xYxm70U=; b=fj513qKL+nsEj4B2BUX+XW2TaRDe7JX3edkPpP4zV8EVgDQFn+KroH48Fv3awo4IlOHP/G hjiy/oxl9Y8VnrdVDYoANWPlszEvqMgmpD7GlwpR1Ilc+PVATo9KL0PH8u2HWMMXWwHaXs 68eRMYHVkmn9IIk7yP8lswzts9PvpGVjz9mDmgTp3z/UPXkLHwcl0Ah0DJU0VI7ZGPO5KP XufgnsT53j60HMlbHFjiFi2UQFN5TdDgP8HkSnAuI42+j+DnaqyTP1Oxo8bn0MpEsgxJNf WVtCyiMwjaM73W9MNtlKqfRFpxO8/G+JGlepzQjcXW4pzFouykj1uq/090r8zg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1696854592; 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=rTXhovNOZIDWGC4c0VkQwIbPl1uuIwZBpJ37xYxm70U=; b=zIbjdZbMkASzL4KiMKKOCJpFOHQ7/ykHlfdBELVOuuxAYs5Ox+KAngepGBrpnZ6whLZwVF A5Rg8BseeoXxO7AQ== 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: <169685459143.3135.10907142011553803868.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no 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]); Mon, 09 Oct 2023 05:31:47 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778653443590584341 X-GMAIL-MSGID: 1779281132232572463 The following commit has been merged into the x86/microcode branch of tip: Commit-ID: ac39a61afe4f452fa9dab568b810f6c410554242 Gitweb: https://git.kernel.org/tip/ac39a61afe4f452fa9dab568b810f6c410554242 Author: Thomas Gleixner AuthorDate: Mon, 02 Oct 2023 13:59:49 +02:00 Committer: Borislav Petkov (AMD) CommitterDate: Tue, 03 Oct 2023 16:08:19 +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 fd97cc1..3817bb2 100644 --- a/arch/x86/kernel/cpu/microcode/intel.c +++ b/arch/x86/kernel/cpu/microcode/intel.c @@ -426,21 +426,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; }