Re: [PATCHv7 00/13] kexec: Use BPF lskel to enable kexec to load PE format boot image

From: Jason Gunthorpe

Date: Tue Oct 13 2026 - 20:02:45 EST


On Tue, Oct 13, 2026 at 09:19:28PM +0200, Ard Biesheuvel wrote:
> > 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.
>
> With some help from my friend Claude, I've prepared a prototype that
> reuses my efiloader Rust crate to boot EFI stub images (bare Image,
> zboot, UKI) in the kernel: the EFI boot phase is invoked at kexec
> load time, and runs under the preceding kernel up until the point
> where ExitBootServices() is called. Then, the actual kexec call
> will return from ExitBootServices() after shutting down the first
> kernel.

Running it inside a kthread is such a novel idea, I would have never
thought to attempt that!

I've asked some folks here to take a look and try to test this with
real DRTM capable HW. It seems very promising that it will work to me,
and I surmize this is also close to boot a UKI?

Seems amazing! Thanks a lot for drafting it!

Jason