TPM: Add support for the new TPM v1.85#4022
Conversation
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
TpmDeviceHandlederivesMeshPayloadwithout explicit#[mesh(n)]field numbers, so field numbers default to struct order (i+1). Addingversionat the beginning renumbers every existing field, which is wire-incompatible for any persisted/serializedTpmDeviceHandle(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
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