From patchwork Tue Dec 27 09:27:35 2022 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: 36794 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1309252wrt; Tue, 27 Dec 2022 01:44:42 -0800 (PST) X-Google-Smtp-Source: AMrXdXvyOe0k3PBxT4lzH6H9gUcKhlsVB9BgVys1W8G4x8Lr3WAMT4L5A4Hlla/8e6dTKGJKDBdK X-Received: by 2002:a17:907:9d03:b0:7c1:a0c:a866 with SMTP id kt3-20020a1709079d0300b007c10a0ca866mr18458811ejc.75.1672134282313; Tue, 27 Dec 2022 01:44:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672134282; cv=none; d=google.com; s=arc-20160816; b=jwwtt/j87sP9gNONKtZsFxwFckNtulv6Q35E0x3GQzWoTj6vld5tqigjLGDr8Seenn ji25mXCeSJzHOhVbvhQ3VllGPE7tnEIuQ/0OXlTKe7PIan4S8mXDx8upvJpwzZLs/j+5 nj5U7FkgAE4OaOd3Rfz8LLFsuYezWjTg+gm+nQ3jNgpLYXsoxJo2THJyfKt0A/Nv/7FM u3RojfNreMTjVQd9fIWsbsYlCZ3NPDsMGlvNL76+/s/amJF+ksyACGDwwhjt72BIH7KC 3HyEbfEJuZlTEYbNm0bbLwwAoJUCIIFCJI3NzOTytNuTdf18uRoXOx/tE4ELCJI7TMFI BC1g== 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=G45h4mJydrKFB6s8sXYpIuCSVW4EG73G4/kyR75n868=; b=YDKBGetrVCvWzm6ibAbvlHNXnCUnJrKP66w2H5fi76XTeo77tQ1hlTMVPSFjLov7lX 9oGzxcRNtZ7iVc5gYFs2ItZy61RyryOivD6Yl2J7lNoCsbZEwrffAjJSBgE5nhG5+SwJ REcGpsf0/p7kDbsjim1sn3hVn+oi97vXgMUyaE7L6n3JA1p64jR0qZ+wC1ER8++iCXhV 1l5exY8Mx7qbV6iP/HaYFfkG4wFsodMfw23Ta7yHcOlHKyP7v5s0MqH3g9f84GMnnulB kp8vlqC5UbLSTfelBr/x9tJAnexP4INzUJW1NsnjyBJbLWhRIVpODnOQb362OFtIv6Tj 6JZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=3SzKXc4L; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hb9-20020a170907160900b007c4fb4ee06bsi11645385ejc.534.2022.12.27.01.44.17; Tue, 27 Dec 2022 01:44:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=3SzKXc4L; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230147AbiL0J1o (ORCPT + 99 others); Tue, 27 Dec 2022 04:27:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbiL0J1l (ORCPT ); Tue, 27 Dec 2022 04:27:41 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96CCC8FE4; Tue, 27 Dec 2022 01:27:38 -0800 (PST) Date: Tue, 27 Dec 2022 09:27:35 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1672133256; 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=G45h4mJydrKFB6s8sXYpIuCSVW4EG73G4/kyR75n868=; b=3SzKXc4LhqdGwdqkjGyOyxF1MSKtUV4Ysszh/8ig5Xz1WLy6x/rJnk9InINxN1McmI15L3 boxgqGhksKZiLXjrXZexFWBd7ewCp999KdCVYJDfy7+owPX0SEvs+vVClV/jaQkqDQkFc+ Yg1wad4YJ1nrhYrE/4mxVn9BlqT9YPe0DiV0giqhcKyrLZrqawIOmyIeA07xGjBK5pHlH3 9LufzGmTxNGd3QkTmQVtI7FX4xwcyQNHUzkCenKkHhCgf6BBEx415RpQDtIENqp2zTsdnw 9Fk39WCq7GBQVy3QFlvFf1Ufto535f41hTYVlwhwuSA7ohQ+hFR0AtOUFEVIlA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1672133256; 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=G45h4mJydrKFB6s8sXYpIuCSVW4EG73G4/kyR75n868=; b=CVboox00EBIs6KYnorra7EA+EDYbBVcPqJRrg3zxj8hIc9MB0XkFN80Jci4FvscViv9/Kp IkJp+H5XoKoBAqAQ== From: "tip-bot2 for Borislav Petkov" 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: Rename a couple of functions Cc: Borislav Petkov , "Borislav Petkov (AMD)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20221219210656.5140-1-bp@alien8.de> References: <20221219210656.5140-1-bp@alien8.de> MIME-Version: 1.0 Message-ID: <167213325533.4906.16900730747128544891.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752679045623073779?= X-GMAIL-MSGID: =?utf-8?q?1753359877648131506?= The following commit has been merged into the x86/microcode branch of tip: Commit-ID: 61de9b7036f26448a1916291c456f62dd6bf07ea Gitweb: https://git.kernel.org/tip/61de9b7036f26448a1916291c456f62dd6bf07ea Author: Borislav Petkov AuthorDate: Mon, 19 Dec 2022 22:06:55 +01:00 Committer: Borislav Petkov (AMD) CommitterDate: Mon, 26 Dec 2022 06:30:31 +01:00 x86/microcode/AMD: Rename a couple of functions - Rename apply_microcode_early_amd() to early_apply_microcode(): simplify the name so that it is clear what it does and when does it do it. - Rename __load_ucode_amd() to find_blobs_in_containers(): the new name actually explains what it does. Document some. No functional changes. Signed-off-by: Borislav Petkov Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20221219210656.5140-1-bp@alien8.de --- arch/x86/kernel/cpu/microcode/amd.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c index 56471f7..339c966 100644 --- a/arch/x86/kernel/cpu/microcode/amd.c +++ b/arch/x86/kernel/cpu/microcode/amd.c @@ -414,8 +414,7 @@ static int __apply_microcode_amd(struct microcode_amd *mc) * * Returns true if container found (sets @desc), false otherwise. */ -static bool -apply_microcode_early_amd(u32 cpuid_1_eax, void *ucode, size_t size, bool save_patch) +static bool early_apply_microcode(u32 cpuid_1_eax, void *ucode, size_t size, bool save_patch) { struct cont_desc desc = { 0 }; u8 (*patch)[PATCH_MAX_SIZE]; @@ -481,7 +480,7 @@ static bool get_builtin_microcode(struct cpio_data *cp, unsigned int family) return false; } -static void __load_ucode_amd(unsigned int cpuid_1_eax, struct cpio_data *ret) +static void find_blobs_in_containers(unsigned int cpuid_1_eax, struct cpio_data *ret) { struct ucode_cpu_info *uci; struct cpio_data cp; @@ -511,11 +510,11 @@ void __init load_ucode_amd_bsp(unsigned int cpuid_1_eax) { struct cpio_data cp = { }; - __load_ucode_amd(cpuid_1_eax, &cp); + find_blobs_in_containers(cpuid_1_eax, &cp); if (!(cp.data && cp.size)) return; - apply_microcode_early_amd(cpuid_1_eax, cp.data, cp.size, true); + early_apply_microcode(cpuid_1_eax, cp.data, cp.size, true); } void load_ucode_amd_ap(unsigned int cpuid_1_eax) @@ -546,11 +545,11 @@ void load_ucode_amd_ap(unsigned int cpuid_1_eax) } } - __load_ucode_amd(cpuid_1_eax, &cp); + find_blobs_in_containers(cpuid_1_eax, &cp); if (!(cp.data && cp.size)) return; - apply_microcode_early_amd(cpuid_1_eax, cp.data, cp.size, false); + early_apply_microcode(cpuid_1_eax, cp.data, cp.size, false); } static enum ucode_state @@ -816,6 +815,7 @@ static int verify_and_add_patch(u8 family, u8 *fw, unsigned int leftover, return 0; } +/* Scan the blob in @data and add microcode patches to the cache. */ static enum ucode_state __load_microcode_amd(u8 family, const u8 *data, size_t size) {