Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Vishal Verma" <vishal.l.verma@intel.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH v4 2/2] x86/early_printk: Add earlyprintk=tdx to drive the UART with TDVMCALLs
Date: Mon, 05 Oct 2026 23:07:05 +0000	[thread overview]
Message-ID: <20261005230705.8D11F1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20261005-b4-tdx_earlyprintk_tdcalls-v4-2-3f7c56dd568a@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] earlyprintk: missing 'tdx' option in decompression stub parser causes silent loss of early logs
--

commit bd0f2326d287e01b5e4cf6ddb08a23b05a98652a
Author: Vishal Verma <vishal.l.verma@intel.com>

x86/early_printk: Add earlyprintk=tdx to drive the UART with TDVMCALLs

This commit adds an earlyprintk=tdx option to drive the UART with TDVMCALLs
in a TDX guest. This avoids the #VE exception that would normally be required
to emulate port I/O.

> diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
> --- a/arch/x86/kernel/early_printk.c
> +++ b/arch/x86/kernel/early_printk.c

[ ... ]

> @@ -414,6 +429,11 @@ static int __init setup_early_printk(char *buf)
>  			early_serial_init(buf + 4);
>  			early_console_register(&early_serial_console, keep);
>  		}
> +		if (!strncmp(buf, "tdx", 3)) {
> +			early_serial_tdx_init();
> +			early_console_register(&early_serial_console, keep);
> +			break;
> +		}

[Severity: Medium]
Does adding this option here also require an update to the decompression
stub's parser in arch/x86/boot/early_serial_console.c?

The decompression stub uses its own parse_earlyprintk() function to
initialize the UART base address, but it only matches serial, ttyS, and
pciserial. Because it doesn't recognize tdx, early_serial_base remains 0,
and console_init() skips setting up the serial console during
decompression.

Ironically, the older earlyprintk=serial safely avoids #VE in the
decompression stub because early_tdx_detect() overrides pio_ops.f_outb to
use TDVMCALLs. Users migrating to earlyprintk=tdx might unknowingly lose
decompression output.

Should parse_earlyprintk() in the boot code be updated to recognize tdx
as well to avoid losing early logs?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261005-b4-tdx_earlyprintk_tdcalls-v4-0-3f7c56dd568a@intel.com?part=2

      reply	other threads:[~2026-10-05 23:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-05 22:50 [PATCH v4 0/2] x86/tdx: Use TDVMCALLs directly for earlyprintk Vishal Verma
2026-10-05 22:50 ` [PATCH v4 1/2] x86/tdx: Move port I/O definitions to a shared header Vishal Verma
2026-10-05 22:50 ` [PATCH v4 2/2] x86/early_printk: Add earlyprintk=tdx to drive the UART with TDVMCALLs Vishal Verma
2026-10-05 23:07   ` sashiko-bot [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=20261005230705.8D11F1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vishal.l.verma@intel.com \
    /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