Skip to content

feat(attest): TSM provider detection and path overrides#782

Merged
kvinwang merged 1 commit into
masterfrom
feat/tsm-provider-env-support
Jul 16, 2026
Merged

feat(attest): TSM provider detection and path overrides#782
kvinwang merged 1 commit into
masterfrom
feat/tsm-provider-env-support

Conversation

@kvinwang

@kvinwang kvinwang commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

Foundational guest attestation path improvements, independent of any simulator:

  • detect TDX via /dev/tdx_guest or a tdx_guest* configfs TSM provider (tdx_attest::is_tdx_available)
  • use that detection from dstack-attest mode selection
  • honor environment overrides:
    • DCAP_TDX_QUOTE_CONFIGFS_PATH (authoritative; no silent fallback)
    • DCAP_TDX_RTMR_SYSFS_PATH
    • DSTACK_CCEL_FILE
  • expose cc_eventlog::tdx::decode_ccel for decoding a raw CCEL buffer
  • teach dstack-prepare to recognize tdx_guest* / sev_guest* TSM providers the same way

These changes keep production device defaults unchanged and make the production guest path work correctly when TDX is only visible through TSM configfs (including a development-only FUSE provider).

Test plan

  • cargo test -p tdx-attest -p cc-eventlog -p dstack-attest
  • bash -n os/common/rootfs/dstack-prepare.sh (syntax only; prepare logic is small)

Detect TDX through configfs TSM providers as well as /dev/tdx_guest, and
allow CCEL/RTMR/configfs paths to be overridden via environment variables.
Also recognize tdx_guest* providers in dstack-prepare.
Copilot AI review requested due to automatic review settings July 16, 2026 02:26
@kvinwang
kvinwang enabled auto-merge July 16, 2026 02:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves guest attestation “platform detection” and configurability by recognizing TSM configfs providers (in addition to legacy devices) and by adding environment-variable overrides for key TDX/CCEL paths. It also exposes a helper to decode raw CCEL buffers and updates dstack-prepare to detect TDX/SEV via TSM providers.

Changes:

  • Add TSM provider detection for TDX/SEV in dstack-prepare and use tdx_attest::is_tdx_available() for mode selection in dstack-attest.
  • Add/extend environment overrides for quote/configfs, RTMR sysfs base, and CCEL file path; add decode_ccel() API and tests.
  • Add unit tests and supporting dev dependency (tempfile) for configfs provider verification.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
os/common/rootfs/dstack-prepare.sh Detects TDX/SEV via /dev/* or configfs TSM providers.
dstack/tdx-attest/src/linux.rs Adds is_tdx_available(), configfs “authoritative override” behavior, and RTMR sysfs path override logic + tests.
dstack/tdx-attest/src/dummy.rs Adds stub is_tdx_available() for non-linux/non-x86_64 targets.
dstack/tdx-attest/Cargo.toml Adds tempfile for tests.
dstack/dstack-attest/src/attestation.rs Uses tdx_attest::is_tdx_available() for mode detection.
dstack/cc-eventlog/src/tdx.rs Exposes decode_ccel() and adds a test against bundled CCEL sample.
dstack/cc-eventlog/src/tcg.rs Adds DSTACK_CCEL_FILE override support when reading CCEL.
dstack/Cargo.lock Locks new dev dependency resolution.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread dstack/tdx-attest/src/linux.rs
Comment thread dstack/tdx-attest/src/linux.rs
Comment thread dstack/cc-eventlog/src/tcg.rs
Comment thread dstack/tdx-attest/src/linux.rs
@kvinwang
kvinwang merged commit 2e2e1f9 into master Jul 16, 2026
16 checks passed
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