Repository navigation
Conversation
Commit 433dd79 removed the PREPARE/FINALIZE rebind model from the firmware per GHCI 1.5, but the AzCVMEmu emulator, CLI, runner script, and CI matrix still carried it. The emulator wrote the operation byte at payload offset 10, which the firmware now treats as reserved and rejects when non-zero, so `--operation rebind-finalize` always failed with InvalidParameter and `rebind-prepare` only worked by accident. Remove the operation field from the emulated StartRebinding request and zero bytes 10..16 as reserved. Replace the two CLI operations with a single `rebind` operation in the emulator binary and migtdemu.sh, update the help text to describe the single-phase handshake, and point the integration-emu workflow at the new operation name. Assisted-by: GitHub Copilot:Claude Opus 4.6 Signed-off-by: Stanislaw Grams <stanislaw.grams@intel.com>
sgrams
force-pushed
the
fix/cvmemu-single-phase-rebind
branch
from
October 27, 2026 08:43
27bc97d to
8e70539
Compare
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
Commit 433dd79 removed the PREPARE/FINALIZE rebind model from the firmware per GHCI 1.5, but the AzCVMEmu emulator, CLI, runner script, and CI matrix still carried it. This PR brings the emulation tooling in line with the single-phase model.
Problem
The emulator wrote the rebind
operationbyte at payload offset 10. The firmware now treats bytes 10..16 as reserved andMigtdMigrationInformation::read_from_bytesrejects any non-zero value withInvalidParameter, so:--operation rebind-finalize(op = 1) always failed before any rebind logic ran.--operation rebind-prepare(op = 0) only worked because a zero op byte is indistinguishable from zeroed reserved bytes.migtdemu.shalso still claimed thatrebind-finalize"clears the session token", describing behaviour that no longer exists.Changes
deps/td-shim-AzCVMEmu/tdx-tdcall/src/tdx_emu.rs: dropoperationfromEmuMigRequest::StartRebindingandset_emulated_start_rebinding; zero bytes 10..16 as reserved and update the layout comment.src/migtd/src/bin/migtd/cvmemu.rs: replacerebind-prepare/rebind-finalizewith a singlerebindoperation (--operation rebind/-o rb); one dispatch arm; updated usage text.migtdemu.sh: accept onlymigrationorrebind; help text describes the single-phase handshake (TLS/SPDM session, token exchange, approval)..github/workflows/integration-emu.yml: rename the three rebind matrix entries and switch them to--operation rebind.No backward-compatibility aliases are kept for the old operation names.
Verification
cargo check --bin migtd --no-default-features --features AzCVMEmu,policy_v2,test_mock_reportspdm_attestation(SPDM_CONFIG=config/spdm_config.json)rustfmt --checkon touched files;bash -n migtdemu.sh; shellcheck shows no new warnings; workflow YAML parsesintegration-emuCI covers the renamedRebind (Skip RA),Rebind (Mock Report), andSPDM Rebind (Skip RA)jobs end to end