Re: [PATCH 2/2] x86/early_printk: Avoid #VE emulation for TDX guest serial output
From: Verma, Vishal L
Date: Thu Sep 10 2026 - 19:45:14 EST
On Thu, 2026-09-10 at 22:48 +0000, sashiko-bot@xxxxxxxxxx wrote:
>
> > +/* Substitute the hypercall accessors, but only in an actual TDX guest */
> > +static __init void early_serial_tdx_init(void)
> > +{
> > + if (!cpu_feature_enabled(X86_FEATURE_TDX_GUEST))
> > + return;
> > +
> > + static_call_update(serial_in, tdx_serial_in);
> > + static_call_update(serial_out, tdx_serial_out);
>
> [Severity: Medium]
> Will calling static_call_update() here trigger a WARN_ON_ONCE during early boot?
>
> Booting a TDX guest with earlyprintk invokes parse_early_param(), which ends
> up calling early_serial_tdx_init() before the static call infrastructure is
> fully set up. Because static_call_init() is an early_initcall that runs much
> later in the boot sequence, static_call_initialized is still 0 at this point.
>
> This unconditionally triggers the WARN_ON_ONCE(!static_call_initialized)
> safety check in __static_call_update(), which dumps a stack trace to the
> boot log and will crash the boot process if panic_on_warn is set.
>
> Should this use the x86-specific static_call_update_early() macro instead,
> which checks the initialization state and safely patches the trampoline
> directly during early boot?
>
>
This Sashiko report is a false positive - for x86's setup_arch(),
static_call_init() happens before parse_early_param().