Re: [PATCH v2 01/10] x86/boot: Drop pointless re-implementation of panic()
From: Ard Biesheuvel
Date: Sun Sep 13 2026 - 12:36:06 EST
On Sat, 12 Sep 2026, at 19:54, Borislav Petkov wrote:
> On Sat, Sep 12, 2026 at 10:41:56AM +0200, Ard Biesheuvel wrote:
>> If you're not taking it as a fix, then yes, please.
>
> Help me understand the exact problem pls:
>
> That panic() function gets called by arch_accept_memory() and *that* gets
> called only by code in drivers/firmware/efi/libstub/unaccepted_memory.c or
> drivers/firmware/efi/unaccepted_memory.c (but that uses the kernel proper
> panic() one).
>
> So we *are* in the context of EFI boot services.
>
> What am I missing?
>
Right, I'd missed that.
But when booting via the EFI stub, the decompressor is omitted entirely,
except for some TDX and SEV-SNP code that is shared between them.
This means calling error() is a bad idea, because the TDX initialization
code that overrides the port I/O based __putstr() handling never executes
in that case.
The reason I want to get rid of panic() is because snprintf() is going
to be removed from the EFI stub.
So I think the current patch is still correct. I will follow up with another
one that moves arch_accept_memory() into the EFI stub, and drops the
dependency on error().