Skip to content

fix(tdx): work around missing SIGNIFICANT_INDEX flag in KVM_TDX_CAPABILITIES#410

Merged
Lencerf merged 1 commit intogoogle:mainfrom
Lencerf:fix/tdx/cpuid-cap
Mar 1, 2026
Merged

fix(tdx): work around missing SIGNIFICANT_INDEX flag in KVM_TDX_CAPABILITIES#410
Lencerf merged 1 commit intogoogle:mainfrom
Lencerf:fix/tdx/cpuid-cap

Conversation

@Lencerf
Copy link
Collaborator

@Lencerf Lencerf commented Mar 1, 2026

The KvmCpuidEntry2 structures returned by KVM_TDX_CAPABILITIES currently omit the SIGNIFICANT_INDEX flag. This causes the CPUID index to be parsed as None instead of the actual index value, which breaks CPUID capability matching.

Until this is fixed in the upstream kernel (see
https://lore.kernel.org/all/20260223214336.722463-1-changyuanl@google.com/), work around the issue by explicitly retaining the index value from KvmCpuidEntry2 when parsing the capabilities.

Fixes: ca9a64b ("feat(tdx): initialize TDX VMs with supported CPUID features")

@Lencerf Lencerf changed the title fix(tdx): work around missing SIGNIFICANT_INDEX flag in KVM_TDX_CAPAB… fix(tdx): work around missing SIGNIFICANT_INDEX flag in KVM_TDX_CAPABILITIES Mar 1, 2026
@coveralls
Copy link

coveralls commented Mar 1, 2026

Pull Request Test Coverage Report for Build 22539829029

Details

  • 0 of 3 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.004%) to 26.762%

Changes Missing Coverage Covered Lines Changed/Added Lines %
alioth/src/hv/kvm/vm/vm_x86_64/tdx.rs 0 3 0.0%
Totals Coverage Status
Change from base Build 22538448810: 0.004%
Covered Lines: 3801
Relevant Lines: 14693

💛 - Coveralls

…ILITIES

The KvmCpuidEntry2 structures returned by KVM_TDX_CAPABILITIES currently
omit the SIGNIFICANT_INDEX flag. This causes the CPUID index to be
parsed as None instead of the actual index value, which breaks CPUID
capability matching.

Until this is fixed in the upstream kernel (see
https://lore.kernel.org/all/20260223214336.722463-1-changyuanl@google.com/),
work around the issue by explicitly retaining the index value from
KvmCpuidEntry2 when parsing the capabilities.

Fixes: ca9a64b ("feat(tdx): initialize TDX VMs with supported CPUID features")
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
@Lencerf Lencerf force-pushed the fix/tdx/cpuid-cap branch from bbd2b98 to f5bf11a Compare March 1, 2026 08:49
@Lencerf Lencerf merged commit f5bf11a into google:main Mar 1, 2026
5 checks passed
@Lencerf Lencerf deleted the fix/tdx/cpuid-cap branch March 1, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants