Skip to content

TPM: Add support for the new TPM v1.85#4022

Draft
smalis-msft wants to merge 3 commits into
microsoft:mainfrom
smalis-msft:TPM-185
Draft

TPM: Add support for the new TPM v1.85#4022
smalis-msft wants to merge 3 commits into
microsoft:mainfrom
smalis-msft:TPM-185

Conversation

@smalis-msft

Copy link
Copy Markdown
Contributor

Add a new Version enum to the Tpm::new constructor and support constructing the device over both library versions. This will not build in CI yet, as the new TPM crate is not yet available publicly, but it can be built locally on a machine with the necessary Microsoft credentials.

TODOs:
Fix linking
Discuss petri testing strategy
Prebuild TPMs for musl/openhcl
Clean up deps versioning
Wire up OpenHCL version decision
Symcrypt
add test_fix_corrupted_vmgs for V185
Support larger NV index size for V185 in tpm_lib

Copilot AI review requested due to automatic review settings July 24, 2026 16:07

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Note

This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.

@github-actions github-actions Bot added the Guide label Jul 24, 2026
@smalis-msft smalis-msft added the backport_1.8.2607 Change should be backported to the release/1.8.2607 branch label Jul 24, 2026
Copilot AI review requested due to automatic review settings July 24, 2026 16:14

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

Copilot reviewed 16 out of 17 changed files in this pull request and generated 3 comments.

Comment thread vm/devices/tpm_resources/src/lib.rs
Comment thread vm/devices/tpm/tpm_device/src/lib.rs
Comment thread Cargo.toml
Copilot AI review requested due to automatic review settings July 24, 2026 16:47

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

Copilot reviewed 16 out of 17 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

vm/devices/tpm_resources/src/lib.rs:27

  • TpmDeviceHandle derives MeshPayload without explicit #[mesh(n)] field numbers, so field numbers default to struct order (i+1). Adding version at the beginning renumbers every existing field, which is wire-incompatible for any persisted/serialized TpmDeviceHandle (or cross-binary communication) and can cause older data to decode into the wrong fields.

Consider either (a) appending a new version: Option<TpmVersion> field at the end and defaulting None to V138 for back-compat, or (b) adding explicit #[mesh(n)] numbers to freeze the existing field mapping before introducing version.

/// A handle to a TPM device.
#[derive(MeshPayload)]
pub struct TpmDeviceHandle {
    /// TPM reference implementation version
    pub version: TpmVersion,
    /// Non-volatile store for PPI (physical presence interface) data
    pub ppi_store: Resource<NonVolatileStoreKind>,
    /// Non-volatile store for TPM NVRAM data
    pub nvram_store: Resource<NonVolatileStoreKind>,
    /// Whether to refresh TPM seeds on init

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport_1.8.2607 Change should be backported to the release/1.8.2607 branch Guide

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants