mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Simon Glass <sjg@chromium.org>
Cc: ubizjak@gmail.com, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org, bp@alien8.de,
	dave.hansen@linux.intel.com, kas@kernel.org, kees@kernel.org,
	linux-coco@lists.linux.dev, mingo@redhat.com, nathan@kernel.org,
	peterz@infradead.org, pmladek@suse.com,
	rick.p.edgecombe@intel.com, tglx@kernel.org, x86@kernel.org
Subject: Re: [PATCH v1 08/14] x86: make CONFIG_EFI_STUB unconditional
Date: Thu, 29 Jan 2026 14:22:37 -0800	[thread overview]
Message-ID: <F5FE8FBD-1CE9-4009-AF91-E517271A9999@zytor.com> (raw)
In-Reply-To: <CAFLszTiQ_BAMGJPJfAV4TXiELvZn12+wX2txBuzMcQ_nw2kzOg@mail.gmail.com>

On January 29, 2026 2:13:13 PM PST, Simon Glass <sjg@chromium.org> wrote:
>Hi Peter,
>
>On Tue, 27 Jan 2026 at 16:22, H. Peter Anvin <hpa@zytor.com> wrote:
>>
>> On January 26, 2026 7:14:27 PM PST, Simon Glass <sjg@chromium.org> wrote:
>> >Hi Peter,
>> >
>> >On Tue, 27 Jan 2026 at 15:55, H. Peter Anvin <hpa@zytor.com> wrote:
>> >>
>> >> On January 26, 2026 5:44:43 PM PST, Simon Glass <sjg@chromium.org> wrote:
>> >> >Hi Peter,
>> >> >
>> >> >On Tue, 27 Jan 2026 at 11:21, H. Peter Anvin <hpa@zytor.com> wrote:
>> >> >>
>> >> >> On 2026-01-26 13:19, Simon Glass wrote:
>> >> >> >>
>> >> >> >> Including the EFI stub doesn't mean using EFI to boot is required.
>> >> >> >
>> >> >> > Yes, understood, but it adds bloat. More importantly it will lead to
>> >> >> > people assuming that the stub is always used and thus unwittingly blur
>> >> >> > the boundary between the stub and the kernel itself.
>> >> >> >
>> >> >> > What is the actual need for this?
>> >> >> >
>> >> >>
>> >> >> I would argue that the opposite is more likely: someone inadvertently builds a
>> >> >> kernel without the stub, the bootloader goes down a legacy support path and
>> >> >> things seems to work... except for some platform subtleties.
>> >> >>
>> >> >> The bloat is there, but it is small and is only in the on-disk kernel image;
>> >> >> it is zero at runtime.
>> >> >>
>> >> >> As such, I don't think this option is a particularly good idea anymore. If
>> >> >> necessary, it could be hidden behind an EXPERT option, but I first wanted to
>> >> >> see who if anyone actually cares in a meaningful way to maintain this option.
>> >> >> Every option, after all, adds maintenance burden.
>> >> >>
>> >> >> Note that the BIOS stub is unconditionally compiled and included, and that has
>> >> >> not been an issue.
>> >> >
>> >> >What is the maintenance burden here? I could potentially take that on,
>> >> >but I would first want to understand what is involved.
>> >> >
>> >> >The use of the word 'legacy' worries me too. Is this patch a step
>> >> >towards removing the non-EFI path?
>> >> >
>> >> >Regards,
>> >> >Simon
>> >
>> >(joining the threads)
>> >
>> >> Bypassing the firmware stub (BIOS or EFI) is really only appropriate for special user cases, like kexec, because it removes the ability for the kernel to deal with system issues at an early point.
>> >
>> >Does this dealing happen in the EFI stub, or later? Are you referring
>> >to ACPI fix-ups or something else?
>> >
>> >>
>> >> However, kexec needs it, and it's not going to go away. However, that doesn't mean we should encourage this in cases which doesn't need it (no matter what the Grub maintainers tell you.)
>> >>
>> >> Now, if you are using KVM without EFI you are probably doing BIOS boot (regardless of if you know it or not), entering via the BIOS firmware stub.
>> >
>> >I am thinking of the 64-bit entry point to the kernel. everything
>> >being laid out in memory ready to go.
>> >
>> >>
>> >> I just realized you are the U-boot maintainer, so I'm assuming you are thinking of the case where there is no UEFI or BIOS firmware. In that case, just like as for kexec, the current entry point will continue to work, of course.
>> >>
>> >> What we don't want is having to suffer being on a BIOS or EFI system but not being able to leverage it for the benefit of the kernel. The kernel image is much easier to upgrade.
>> >
>> >More generally I am thinking about a simple and clean API for the
>> >kernel that doesn't involve having to provide 30K lines of firmware
>> >code just to boot. The BIOS entry point (if that is what it is called)
>> >is quite close to this ideal, even though I know it has shortcomings.
>> >
>> >Regards,
>> >Simon
>>
>> Yes, I understand.
>>
>> The 32/64-bit entrypoints aren't going away; it would be impossible to do so.
>>
>
>OK, so 'depend on EXPORT' seems good to me.
>
>> The general rule is: do things as late in the boot process as possible, but no later.
>>
>
>Just on this point, I wonder how we should define 'late', in the
>context of EFI. For example, if the kernel stub reads a file, meaning
>it calls back into Tianocore, it is using both early and late code.
>
>Regards,
>Simon

"Early" in this context is before ExitBootServices().

  reply	other threads:[~2026-01-29 22:23 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260119192923.651588-1-hpa@zytor.com>
2026-01-20 19:53 ` [PATCH v1 00/14] x86 boot code cleanups, batch 1 H. Peter Anvin
2026-01-20 19:53   ` [PATCH v1 01/14] x86/realmode: remove I/O port paravirtualization H. Peter Anvin
2026-01-20 21:47     ` David Laight
2026-01-21 12:27     ` Kiryl Shutsemau
2026-01-28 17:01     ` Borislav Petkov
2026-01-20 19:53   ` [PATCH v1 02/14] x86/realmode: make %gs == 0 an invariant H. Peter Anvin
2026-01-20 22:40     ` David Laight
2026-01-20 22:51       ` H. Peter Anvin
2026-01-21  0:47       ` H. Peter Anvin
2026-01-21 10:03     ` Uros Bizjak
2026-01-20 19:53   ` [PATCH v1 03/14] x86/boot: use <linux/compiler.h> H. Peter Anvin
2026-01-21 10:04     ` Uros Bizjak
2026-01-20 19:53   ` [PATCH v1 04/14] x86/boot: modernize the segment structure for the header and setup H. Peter Anvin
2026-01-20 19:53   ` [PATCH v1 05/14] x86/boot: call puts() from within die() H. Peter Anvin
2026-01-21 10:07     ` Uros Bizjak
2026-01-20 19:53   ` [PATCH v1 06/14] x86/boot: add comment barriers for the different headers H. Peter Anvin
2026-01-20 19:53   ` [PATCH v1 07/14] x86/boot: factor out the 16-bit startup code from header.S H. Peter Anvin
2026-01-21 10:08     ` Uros Bizjak
2026-01-20 19:54   ` [PATCH v1 08/14] x86: make CONFIG_EFI_STUB unconditional H. Peter Anvin
2026-01-20 19:54   ` [PATCH v1 09/14] x86/boot: make the relocatable kernel unconditional H. Peter Anvin
2026-01-20 19:54   ` [PATCH v1 10/14] x86/boot: explicitly put the old command line pointer in header.S H. Peter Anvin
2026-01-20 19:54   ` [PATCH v1 11/14] x86/boot: use __seg_fs and __seg_gs in the real-mode boot code H. Peter Anvin
2026-01-21  8:56     ` Uros Bizjak
2026-01-21  9:40       ` Uros Bizjak
2026-01-21 15:13       ` H. Peter Anvin
2026-01-21 16:03         ` Uros Bizjak
2026-01-22 18:57       ` [PATCH v1 08/14] x86: make CONFIG_EFI_STUB unconditional Simon Glass
2026-01-23  0:11         ` H. Peter Anvin
2026-01-26 21:19           ` Simon Glass
2026-01-26 22:20             ` H. Peter Anvin
2026-01-27  1:44               ` Simon Glass
2026-01-27  2:39                 ` H. Peter Anvin
2026-01-27  2:54                 ` H. Peter Anvin
2026-01-27  3:14                   ` Simon Glass
2026-01-27  3:21                     ` H. Peter Anvin
2026-01-29 22:13                       ` Simon Glass
2026-01-29 22:22                         ` H. Peter Anvin [this message]
2026-01-21 16:07     ` [PATCH v1 11/14] x86/boot: use __seg_fs and __seg_gs in the real-mode boot code Uros Bizjak
2026-01-20 19:54   ` [PATCH v1 12/14] x86/boot: tweak a20.c for better code generation H. Peter Anvin
2026-01-21 10:10     ` Uros Bizjak
2026-01-21 11:49     ` David Laight
2026-01-24  3:00       ` Maciej W. Rozycki
2026-01-24  4:24         ` H. Peter Anvin
2026-01-24 23:07           ` David Laight
2026-01-24 23:16             ` H. Peter Anvin
2026-01-24 23:40               ` H. Peter Anvin
2026-01-20 19:54   ` [PATCH v1 13/14] x86/boot: simplify x86/boot/cmdline.c by using __seg_fs H. Peter Anvin
2026-01-21 10:11     ` Uros Bizjak
2026-01-20 19:54   ` [PATCH v1 14/14] compiler-gcc: Remove obsolete RELOC_HIDE() macro H. Peter Anvin
2026-01-21 10:18   ` [PATCH v1 00/14] x86 boot code cleanups, batch 1 Uros Bizjak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F5FE8FBD-1CE9-4009-AF91-E517271A9999@zytor.com \
    --to=hpa@zytor.com \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=kas@kernel.org \
    --cc=kees@kernel.org \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=nathan@kernel.org \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=rick.p.edgecombe@intel.com \
    --cc=sjg@chromium.org \
    --cc=tglx@kernel.org \
    --cc=ubizjak@gmail.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®