Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Binbin Wu <binbin.wu@linux.intel.com>
To: Sean Christopherson <seanjc@google.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	pbonzini@redhat.com, rick.p.edgecombe@intel.com,
	xiaoyao.li@intel.com, chao.gao@intel.com, kai.huang@intel.com
Subject: Re: [RFC PATCH v2 1/4] KVM: x86: TDX: Track supported configurable CPUID bits
Date: Tue, 30 Jun 2026 10:10:30 +0800	[thread overview]
Message-ID: <632907b4-fc19-49d3-b2e7-8bb97d64df2c@linux.intel.com> (raw)
In-Reply-To: <akMPwaQ9nFDnGbYg@google.com>

On 6/30/2026 8:37 AM, Sean Christopherson wrote:
> On Mon, Jun 29, 2026, Binbin Wu wrote:
>> On 6/26/2026 1:04 AM, Sean Christopherson wrote:
>>> On Thu, Jun 04, 2026, Binbin Wu wrote:
>>> CPUID.0x1E is a bit different because it's kinda sorta a feature?  That one is
>>> probably worth restricting, but again that's easy to do in a case-statement.
>>
>> Only CPUID.0x1E.EAX has TDX directly configurable bits currently, no special
>> handling needed for the rest of CPUID.0x1E.
> 
> But isn't the whole point to guard against TDX Modules gaining support for features
> KVM doesn't know about?  What happens if hardware extends into CPUID.0x1E.ECX,
> and the TDX Module follows suit?

I meant for CPUID.0x1E, KVM only allows the known TDX configurable CPUID bits, i.e. 
AMX_FP8, AMX_TF32, AMX_AVX512, and AMX_MOVRS in CPUID.0x1E.EAX, which will be
initialized in kvm_tdx_cpu_caps[]. 
For others, it's not allowed via KVM_TDX_INIT_VM. If there is a unknown feature
bit, it will be rejected.
 > 
> I guess that applies to all the feature leaves?

I think the rules could be:
1) if a leaf/sub-leaf/register we are sure that it will never be extended for feature
   bits, as you mentioned, e.g. CPUID.0x1.E{A,B}X, CPUID 0x4, 0x18, and 0x1F, we handle
   them in case-statement runtime.

2) If a leaf/sub-leaf/register that could be extended for feature bits or already
   is used for feature bits, the kvm_tdx_cpu_caps[] holds the supported direct
   configurable bits. The userspace CPUID configuration input in KVM_TDX_INIT_VM is
   validated against kvm_tdx_cpu_caps[]. Any unknown feature bit is not allowed.

  reply	other threads:[~2026-06-30  2:10 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-04  2:33 [RFC PATCH v2 0/4] KVM: x86: TDX: Validate directly configurable CPUID bits Binbin Wu
2026-06-04  2:33 ` [RFC PATCH v2 1/4] KVM: x86: TDX: Track supported " Binbin Wu
2026-06-04  2:44   ` sashiko-bot
2026-06-04  5:37     ` Binbin Wu
2026-06-25 17:04   ` Sean Christopherson
2026-06-29  3:02     ` Binbin Wu
2026-06-30  0:37       ` Sean Christopherson
2026-06-30  2:10         ` Binbin Wu [this message]
2026-06-04  2:33 ` [RFC PATCH v2 2/4] KVM: x86: TDX: Hide unsupported " Binbin Wu
2026-06-04  2:47   ` sashiko-bot
2026-06-04  2:54     ` Binbin Wu
2026-06-04  2:33 ` [RFC PATCH v2 3/4] KVM: x86: TDX: Validate userspace CPUID input for KVM_TDX_INIT_VM Binbin Wu
2026-06-04  2:49   ` sashiko-bot
2026-06-04  3:13     ` Binbin Wu
2026-06-04  2:33 ` [RFC PATCH v2 4/4] KVM: x86: TDX: Report CORE_CAPABILITIES as supported Binbin Wu
2026-06-04  2:51   ` sashiko-bot
2026-06-04  5:32     ` Binbin Wu
2026-06-04  5:40       ` Binbin Wu
2026-06-04  6:53   ` Xiaoyao Li
2026-06-04  7:20     ` Binbin Wu
2026-06-22  6:32 ` [RFC PATCH v2 0/4] KVM: x86: TDX: Validate directly configurable CPUID bits Binbin Wu
2026-06-25 17:04   ` Sean Christopherson
2026-06-29  3:02     ` Binbin Wu

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=632907b4-fc19-49d3-b2e7-8bb97d64df2c@linux.intel.com \
    --to=binbin.wu@linux.intel.com \
    --cc=chao.gao@intel.com \
    --cc=kai.huang@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rick.p.edgecombe@intel.com \
    --cc=seanjc@google.com \
    --cc=xiaoyao.li@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