From: Nikolay Borisov <nik.borisov@suse.com>
To: Vishal Verma <vishal.l.verma@intel.com>,
x86@kernel.org, Dave Hansen <dave.hansen@linux.intel.com>,
Kiryl Shutsemau <kas@kernel.org>,
Rick Edgecombe <rick.p.edgecombe@intel.com>,
Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>
Cc: linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev,
kvm@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH v4 0/2] x86/tdx: Use TDVMCALLs directly for earlyprintk
Date: Tue, 13 Oct 2026 15:13:17 +0300 [thread overview]
Message-ID: <69fb13b5-857c-4819-bc8a-b87d1e7a1e28@suse.com> (raw)
In-Reply-To: <20261005-b4-tdx_earlyprintk_tdcalls-v4-0-3f7c56dd568a@intel.com>
On 6.10.26 г. 1:50 ч., Vishal Verma wrote:
> Background
> ==========
>
> TDX guests have early_printk support, but it is through a roundabout way
> using a #VE exception as a functional mechanism. The exception handler
> has to use TDG.VP.VEINFO.GET to find out what faulted, and then issue
> the TDVMCALL. Simplify this by using a TDVMCALL from the guest which can
> directly perform the port I/O.
>
> Patch details
> =============
>
> Patch 1 is a cleanup that moves the port I/O direction constants to
> arch/x86/include/asm/shared/tdx.h.
>
> Patch 2: Add a new earlyprintk=tdx option, which calls the new
> tdx_serial_in() / tdx_serial_out() helpers to perform the port I/O
> directly using TDVMCALLs.
>
> The serial earlyprintk path is left as is - TD guests using this will
> still take a #VE exception, and the exception handler will perform the
> I/O.
>
> Testing
> =======
>
> Added a counter for the number of COM1 port I/O #VEs handled:
>
> no earlyprintk - ~63000
> earlyprintk=ttyS0 - ~61000
> earlyprintk=tdx - ~35000
>
> The new tdx option nearly halves the number of #VEs handled.
>
> Additionally, ran the usual suite of CI testing, which covers KVM self
> tests, KVM unit tests, and Avocado KVM tests without any regressions.
>
> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> ---
> Changes in v4:
> - Rename the tdx_inb()/tdx_outb() helpers directly to the serial
> accessors with __noendbr annotations, and remove the config ifdefs
> from early_printk.c. (Kiryl)
> - Rebase to v7.3-rc6
> - Link to v3: https://patch.msgid.link/20260922-b4-tdx_earlyprintk_tdcalls-v3-0-6ebaa599df10@intel.com
>
> Changes in v3:
> - Drop the ttySN and baudrate option parsing for earlyprintk=tdx (Dave Hansen)
> - Link to v2: https://patch.msgid.link/20260921-b4-tdx_earlyprintk_tdcalls-v2-0-ad1fde3f25fd@intel.com
>
> Changes in v2:
> - Rebase to v7.3-rc4
> - Move the TDX hypercall helpers into coco/tdx/tdx.c (Kiryl)
> - Add a new earlyprintk=tdx option that implements the direct TDVMCALL
> path (Dave Hansen)
> - Link to v1: https://patch.msgid.link/20260910-b4-tdx_earlyprintk_tdcalls-v1-0-4b2b1bf9001b@intel.com
>
> ---
> Vishal Verma (2):
> x86/tdx: Move port I/O definitions to a shared header
> x86/early_printk: Add earlyprintk=tdx to drive the UART with TDVMCALLs
>
> Documentation/admin-guide/kernel-parameters.txt | 8 ++++++
> arch/x86/include/asm/shared/tdx.h | 6 ++++
> arch/x86/include/asm/tdx.h | 4 +++
> arch/x86/boot/compressed/tdx.c | 4 +--
> arch/x86/coco/tdx/tdx.c | 37 +++++++++++++++++++++----
> arch/x86/kernel/early_printk.c | 20 +++++++++++++
> 6 files changed, 71 insertions(+), 8 deletions(-)
> ---
> base-commit: a90ee4305c4a5df72c11b31dacfdc76e00fcf78a
> change-id: 20260903-b4-tdx_earlyprintk_tdcalls-40d1b21a8ba2
>
> Best regards,
> --
> Vishal Verma <vishal.l.verma@intel.com>
>
>
For the whole series :
Reviewed-by: Nikolay Borisov <nik.borisov@suse.com>
prev parent reply other threads:[~2026-10-13 12:13 UTC|newest]
Thread overview: 7+ 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-09 19:22 ` Edgecombe, Rick P
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-09 15:04 ` Kiryl Shutsemau
2026-10-09 20:18 ` Edgecombe, Rick P
2026-10-13 12:13 ` Nikolay Borisov [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=69fb13b5-857c-4819-bc8a-b87d1e7a1e28@suse.com \
--to=nik.borisov@suse.com \
--cc=corbet@lwn.net \
--cc=dave.hansen@linux.intel.com \
--cc=kas@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-coco@lists.linux.dev \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rdunlap@infradead.org \
--cc=rick.p.edgecombe@intel.com \
--cc=skhan@linuxfoundation.org \
--cc=vishal.l.verma@intel.com \
--cc=x86@kernel.org \
/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