From: sashiko-bot@kernel.org
To: "Binbin Wu" <binbin.wu@linux.intel.com>
Cc: kvm@vger.kernel.org
Subject: Re: [RFC PATCH v2 4/4] KVM: x86: TDX: Report CORE_CAPABILITIES as supported
Date: Thu, 04 Jun 2026 02:51:41 +0000 [thread overview]
Message-ID: <20260604025142.200341F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260604023314.3907511-5-binbin.wu@linux.intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Missing handling of MSR_IA32_CORE_CAPS in tdx_set_msr() causes KVM_SET_MSRS to fail, breaking VM initialization and live migration.
--
commit 217a78047d73d2be68ef27e206470a6c237db79a
Author: Binbin Wu <binbin.wu@linux.intel.com>
KVM: x86: TDX: Report CORE_CAPABILITIES as supported
This commit adds CORE_CAPABILITIES to the TDX configurable CPUID allowlist
to accommodate legacy TDX module behavior. It also modifies tdx_get_msr()
to return 0 for MSR_IA32_CORE_CAPS.
> diff --git a/arch/x86/kvm/vmx/tdx.c b/arch/x86/kvm/vmx/tdx.c
> index 26a5ad59a5694..b7661ba98a8d4 100644
> --- a/arch/x86/kvm/vmx/tdx.c
> +++ b/arch/x86/kvm/vmx/tdx.c
[ ... ]
> @@ -2319,6 +2319,14 @@ int tdx_get_msr(struct kvm_vcpu *vcpu, struct msr_data *msr)
> return 1;
> msr->data = vcpu->arch.mcg_ext_ctl;
> return 0;
> + case MSR_IA32_CORE_CAPS:
> + /*
> + * KVM doesn't support MSR_IA32_CORE_CAPS, however, in some old
> + * TDX modules, CPUID.0x7.0.EDX[30] is fixed-1. As a workaround,
> + * just return 0 for this MSR.
> + */
> + msr->data = 0;
> + return 0;
[Severity: High]
Since MSR_IA32_CORE_CAPS is now exposed to userspace via tdx_get_msr(), does
tdx_set_msr() need a corresponding update to accept host-initiated writes?
During VM migration or state restore, userspace typically reads MSRs on the
source and writes them to the destination. If tdx_set_msr() doesn't handle
MSR_IA32_CORE_CAPS, the KVM_SET_MSRS ioctl will fall through to the default
case.
Because tdx_has_emulated_msr() does not include MSR_IA32_CORE_CAPS, won't
tdx_set_msr() return an error and immediately abort the migration?
> default:
> if (!tdx_has_emulated_msr(msr->index))
> return 1;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260604023314.3907511-1-binbin.wu@linux.intel.com?part=4
next prev parent reply other threads:[~2026-06-04 2:51 UTC|newest]
Thread overview: 16+ 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-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 [this message]
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
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=20260604025142.200341F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=binbin.wu@linux.intel.com \
--cc=kvm@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.