Re: [RFC PATCH v2 02/23] x86/virt/tdx: Add SEAMCALL wrapper tdh_mem_page_demote()
From: Huang, Kai
Date: Tue Nov 11 2025 - 04:20:09 EST
On Mon, 2025-09-01 at 17:08 +0800, Yan Zhao wrote:
> > > Do not handle TDX_INTERRUPTED_RESTARTABLE because SEAMCALL
> > > TDH_MEM_PAGE_DEMOTE does not check interrupts (including NMIs) for basic
> > > TDX (with or without Dynamic PAMT).
> >
> > The cover letter mentions that there is a new TDX module in planning, which
> > disables the interrupt checking. I guess TDX module would need to have a
> > interface to report the change, KVM then decides to enable huge page support or
> > not for TDs?
> Yes. But I guess detecting TDX module version or if it supports certain feature
> is a generic problem. e.g., certain versions of TDX module have bugs in
> zero-step mitigation and may block vCPU entering.
>
> So, maybe it deserves a separate series?
Looking at the spec (TDX module ABI spec 348551-007US), is it enumerated via
TDX_FEATURES0.ENHANCED_DEMOTE_INTERRUPTIBILITY?
5.4.25.3.9.
Interruptibility
If the TD is not partitioned (i.e., it has been configured with no L2
VMs), and the TDX Module enumerates
TDX_FEATURES0.ENHANCED_DEMOTE_INTERRUPTIBILITY as 1, TDH.MEM.PAGE.DEMOTE
is not interruptible.
So if the decision is to not use 2M page when TDH_MEM_PAGE_DEMOTE can return
TDX_INTERRUPTED_RESTARTABLE, maybe we can just check this enumeration in
fault handler and always make mapping level as 4K?