Skip to content

cpuid: sanitize incomplete XTILE state - #6

Open
yiboyasss wants to merge 1 commit into
boxlite-ai:mainfrom
yiboyasss:fix/intel-incomplete-xtile
Open

yiboyasss wants to merge 1 commit into
boxlite-ai:mainfrom
yiboyasss:fix/intel-incomplete-xtile

Conversation

@yiboyasss

Copy link
Copy Markdown

Summary

  • process CPUID leaf 0xD for regular Intel KVM builds, not only TDX builds
  • clear both XTILE xstate bits when KVM exposes only part of the required pair
  • preserve complete XTILE exposure and the existing TDX-specific CET handling
  • add regression coverage for the observed partial mask and a valid complete mask

Why

KVM can report XTILECFG without XTILEDATA when the VMM process has not requested the dynamically enabled guest xstate component. Passing that partial pair to the guest causes Linux to attempt XSETBV with an invalid XCR0 value. KVM then injects #GP during fpu__init_cpu_xstate, before userspace or the guest agent can start.

The transformer already normalized the pair for TDX. Applying the same normalization to the regular Intel path changes the observed 0x202e7 mask to 0x2e7, while preserving a complete 0x602e7 mask.

Related reproduction and trace: boxlite-ai/boxlite#2239.

Validation

  • rustfmt --check --edition 2021 src/cpuid/src/transformer/intel.rs
  • added unit tests for partial and complete XTILE masks
  • full Linux unit test suite is left to CI because the local development host is ARM macOS

@coderabbitai

coderabbitai Bot commented Oct 31, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: QUIET
  • Plan: Advanced
  • Run ID: ca4d715e-b67f-46c7-afdb-4ca25f141e32
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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.

1 participant