From patchwork Wed Oct 11 09:00:59 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: 151226 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp395463vqb; Wed, 11 Oct 2023 02:02:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEhF7hNPA7+LUZnlpP84++JHZQyGYm60MgATWfyHbOIr40pCqKENuh/8Jbu3ruNxL+WRqkW X-Received: by 2002:a17:902:d4c9:b0:1b8:9fc4:2733 with SMTP id o9-20020a170902d4c900b001b89fc42733mr23193562plg.3.1697014956106; Wed, 11 Oct 2023 02:02:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697014956; cv=none; d=google.com; s=arc-20160816; b=wiEnUEqAk7wzzg3DDb3TZHJsh2qSPKvSf68isczGXSYvSZ4RvKk7gHJHNW1kWeAULN 41RGB5GJYYcT1E2+z64EOPXGilPT6YGI9+YbZdZ+hBp29cy8jaH5j1X/fmQ+wgbcxErJ DIwv5k4186bSMEUx/PGPAv/C2HQH1l+KFuLNzK26w0iurMQzPZhgKQ4QMEE4Q+0IFusN Uh/qVnW68T9+Tb5gwhppS6qoD9g9r+FiYOCjHt61yfIxXstQWCZU2KwmJc/wKl755NOY TRmzzyN0AtsihA5hN8k5g+QxrNllj/OHau6EAbv1lEmk8tp1O8gCOJqVWREPAvOsLvxq XTaQ== 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=0rjdXP+1HAXDxpbcP8DPB8hg329kETi52ebn7TfU4V0=; fh=LWlv3U+xZ3+vQt4tlJRIlKl5VzN7iFjjE/bzRmlxKDA=; b=1J9MKvEPU1g77nKKPoTfbZeE7lS1N2GdlK4Lova8qjElVAtkyUviwtCA3I80FBcXhc dq3fQdBnEpo7pn2mjq+1n81E79jbOgDkHZ28BBo3hatP4RFybuYy5NqV6UuiFj5FnyIT 0X4lOZKDjZFtOOtFYDH+6QEanZ588F4HtUdBHNhDGwRF6Td5oBsRjzy8iD8LXpdbRsWU JtNNARvcnqP+VopWPL3caemMW4R3DbqkLY4amgKvRiW/wI4ngzdBuCz0nSNhr4DdTc3l g+LiPCsxn7R8k1MArAATEVZglpthKD2aLFH4VeaQ50AyzlyoPO45XBd4XErpUTJRaOdW +10A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=zCCyfGXk; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=RUhOpUo6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id t13-20020a170902e84d00b001c74d84425bsi14662889plg.31.2023.10.11.02.02.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 02:02:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=zCCyfGXk; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=RUhOpUo6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 899708113EE0; Wed, 11 Oct 2023 02:02:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345846AbjJKJBJ (ORCPT + 19 others); Wed, 11 Oct 2023 05:01:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345789AbjJKJBF (ORCPT ); Wed, 11 Oct 2023 05:01:05 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D86E59D; Wed, 11 Oct 2023 02:01:02 -0700 (PDT) Date: Wed, 11 Oct 2023 09:00:59 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1697014860; 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=0rjdXP+1HAXDxpbcP8DPB8hg329kETi52ebn7TfU4V0=; b=zCCyfGXkOkd+FiAWokwYpG+zuEbOUy2874+0RW3/0bPNPWzBipn9eZsmF9Tw3DTc99AOdw kKE9uhzFheLUBW2yDYACqLrJMnE94HafdboKZv+EBE9b722AgebywLW6BWRNDRVF6+xcXV u7R8IsAyCBRyruWGWuhm7FjlpSpaTLRTtAsnHsfdNQRZQBKBxmFHpuG9/nKhvvJc9lhjzI 17Vy0ZgyHty878I/VlETY8Vxdd3OAdfAWgkJee3zxcRBrFCSV1VZmKBCj7llk/T9V6TvyC H/elK+J35cHyh5l98P8qMcmkrvgl0V8RYIExBnaLK9vfXfGTg6Ol43Iwqyef8Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1697014860; 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=0rjdXP+1HAXDxpbcP8DPB8hg329kETi52ebn7TfU4V0=; b=RUhOpUo6wKyTtA3siQixgvsN7cRWoM68UhylA4554vm583YJV7gYSe7LJ1tthma0dq2C07 WPbpNB4t2gle2rBQ== 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: Mop up early loading leftovers Cc: Thomas Gleixner , "Borislav Petkov (AMD)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231010150702.662293885@linutronix.de> References: <20231010150702.662293885@linutronix.de> MIME-Version: 1.0 Message-ID: <169701485968.3135.5134345024612355238.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,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Wed, 11 Oct 2023 02:02:19 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779381636761942126 X-GMAIL-MSGID: 1779449154701892495 The following commit has been merged into the x86/microcode branch of tip: Commit-ID: 7edf8316660ee2966b8aed03a63d44496731f505 Gitweb: https://git.kernel.org/tip/7edf8316660ee2966b8aed03a63d44496731f505 Author: Thomas Gleixner AuthorDate: Tue, 10 Oct 2023 17:08:46 +02:00 Committer: Borislav Petkov (AMD) CommitterDate: Tue, 10 Oct 2023 21:17:58 +02:00 x86/microcode: Mop up early loading leftovers Get rid of the initrd_gone hack which was required to keep find_microcode_in_initrd() functional after init. As find_microcode_in_initrd() is now only used during init, mark it accordingly. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231010150702.662293885@linutronix.de --- arch/x86/kernel/cpu/microcode/core.c | 17 +---------------- arch/x86/kernel/cpu/microcode/internal.h | 2 -- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c index 57dde24..18e0cdd 100644 --- a/arch/x86/kernel/cpu/microcode/core.c +++ b/arch/x86/kernel/cpu/microcode/core.c @@ -49,8 +49,6 @@ static bool dis_ucode_ldr = true; bool force_minrev = IS_ENABLED(CONFIG_MICROCODE_LATE_FORCE_MINREV); module_param(force_minrev, bool, S_IRUSR | S_IWUSR); -bool initrd_gone; - /* * Synchronization. * @@ -185,15 +183,7 @@ void load_ucode_ap(void) } } -/* Temporary workaround until find_microcode_in_initrd() is __init */ -static int __init mark_initrd_gone(void) -{ - initrd_gone = true; - return 0; -} -fs_initcall(mark_initrd_gone); - -struct cpio_data find_microcode_in_initrd(const char *path) +struct cpio_data __init find_microcode_in_initrd(const char *path) { #ifdef CONFIG_BLK_DEV_INITRD unsigned long start = 0; @@ -224,12 +214,7 @@ struct cpio_data find_microcode_in_initrd(const char *path) * has the virtual address of the beginning of the initrd. It also * possibly relocates the ramdisk. In either case, initrd_start contains * the updated address so use that instead. - * - * initrd_gone is for the hotplug case where we've thrown out initrd - * already. */ - if (initrd_gone) - return (struct cpio_data){ NULL, 0, "" }; if (initrd_start) start = initrd_start; diff --git a/arch/x86/kernel/cpu/microcode/internal.h b/arch/x86/kernel/cpu/microcode/internal.h index 9930788..fc03a7b 100644 --- a/arch/x86/kernel/cpu/microcode/internal.h +++ b/arch/x86/kernel/cpu/microcode/internal.h @@ -90,8 +90,6 @@ static inline unsigned int x86_cpuid_family(void) return x86_family(eax); } -extern bool initrd_gone; - #ifdef CONFIG_CPU_SUP_AMD void load_ucode_amd_bsp(unsigned int family); void load_ucode_amd_ap(unsigned int family);