From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1px54T-0005RH-3l for mharc-grub-devel@gnu.org; Thu, 11 May 2023 08:06:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1px54N-0005QI-UK for grub-devel@gnu.org; Thu, 11 May 2023 08:06:51 -0400 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1px54K-0002Rw-RN for grub-devel@gnu.org; Thu, 11 May 2023 08:06:51 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E819861ABC; Thu, 11 May 2023 12:06:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81394C433EF; Thu, 11 May 2023 12:06:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683806805; bh=HT2+4sqX06i5W9HDnlSLos8s4puv28uwvQyqQVHLD8E=; h=From:To:Cc:Subject:Date:From; b=LP+19iL+VHfCvFajmbfhp/gyilzMB1Vc6PVfaBuFSxqE86trSQu+haMDZ1Hd5Ya0U tC3d8JuO6A4PG3jiCgPwY3JvXTat0FzBiAxabXbKqmHXF8gq0ySct24F2vTxT/3aYe IrycVWllupZUCH5dn7eXz0DkEKh/0xgQTOkZxbhTXKu7U6dIsqtIfEk2K9THG4XTJa E0sd4z5eRENBZKmAV/xM49lwk4Icbodv/M2Br98u66oKOVgnO3pr6oswmmvFNid88G tw0GaBiXFGKdv5nj2Ok7STPNL00nke/DPRNT1CzT9gWWE/Fl+G9UP6dzgeQ2wyM+2S /7DxP0mLC9mRg== From: Ard Biesheuvel To: grub-devel@gnu.org Cc: dkiper@net-space.pl, Ard Biesheuvel Subject: [PATCH v2 0/6] efi: Implement generic EFI boot for x86 Date: Thu, 11 May 2023 14:06:34 +0200 Message-Id: <20230511120640.3518732-1-ardb@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=5600; i=ardb@kernel.org; h=from:subject; bh=HT2+4sqX06i5W9HDnlSLos8s4puv28uwvQyqQVHLD8E=; b=owGbwMvMwCFmkMcZplerG8N4Wi2JISXmlkd2/qyuR0KduWLTBNdmpAdLmx220OoXmqPwtFT3i NDX2w86SlkYxDgYZMUUWQRm/3238/REqVrnWbIwc1iZQIYwcHEKwES2WTP8D5g+k3WSDFfmn4tX Uk7MfstcWH25SmaXWv/OAr0rMwS2hzMyfOadH/7j+MLurJXVUyUiHR8uXn5jgtaHR1ynv039IOh 9gxsA X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2604:1380:4641:c500::1; envelope-from=ardb@kernel.org; helo=dfw.source.kernel.org X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 May 2023 12:06:52 -0000 Switch the i386-efi and x86_64-efi builds to the generic EFI loader, which enters the Linux kernel via the EFI stub and provides the initrd via the LoadFile2 protocol. This unifies x86 with other EFI architectures, and removes the dependency on the setup header and struct bootparams. Do some preparatory cleanup first, so we no longer need to rely on the MS to SysV calling convention translation code. Changes since v1: - drop Itanium support, which is a maintenance burden as it shares the EFI code with other architectures, but does not have a EFI stub in Linux, and there is no way to test whether our changes break the boot for it or not; - enable generic EFI for i386 as well - wire up the existing x86 code as a fallback for kernels that lack EFI stub or LoadFile2 support. This removes the need for additional changes to support v5.8 or older kernels. Ard Biesheuvel (6): ia64: Remove support efi: Make EFI PXE protocol methods non-callable efi: Add calling convention annotation to all prototypes efi: Drop all uses of efi_call_XX wrappers efi: Remove x86_64 call wrappers efi: Use generic EFI loader for x86_64 and i386 .travis.yml | 7 +- Makefile.util.def | 1 - configure.ac | 8 - docs/grub-dev.texi | 2 +- docs/grub.texi | 2 +- gentpl.py | 6 +- grub-core/Makefile.am | 6 - grub-core/Makefile.core.def | 21 +- grub-core/commands/acpi.c | 8 +- grub-core/commands/efi/efitextmode.c | 8 +- grub-core/commands/efi/lsefi.c | 5 +- grub-core/commands/efi/tpm.c | 21 +- grub-core/commands/file.c | 33 - grub-core/disk/efi/efidisk.c | 7 +- grub-core/kern/arm/efi/init.c | 12 +- grub-core/kern/dl.c | 12 - grub-core/kern/efi/efi.c | 56 +- grub-core/kern/efi/init.c | 15 +- grub-core/kern/efi/mm.c | 17 +- grub-core/kern/emu/cache.c | 4 +- grub-core/kern/emu/cache_s.S | 2 +- grub-core/kern/emu/lite.c | 3 - grub-core/kern/i386/efi/tsc.c | 2 +- grub-core/kern/ia64/cache.c | 35 - grub-core/kern/ia64/dl.c | 150 ----- grub-core/kern/ia64/dl_helper.c | 241 ------- grub-core/kern/ia64/efi/init.c | 80 --- grub-core/kern/ia64/efi/startup.S | 44 -- grub-core/kern/misc.c | 2 +- grub-core/kern/x86_64/efi/callwrap.S | 129 ---- grub-core/lib/efi/datetime.c | 9 +- grub-core/lib/efi/halt.c | 6 +- grub-core/lib/efi/relocator.c | 6 +- grub-core/lib/ia64/longjmp.S | 162 ----- grub-core/lib/ia64/setjmp.S | 177 ------ grub-core/lib/setjmp.S | 3 - grub-core/loader/efi/appleloader.c | 8 +- grub-core/loader/efi/chainloader.c | 20 +- grub-core/loader/efi/linux.c | 51 +- grub-core/loader/i386/linux.c | 8 + grub-core/loader/ia64/efi/linux.c | 607 ------------------ grub-core/mmap/efi/mmap.c | 16 +- grub-core/net/drivers/efi/efinet.c | 26 +- grub-core/term/efi/console.c | 29 +- grub-core/term/efi/serial.c | 18 +- grub-core/video/efi_gop.c | 18 +- grub-core/video/efi_uga.c | 8 +- include/grub/cache.h | 2 +- include/grub/dl.h | 12 +- include/grub/efi/api.h | 666 +++++++++----------- include/grub/efi/efi.h | 2 +- include/grub/efi/pe32.h | 2 - include/grub/efi/tpm.h | 149 +++-- include/grub/elf.h | 109 ---- include/grub/ia64/efi/memory.h | 6 - include/grub/ia64/efi/time.h | 23 - include/grub/ia64/kernel.h | 25 - include/grub/ia64/reloc.h | 44 -- include/grub/ia64/setjmp.h | 28 - include/grub/ia64/time.h | 28 - include/grub/ia64/types.h | 32 - include/grub/misc.h | 2 +- include/grub/util/install.h | 1 - include/grub/util/mkimage.h | 2 - tests/core_compress_test.in | 2 +- util/grub-install-common.c | 1 - util/grub-install.c | 16 - util/grub-mkimage.c | 1 - util/grub-mkimagexx.c | 175 +---- util/grub-mknetdir.c | 1 - util/grub-mkrescue.c | 7 - util/grub-module-verifier.c | 22 - util/mkimage.c | 17 - 73 files changed, 610 insertions(+), 2876 deletions(-) delete mode 100644 grub-core/kern/ia64/cache.c delete mode 100644 grub-core/kern/ia64/dl.c delete mode 100644 grub-core/kern/ia64/dl_helper.c delete mode 100644 grub-core/kern/ia64/efi/init.c delete mode 100644 grub-core/kern/ia64/efi/startup.S delete mode 100644 grub-core/kern/x86_64/efi/callwrap.S delete mode 100644 grub-core/lib/ia64/longjmp.S delete mode 100644 grub-core/lib/ia64/setjmp.S delete mode 100644 grub-core/loader/ia64/efi/linux.c delete mode 100644 include/grub/ia64/efi/memory.h delete mode 100644 include/grub/ia64/efi/time.h delete mode 100644 include/grub/ia64/kernel.h delete mode 100644 include/grub/ia64/reloc.h delete mode 100644 include/grub/ia64/setjmp.h delete mode 100644 include/grub/ia64/time.h delete mode 100644 include/grub/ia64/types.h -- 2.39.2