feat(vmcall_raw): handle VMM cancellation (0x302)#860
Merged
Conversation
jyao1
reviewed
May 28, 2026
90a2aa8 to
9134a47
Compare
Detect VMM-initiated session cancellation (data_status byte[0]=0x02, byte[1]=0x03) in both send and receive poll loops. Return a new VmcallRawError::VmmCanceled variant, which maps to io::ErrorKind::ConnectionAborted so callers can distinguish cancellation from other transport errors. Define named constants TDX_VMCALL_STATUS_NOT_COMPLETED and TDX_VMCALL_STATUS_VMM_CANCEL for the magic status bytes. Upper layers (spdm, migration) translate ConnectionAborted into MigrationResult::VmmCanceled and report it to the VMM host. Signed-off-by: Haitao Huang <haitaohuang@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
9134a47 to
f057273
Compare
jyao1
approved these changes
May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The VMM signals migration session cancellation by writing data_status byte[0]=0x02, byte[1]=0x03 (0x302) to the shared buffer.
Previously, 0x302 was treated as a generic TdVmcallErr, reported as SecureSessionError (6), change to propagate and report it as VmmCanceled (10) in ReportStatus.
In the SPDM path, MigtdTransport's send/receive implement the SpdmDeviceIo trait which cannot represent this error in its return types (SpdmResult and Result<usize, usize>). Log a warning when ConnectionAborted is detected so the VMM cancellation is visible in logs, even though the typed error cannot propagate through the SPDM library's trait boundary.