From patchwork Wed Feb 11 14:32:48 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 117 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770820437; bh=8Bj9PaXVgy5u62Y+H6fMXARVHJP0YE8UTxFEKev6g8g=; h=From:To:Date:CC:Subject:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=KIGh+yC7hLJ6+9QLYcnbpnghqXZLJyDW36Y45+SQ7ht7PiYF7cnW28pZDTdalGItp anV8gJkv7kcmUDOVzJNND6maG41xCZZ3/HZ3f7IuEg/NigXV1NiDBAAdAcMEGI/ewn EYyZ3wGAgBjDpLkjrBACaGJMHw8TpaHoi29QZP2G1R7U+Q7YY6I1etaC3ikiQCi0qL ygOroN/kzwCVkPEBf5hd5vfLxhcIAR9a9jwH3jlKtap2dh3tOGzvjqNNZ9bAZR9y3z mL5qSbB4GQ3bAVUQkYAeSuKXNXV2xgB0W6oJQjEJdPr+vuGMlMAxSbPtCC9J89aIbK jj1x+1fhnzRuw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 31B5B69A8D for ; Wed, 11 Feb 2026 07:33:57 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id yLfPQMgQDd81 for ; Wed, 11 Feb 2026 07:33:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770820437; bh=8Bj9PaXVgy5u62Y+H6fMXARVHJP0YE8UTxFEKev6g8g=; h=From:To:Date:CC:Subject:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=KIGh+yC7hLJ6+9QLYcnbpnghqXZLJyDW36Y45+SQ7ht7PiYF7cnW28pZDTdalGItp anV8gJkv7kcmUDOVzJNND6maG41xCZZ3/HZ3f7IuEg/NigXV1NiDBAAdAcMEGI/ewn EYyZ3wGAgBjDpLkjrBACaGJMHw8TpaHoi29QZP2G1R7U+Q7YY6I1etaC3ikiQCi0qL ygOroN/kzwCVkPEBf5hd5vfLxhcIAR9a9jwH3jlKtap2dh3tOGzvjqNNZ9bAZR9y3z mL5qSbB4GQ3bAVUQkYAeSuKXNXV2xgB0W6oJQjEJdPr+vuGMlMAxSbPtCC9J89aIbK jj1x+1fhnzRuw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1DAE669A8A for ; Wed, 11 Feb 2026 07:33:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770820435; bh=7hxIIcpVKMkEGzGD5vPLvwTaSxvaQvIskMWWOYGD0c0=; h=From:To:Cc:Subject:Date:From; b=T2JaWLJOiMYRVdbvGcCWMCWx9cY4zz+ozIWnl4C1Z9N7GcjwpJl3iyNU9siQhvGFn AKHW28ih0VuMPchjDZUsPqx2kX34Ez0tORgtphspqXrCafiouHp8SzirpWwXHusWj4 7BJEac5sRx/ZG72Xc8Yc/REudt8qWmk9Qg2BTNqavsi54wTonp/bcIiq4c+gmzu6B5 /AOThOd2hUuiij2x5J0toCFPU2u7yxLGA3NmdZdbWDf+Fzfqn5uF/RybdKD7Vt97UW D89++OgRuiI8pWuZ6L3IohvOYCY62Kt6WDV2GEXb62rY9+5kmqPLXkb/yHJ8t4+LPy oy6zdLyu9+nHA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1888169A89; Wed, 11 Feb 2026 07:33:55 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id US12bAAxLVHz; Wed, 11 Feb 2026 07:33:55 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770820430; bh=NJXvSNknjpNjTd8dugEaRJ26W17vzUK4syoNgv2c57k=; h=From:To:Cc:Subject:Date:From; b=flei5aM7eL+IL61mX6LcndtJhoHoj4gN6TeWFd/OMdE3ZyOsblbLX6tUa+J9Bgeex 7nNK6nlYMzO8z96+NPzSAgdFma59rXzMEk3gIhbFabiLEgKzRXQZTO5H3k5zlvQmAq y2awdnro0reJyRoXpTM9w0Ojp1nYzBCOZcErGHDBLkS6gtNDTcFMH2HE8Saifo+EBn KnfsVq1lovpRPtu6yHdFUiwlrMtTy7x96tuA9yPAxQ9TiNsdOwhnME90csIseaET2w FsP7wLpjj+llMTOmO0BGSj32zb+Wu13RcMEiVP3WZzUU+eFRjCh7NI5zJLztnnu/bi j6vtvOZPs0rNg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 8C5E2699BF; Wed, 11 Feb 2026 07:33:50 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 11 Feb 2026 07:32:48 -0700 Message-ID: <20260211143309.1183113-1-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Message-ID-Hash: XKFQSIF4IBLT6USBG2FLXDK7RBCHOC7V X-Message-ID-Hash: XKFQSIF4IBLT6USBG2FLXDK7RBCHOC7V X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 00/12] x86: Add single 64-bit U-Boot without SPL for QEMU List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass This series adds support for building a single 64-bit U-Boot binary with integrated 16-bit and 32-bit startup code, eliminating the need for SPL on platforms where RAM is available immediately (e.g. QEMU). The new start_from_32.S enters in 32-bit protected mode (from start16.S), builds identity-mapped page tables with 2MB pages, enables SSE and PAE, then transitions to 64-bit long mode before calling board_init_f(). Since the 64-bit binary is linked as PIE, the 16-bit startup objects cannot be linked into it directly. Instead they are linked into a separate 32-bit ELF and their sections are extracted to binary files for binman. Along the way this moves the x86 16-bit binary rules from the top-level Makefile into arch/x86/Makefile, and switches x86_64 to use MSR_FS_BASE for the global data pointer instead of a writable global variable. Tested on QEMU x86_64 - boots to the command prompt. The existing SPL-based qemu-x86_64 and 32-bit qemu-x86 builds are unaffected. Simon Glass (12): x86: Allow disabling the regparm calling-convention x86: Use MSR_FS_BASE for gd pointer on x86_64 efi: Cache gd->relocaddr for EFI runtime services x86: Move 16-bit binary rules to arch/x86/Makefile x86: Exclude X86_32BIT_INIT for 64-bit builds x86: Build 16-bit startup objects as 32-bit for x86_64 x86: Link 16-bit startup into separate 32-bit ELF x86: Add 32-to-64-bit startup code x86: Add qemu-x86_64_nospl defconfig x86: qemu: Enable MTRR setup for x86_64 no-SPL scripts: build-qemu: Add --no-spl option for x86_64 CI: Add test coverage for qemu-x86_64_nospl .azure-pipelines.yml | 3 + .gitlab-ci.yml | 6 + Makefile | 10 - arch/x86/Kconfig | 24 +- arch/x86/Makefile | 39 +++ arch/x86/config.mk | 2 + arch/x86/cpu/Makefile | 15 ++ arch/x86/cpu/i386/interrupt.c | 10 +- arch/x86/cpu/qemu/qemu.c | 4 +- arch/x86/cpu/start.S | 23 +- arch/x86/cpu/start_from_32.S | 248 ++++++++++++++++++ arch/x86/cpu/start_from_spl.S | 21 +- arch/x86/cpu/start_from_tpl.S | 19 +- arch/x86/cpu/u-boot-16bit.lds | 30 +++ arch/x86/cpu/x86_64/cpu.c | 2 + arch/x86/cpu/x86_64/misc.c | 12 +- arch/x86/dts/emulation-u-boot.dtsi | 2 +- arch/x86/include/asm/global_data.h | 26 +- board/emulation/qemu-x86/MAINTAINERS | 1 + configs/qemu-x86_64_nospl_defconfig | 82 ++++++ lib/efi_loader/efi_runtime.c | 19 +- scripts/build-qemu | 9 +- .../bin/travis-ci/conf.qemu-x86_64_nospl_na | 30 +++ .../u_boot_boardenv_qemu_x86_64_nospl_na.py | 14 + 24 files changed, 613 insertions(+), 38 deletions(-) create mode 100644 arch/x86/cpu/start_from_32.S create mode 100644 arch/x86/cpu/u-boot-16bit.lds create mode 100644 configs/qemu-x86_64_nospl_defconfig create mode 100644 test/hooks/bin/travis-ci/conf.qemu-x86_64_nospl_na create mode 100644 test/hooks/py/travis-ci/u_boot_boardenv_qemu_x86_64_nospl_na.py