From nobody Mon Feb 9 09:51:41 2026 Received: from mail.zytor.com (terminus.zytor.com [198.137.202.136]) (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 203853A4ABF for ; Tue, 20 Jan 2026 19:54:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.136 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768938899; cv=none; b=uq0vpAzGveT/lnnFsR75RwKatGgnf6DkKwNhh5XCDO7URwoVUnWLssgn27DN5fKgkqmq+FjmxpDM/nmcylGigjtLv5QWWrRrLmY0Obq8ldju+bWYP6EtRSqlXwkrUK25PRqDquqjsB5hPo/QcW4ClUZuxdxzoP9ZxjdKGMR5tQA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768938899; c=relaxed/simple; bh=D4tK6s4qxmXd7ByQgksRFD6iGVZ5J1jtKQniMHVJirw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=q48W3Y/XMFP84+Kt5A3bLbUOQdwLVKuc6Ew8i/CU4zVhYPv0hKq0XXS9FFY1Q38VnVBYEHM8i5axQh3psNMgno1kgSV1qbn+8uYdCV4M3jfEv3Pfm0FgG3IkkvckKFljAHF5l134azt0dKSlmRVxVNO8Gyyo4rJgi+Zk1iYq0V0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com; spf=pass smtp.mailfrom=zytor.com; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b=P5xGA/F/; arc=none smtp.client-ip=198.137.202.136 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zytor.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="P5xGA/F/" Received: from mail.zytor.com ([IPv6:2601:646:8081:9483:12c5:bc8e:d949:3497]) (authenticated bits=0) by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 60KJsD3F3899199 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 20 Jan 2026 11:54:26 -0800 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 60KJsD3F3899199 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2025122301; t=1768938869; bh=hTzQn7SyH/cYu7s0tyFNKhrOlfC46JaH5MDmT+7FXN0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P5xGA/F/SdLc+apds1JBd/6XbKRAM6F3DN2PsGe4IAkIOCW76o6QVkcgLnzH9+xaL 4NWtQWTos/iIYaZgc6NFHN62AG+53/2bn9iqucShu/QSOY5pNWCOwZtuF6+XEWn6dx cjuhbIkcB8MRDcZbQWn/yEceOQ6lqwDDsAvL/njUFZHC8lLwfXk6YPHBF9Psbc8L+W F9ejRNGDwehXwP/NfPrBtsGDZXBxezl858Z4x1QlF/3qZD1Kbn3szUBz1oozjGZU0q xrb4CQQK7ZX34O9EGcY25l3Ty9AYG/r6hZSWxVu9ptBEDtUx3fynHQLgsz0mv2wAVC awt9y0Jy+ELyg== From: "H. Peter Anvin" To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Uros Bizjak , Petr Mladek , Andrew Morton , Kees Cook , "Peter Zijlstra (Intel)" , Nathan Chancellor , Kiryl Shutsemau , Rick Edgecombe Cc: "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, x86@kernel.org Subject: [PATCH v1 08/14] x86: make CONFIG_EFI_STUB unconditional Date: Tue, 20 Jan 2026 11:54:00 -0800 Message-ID: <20260120195407.1163051-9-hpa@zytor.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260120195407.1163051-1-hpa@zytor.com> References: <20260119192923.651588-1-hpa@zytor.com> <20260120195407.1163051-1-hpa@zytor.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The EFI stub code is mature, most current x86 systems require EFI to boot, and as it is exclusively preboot code, it doesn't affect the runtime memory footprint at all. It makes absolutely no sense to omit it anymore, so make it unconditional. Signed-off-by: H. Peter Anvin (Intel) --- arch/x86/Kconfig | 14 ++------------ arch/x86/boot/compressed/Makefile | 2 -- arch/x86/boot/compressed/error.c | 2 -- arch/x86/boot/header.S | 3 --- 4 files changed, 2 insertions(+), 19 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 80527299f859..14e2b00a3815 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -907,7 +907,6 @@ config INTEL_TDX_GUEST bool "Intel TDX (Trust Domain Extensions) - Guest Support" depends on X86_64 && CPU_SUP_INTEL depends on X86_X2APIC - depends on EFI_STUB depends on PARAVIRT select ARCH_HAS_CC_PLATFORM select X86_MEM_ENCRYPT @@ -1495,7 +1494,6 @@ config X86_MEM_ENCRYPT config AMD_MEM_ENCRYPT bool "AMD Secure Memory Encryption (SME) support" depends on X86_64 && CPU_SUP_AMD - depends on EFI_STUB select DMA_COHERENT_POOL select ARCH_USE_MEMREMAP_PROT select INSTRUCTION_DECODER @@ -1929,18 +1927,10 @@ config EFI platforms. =20 config EFI_STUB - bool "EFI stub support" - depends on EFI - select RELOCATABLE - help - This kernel feature allows a bzImage to be loaded directly - by EFI firmware without the use of a bootloader. - - See Documentation/admin-guide/efi-stub.rst for more information. + def_bool y =20 config EFI_HANDOVER_PROTOCOL bool "EFI handover protocol (DEPRECATED)" - depends on EFI_STUB default y help Select this in order to include support for the deprecated EFI @@ -1957,7 +1947,7 @@ config EFI_HANDOVER_PROTOCOL =20 config EFI_MIXED bool "EFI mixed-mode support" - depends on EFI_STUB && X86_64 + depends on X86_64 help Enabling this feature allows a 64-bit kernel to be booted on a 32-bit firmware, provided that your CPU supports 64-bit diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/M= akefile index 68f9d7a1683b..6cbcf01c8bad 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile @@ -66,11 +66,9 @@ LDFLAGS_vmlinux +=3D -z noexecstack ifeq ($(CONFIG_LD_IS_BFD),y) LDFLAGS_vmlinux +=3D $(call ld-option,--no-warn-rwx-segments) endif -ifeq ($(CONFIG_EFI_STUB),y) # ensure that the static EFI stub library will be pulled in, even if it is # never referenced explicitly from the startup code LDFLAGS_vmlinux +=3D -u efi_pe_entry -endif LDFLAGS_vmlinux +=3D -T =20 hostprogs :=3D mkpiggy diff --git a/arch/x86/boot/compressed/error.c b/arch/x86/boot/compressed/er= ror.c index 19a8251de506..f2d21e57c109 100644 --- a/arch/x86/boot/compressed/error.c +++ b/arch/x86/boot/compressed/error.c @@ -24,7 +24,6 @@ void error(char *m) } =20 /* EFI libstub provides vsnprintf() */ -#ifdef CONFIG_EFI_STUB void panic(const char *fmt, ...) { static char buf[1024]; @@ -40,4 +39,3 @@ void panic(const char *fmt, ...) =20 error(buf); } -#endif diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S index 10b2971320f3..776bd0631bce 100644 --- a/arch/x86/boot/header.S +++ b/arch/x86/boot/header.S @@ -41,7 +41,6 @@ SYSSEG =3D 0x1000 /* historical load address >> 4 */ # EFI PECOFF header ######################################################= #### =20 .section ".header", "a" -#ifdef CONFIG_EFI_STUB # "MZ", MS-DOS header .word IMAGE_DOS_SIGNATURE .org 0x38 @@ -222,8 +221,6 @@ pecompat_fstart: =20 .set section_count, (. - section_table) / 40 =20 -#endif /* CONFIG_EFI_STUB */ - # bzImage header #########################################################= #### =20 # hdr should be at address 0x1f1; -2 for the sentinel --=20 2.52.0