Re: [PATCH v3 2/2] x86/early_printk: Add earlyprintk=tdx to drive the UART with TDVMCALLs

From: Verma, Vishal L

Date: Mon Sep 28 2026 - 19:08:18 EST


On Fri, 2026-09-25 at 12:30 +0100, Kiryl Shutsemau wrote:

>
> All these #ifdefs in early_printk.c can go. X86_FEATURE_TDX_GUEST is a
> disabled feature without CONFIG_INTEL_TDX_GUEST, so
> cpu_feature_enabled() folds to zero and the compiler drops the
> static_call_update() calls and the wrappers with them.
>
> Add stubs for tdx_inb() and tdx_outb() to the #else branch in
> <asm/tdx.h> and make the "tdx" case unconditional.

Tried this - it causes an objtool error:

CC arch/x86/kernel/early_printk.o
arch/x86/kernel/early_printk.o: error: objtool: bad .discard.annotate_insn entry: 4 of type 1
make: *** [Makefile:248: __sub-make] Error 2

It can be fixed by adding a __used annotation to the wrappers, but is that
ok?