From nobody Fri Jan 2 16:45:00 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56249CD8CA6 for ; Tue, 10 Oct 2023 15:09:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233252AbjJJPJF (ORCPT ); Tue, 10 Oct 2023 11:09:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231865AbjJJPIw (ORCPT ); Tue, 10 Oct 2023 11:08:52 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0424993 for ; Tue, 10 Oct 2023 08:08:51 -0700 (PDT) Message-ID: <20231010150702.662293885@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1696950527; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=IhNNCBkZDu722mghkA1YDoOAV6ExbYvs7YIlqtUCfyk=; b=zaJ0NwORFtKCxUHt5o1b0JpRAPX6MwX3ZtWXdl623+w4GTIkYBD748069YKSx65upHVmid pyuZO9de3oYgj1KWaDRFCNuHFGKdVwlk2rlibB0D8oI7zUYSTXxtGdy7Rvq8o2MuxW9vvV Yk7ybfCRKSJpY6mPW6zkcIdzutFi6FRujyctmb+UpEojZd+nwr8YCfpmRS160zBWFRMXuR dkGSADxOEAh1E5VbSGqZP3AE7D/2KltmP4HeUjTlYBkHdw1zDNMHy6DqU7VlWnsGSjZS9L L/Ciq7BcpmSlxqHadMgDrjMKU8STpDF7lZdKW/SnqsWZKMMDU69Bsy8LahYOXw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1696950527; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=IhNNCBkZDu722mghkA1YDoOAV6ExbYvs7YIlqtUCfyk=; b=puecydyczdwg+Ys1hOCfWLBsA4EvL5lna9tjhjl5OfmCwNvjyGnouT60LL8OpuwT85CR3z hBvj7RoEALTbxuCw== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Borislav Petkov Subject: [patch 5/5] x86/microcode: Mop up early loading leftovers References: <20231010145130.987300357@linutronix.de> MIME-Version: 1.0 Date: Tue, 10 Oct 2023 17:08:46 +0200 (CEST) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 --- arch/x86/kernel/cpu/microcode/core.c | 17 +---------------- arch/x86/kernel/cpu/microcode/internal.h | 2 -- 2 files changed, 1 insertion(+), 18 deletions(-) --- 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 =3D true; bool force_minrev =3D IS_ENABLED(CONFIG_MICROCODE_LATE_FORCE_MINREV); module_param(force_minrev, bool, S_IRUSR | S_IWUSR); =20 -bool initrd_gone; - /* * Synchronization. * @@ -185,15 +183,7 @@ void load_ucode_ap(void) } } =20 -/* Temporary workaround until find_microcode_in_initrd() is __init */ -static int __init mark_initrd_gone(void) -{ - initrd_gone =3D 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 =3D 0; @@ -224,12 +214,7 @@ struct cpio_data find_microcode_in_initr * 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 =3D initrd_start; =20 --- 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_fam return x86_family(eax); } =20 -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);