From: Jason Gunthorpe <jgg@nvidia.com>
To: Pingfan Liu <piliu@redhat.com>, Ard Biesheuvel <ardb@kernel.org>,
Mark Rutland <mark.rutland@arm.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
John Fastabend <john.fastabend@gmail.com>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <martin.lau@linux.dev>,
Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
Jeremy Linton <jeremy.linton@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>, Simon Horman <horms@kernel.org>,
Gerd Hoffmann <kraxel@redhat.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Philipp Rudo <prudo@redhat.com>, Viktor Malik <vmalik@redhat.com>,
Jan Hendrik Farr <kernel@jfarr.cc>, Baoquan He <bhe@redhat.com>,
Dave Young <dyoung@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
kexec@lists.infradead.org, bpf@vger.kernel.org,
systemd-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCHv7 00/13] kexec: Use BPF lskel to enable kexec to load PE format boot image
Date: Sun, 11 Oct 2026 17:13:25 -0300 [thread overview]
Message-ID: <20261011201325.GA918242@nvidia.com> (raw)
In-Reply-To: <20260322014402.8815-1-piliu@redhat.com>
On Sun, Mar 22, 2026 at 09:43:49AM +0800, Pingfan Liu wrote:
> *** The history ***
>
> Nowadays, UEFI PE bootable images are becoming increasingly popular
> among distributions. Currently, we have several kinds of image format
> parsers in user space (kexec-tools). However, this approach breaks the
> integrity protection of the images. To address this integrity protection
> concern, several approaches have been proposed to resolve this issue,
> but none of them have been accepted upstream yet.
>
> The summary of those approaches:
> -1. UEFI service emulator for UEFI stub
> -2. PE format parser in kernel
> -3. Signing the arm64/boot/Image
I recently had an interesting discussion with Ard around DRTM for
kexec and we sort of independently concluded that #1 would be the best
(only?) option there.
All the implementations of DRTM today live in the EFI stub and
intercept the boot process as it goes along. After ExitBootServices
the DRTM implementation will launch the kernel in a different way.
Even worse today's x86 version strongly requires EFI boot services to
connect the Linux stub with a trampoline helper provided earlier in
the boot chain.
A kexec flow that only works on decompressed vmlinux, with no option
to run any EFI code, is going to be difficult to support. There is
enough information and choices involved in DRTM that it is undesirable
for the predecessor kernel to try and DRTM launch it on behalf of the
successor, let alone trying to get the insane x86 trampolines into a
kexec successor kernel.
Given those constraints entering the successor kernel through the
normal EFI entry point is highly desirable. This would allow x86 to
continue to provide the DRTM trampolines through an EFI mechanism and
means the Linux EFI stub always handles the launch with identical code
in all scenarios.
I reviewed the earlier threads and it wasn't clear why this was
abandoned? The points Ard raised are legitimate, but I would respond
to them:
https://lore.kernel.org/lkml/20240819145417.23367-1-piliu@redhat.com/T/#m8519beebccb252861b257db390a1686686b27aeb
> 1) Implementing UEFI entirely is intractable, and unnecessary.
Yes, I think that is the entire point of the general idea, that we
should strive to have some limited EFI that is just useful enough to
boot a UKI through to the kernel EFI entry point.
> 2) Running the UEFI emulator on bare metal is not going to scale.
Well, I don't think everyone will have that choice. At least DRTM
requires things like ARM SMCs, and x86 requires ACPI parsing, it would
be really tricky to get those things into a userspace context.
I would recast this idea as "having the kernel community own a UEFI
emulator for every kind of bare metal is not scalable"
> 3. We need to figure out how to support TPM and PCRs in the context
> of kexec.
AFAIK it doesn't really work today. DRTM significantly fixes it, and
passing more PCR logs fixes it even more. Though I don't see that it
has much to do with using the EFI entry point.. It is a good question
what should systemd-shim do in a kexec case, or more generally when
DRTM is being used. (for drtm it should probably not do anything with
PCRs)
IMHO, the kernel shouldn't get involved. It shouldn't try to integrate
an EFI emulator. The kexec path in the kernel should allow userspace
to provide a signed executable which is the emulator it wants to use
and let other people sort it out in their own projects. Distros can
sign the emulators they like.
There are already two examples of emulators that can EFI Boot the
kernel so there is definitely something achievable that many people
can use. If someone wants to go crazy and support Grub, console,
userspace EFI, etc, they can do that on their own git :)
Down this path the kernel work should simply be supporting a signed
executable (not vmlinux), and a robust way to pass more information
through a FDT to that executable. Such that userspace can get the EFI
emulator, the UKI, side cars and anything else nicely organized and
labeled in a FDT so the EFI emulator has an easy job.
In the current AI fueled world this looks much more tractable than it
did in 2024 when this was last brought up.
Regards,
Jason
prev parent reply other threads:[~2026-10-11 20:13 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-22 1:43 Pingfan Liu
2026-03-22 1:43 ` [PATCHv7 01/13] bpf: Introduce kfuncs to parser buffer content Pingfan Liu
2026-03-22 2:14 ` bot+bpf-ci
2026-03-22 1:43 ` [PATCHv7 02/13] kexec_file: Use bpf-prog to decompose image Pingfan Liu
2026-03-22 2:14 ` bot+bpf-ci
2026-03-22 1:43 ` [PATCHv7 03/13] lib/decompress: Keep decompressor when CONFIG_KEEP_DECOMPRESSOR Pingfan Liu
2026-03-22 2:26 ` bot+bpf-ci
2026-03-22 1:43 ` [PATCHv7 04/13] kexec_file: Implement decompress method for parser Pingfan Liu
2026-03-22 2:26 ` bot+bpf-ci
2026-03-22 1:43 ` [PATCHv7 05/13] kexec_file: Implement copy " Pingfan Liu
2026-03-22 1:43 ` [PATCHv7 06/13] kexec_file: Chain the stages into a pipeline Pingfan Liu
2026-03-22 2:14 ` bot+bpf-ci
2026-03-22 1:43 ` [PATCHv7 07/13] kexec_file: Introduce a bpf-prog lskel to run a format parser Pingfan Liu
2026-03-22 1:43 ` [PATCHv7 08/13] kexec_file: Factor out routine to find a symbol in ELF Pingfan Liu
2026-03-22 2:14 ` bot+bpf-ci
2026-03-23 7:07 ` kernel test robot
2026-03-23 10:19 ` kernel test robot
2026-03-22 1:43 ` [PATCHv7 09/13] kexec_file: Integrate bpf light skeleton to load image with bpf-prog Pingfan Liu
2026-03-22 2:14 ` bot+bpf-ci
2026-03-22 1:43 ` [PATCHv7 10/13] arm64/kexec: Select KEXEC_BPF to support UEFI-style kernel image Pingfan Liu
2026-03-22 1:44 ` [PATCHv7 11/13] tools/kexec: Introduce a bpf-prog to handle zboot image Pingfan Liu
2026-03-22 2:26 ` bot+bpf-ci
2026-03-22 1:44 ` [PATCHv7 12/13] tools/kexec: Introduce a bpf-prog to handle UKI image Pingfan Liu
2026-03-22 1:44 ` [PATCHv7 13/13] tools/kexec: Introduce a tool to build zboot envelop Pingfan Liu
2026-03-23 19:02 ` [PATCHv7 00/13] kexec: Use BPF lskel to enable kexec to load PE format boot image Andrew Morton
2026-03-24 7:09 ` Pingfan Liu
2026-10-11 20:13 ` Jason Gunthorpe [this message]
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=20261011201325.GA918242@nvidia.com \
--to=jgg@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=andrii@kernel.org \
--cc=ardb@kernel.org \
--cc=ast@kernel.org \
--cc=bhe@redhat.com \
--cc=bpf@vger.kernel.org \
--cc=catalin.marinas@arm.com \
--cc=daniel@iogearbox.net \
--cc=dyoung@redhat.com \
--cc=eddyz87@gmail.com \
--cc=horms@kernel.org \
--cc=jeremy.linton@arm.com \
--cc=john.fastabend@gmail.com \
--cc=kernel@jfarr.cc \
--cc=kexec@lists.infradead.org \
--cc=kraxel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=martin.lau@linux.dev \
--cc=piliu@redhat.com \
--cc=prudo@redhat.com \
--cc=song@kernel.org \
--cc=systemd-devel@lists.freedesktop.org \
--cc=vkuznets@redhat.com \
--cc=vmalik@redhat.com \
--cc=will@kernel.org \
--cc=yonghong.song@linux.dev \
/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®