From nobody Thu Oct 9 02:16:10 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C33F1DC075; Fri, 20 Jun 2025 17:54:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750442072; cv=none; b=Tpc/PMqTkVXOZ2RgLjtsh+9J2V0MOyDNgIEVYnJ9bP+sGGIH8R6NWwf2Vo8E4biaecGQiXEWLJeADjWC8oenywZiGqt2kHepwrEysUGdGJrvYsWsiSsJWiCdA+idARMGYx8Y1rhJt7MHsU27s88vZtKU1M+0qBhrmwjQKohNHf4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750442072; c=relaxed/simple; bh=3AOITwQtdLNcGHqTsIj4mSgyifucL4YYBlRM/I0eweA=; h=Date:From:To:Subject:Cc:MIME-Version:Message-ID:Content-Type; b=Fyj3ECRRYEaO49YxBIlPA8+R7Zqc4zQ0EDGqtSZVZBghJ0O7uwIwAPGGK1r6gGP0ZKstF7H0fWwRwSDDf1CWvlAi+E2HUKJxz/uQrfIA2vcmKxnsnwt/P2xWQc4TPekUKsetYPzJ70Qz8QPyUnFA9ep0bD6DLvdV0gDOwO1KYGk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=k7FyjgrF; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Naw2kSI3; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="k7FyjgrF"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Naw2kSI3" Date: Fri, 20 Jun 2025 17:54:28 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1750442069; 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; bh=BVBjjX1hbRfc8ehGh7/c987HLQFk/Q8im+szf4eY5+E=; b=k7FyjgrFw5oh3/rBRqZs4czqkMq09AVrq4WUfsI7vxok/gw7Ru6DiMvr4Y1ECbHNvNr5Qo loTJLs5QuJphncdDplEgOw6o377idIsWLOmWfmhO93Z/TTi+7jYh9NwEM/Do4/Yfbsoshi S5ywER/Hq6xIXrnIUGO3ZREU4ym3wJKyFOZzRHFFYuvA8HaWgBfpEmP5DuEk7ZdoMJVBAp YqIPqzjf3/VZbd0DTXDOfs+d/f3CH8SeTKWx/xs2Y+c2xHI7I5NHnaAQx34vKJQW3TzRt+ p06CeIpn7EgYZOE4ziZxr1qp+faFSzHh9/oFF5XITvmwSwTh2H6DOplEfguzHg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1750442069; 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; bh=BVBjjX1hbRfc8ehGh7/c987HLQFk/Q8im+szf4eY5+E=; b=Naw2kSI3hYK2YxRjKFNM/OXXYlMlYq0Nnr1qD4rvdaxeVLlsn66LMkbge2IHiVZNYDzotb o/Ll/9Xazw0AoHDA== From: "tip-bot2 for Alexander Shishkin" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/boot] x86/efi: Move runtime service initialization to arch/x86 Cc: "Kirill A. Shutemov" , Alexander Shishkin , Dave Hansen , Sohil Mehta , Ard Biesheuvel , x86@kernel.org, linux-kernel@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <175044206817.406.15116962193585235583.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/boot branch of tip: Commit-ID: ce2c403c26c1ed0e28fc541ab30fe13ff50236be Gitweb: https://git.kernel.org/tip/ce2c403c26c1ed0e28fc541ab30fe13ff= 50236be Author: Alexander Shishkin AuthorDate: Fri, 20 Jun 2025 16:53:12 +03:00 Committer: Dave Hansen CommitterDate: Fri, 20 Jun 2025 10:48:50 -07:00 x86/efi: Move runtime service initialization to arch/x86 The EFI call in start_kernel() is guarded by #ifdef CONFIG_X86. Move the thing to the arch_cpu_finalize_init() path on x86 and get rid of the #ifdef in start_kernel(). No functional change intended. Suggested-by: Kirill A. Shutemov Signed-off-by: Alexander Shishkin Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Sohil Mehta Acked-by: Ard Biesheuvel Link: https://lore.kernel.org/all/20250620135325.3300848-5-kirill.shutemov%= 40linux.intel.com --- arch/x86/kernel/cpu/common.c | 7 +++++++ init/main.c | 5 ----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 8feb8fd..4f430be 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -26,6 +26,7 @@ #include #include #include +#include =20 #include #include @@ -2530,6 +2531,12 @@ void __init arch_cpu_finalize_init(void) fpu__init_cpu(); =20 /* + * This needs to follow the FPU initializtion, since EFI depends on it. + */ + if (efi_enabled(EFI_RUNTIME_SERVICES)) + efi_enter_virtual_mode(); + + /* * Ensure that access to the per CPU representation has the initial * boot CPU configuration. */ diff --git a/init/main.c b/init/main.c index 225a582..f9f401b 100644 --- a/init/main.c +++ b/init/main.c @@ -53,7 +53,6 @@ #include #include #include -#include #include #include #include @@ -1068,10 +1067,6 @@ void start_kernel(void) =20 pid_idr_init(); anon_vma_init(); -#ifdef CONFIG_X86 - if (efi_enabled(EFI_RUNTIME_SERVICES)) - efi_enter_virtual_mode(); -#endif thread_stack_cache_init(); cred_init(); fork_init();