rebinding: populate UTF-8 reason string on SPDM error paths#884
Merged
Conversation
The non-SPDM rebinding_old_prepare / rebinding_new_prepare populate the
VMM ReportStatus reason buffer (data: &mut Vec<u8>) on transport
failures, gated by #[cfg(feature = "vmcall-raw")]. The SPDM-featured
counterparts had the parameter spelled _data and never wrote to it, so
GHCI 1.5 ReportStatus (p. 47-48, Tables 3-55/3-56) had no diagnostic
payload when an SPDM rebind failed.
Mirror the non-SPDM pattern at the three SPDM error sites:
* spdm_requester / spdm_responder transport setup failure
* with_timeout timeout error around spdm_requester_rebind_old /
spdm_responder_rebind_new
* the SPDM rebind operation itself
Each .map_err closure now pushes a one-line UTF-8 reason string
(operation name, MigrationResult variant, migration ID in hex) into
data, gated by #[cfg(feature = "vmcall-raw")] to match the non-SPDM
RA-TLS arms. log::error! calls are preserved verbatim.
No behavior change with vmcall-raw off: data is unused (same warning as
the existing non-SPDM functions on that configuration).
Signed-off-by: Stanislaw Grams <stanislaw.grams@intel.com>
0aade43 to
8eb71fe
Compare
Contributor
|
LGTM |
MichalTarnacki
approved these changes
Jun 10, 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.
Summary
The non-SPDM
rebinding_old_prepare/rebinding_new_preparepopulate the VMM ReportStatus reason buffer (data: &mut Vec<u8>) on transport failures, gated by#[cfg(feature = "vmcall-raw")]. The SPDM-featured counterparts had the parameter spelled_dataand never wrote to it, so GHCI 1.5ReportStatus(p. 47–48, Tables 3-55/3-56) carried no diagnostic payload when an SPDM rebind failed.Change
Mirror the non-SPDM pattern at the three SPDM error sites in both
rebinding_old_prepareandrebinding_new_prepare:spdm_requester/spdm_respondertransport setup failurewith_timeouttimeout aroundspdm_requester_rebind_old/spdm_responder_rebind_newEach
.map_errclosure now pushes a one-line UTF-8 reason string (operation name,MigrationResultvariant, migration ID in hex) intodata, gated by#[cfg(feature = "vmcall-raw")]to match the non-SPDM RA-TLS arms.log::error!calls are preserved verbatim.No behavior change with
vmcall-rawoff —datais unused, same warning the existing non-SPDM functions already emit on that configuration.Test
Both clean. The
vmcall-raw+spdm_attestationbuild has 3 pre-existing errors onmain(mig_socket_infofield,setup_transportarity) that are out of scope for this PR.Reference
GHCI 1.5 April 2026: Tables 3-55 / 3-56 —
ReportStatusdata buffer carries a UTF-8 reason string describing why a migration/rebind failed.