add retry for quote generation#846
Open
haitaohuang wants to merge 4 commits into
Open
Conversation
Add new quote module (src/migtd/src/quote.rs) that centralizes TD quote generation with exponential backoff retry (5s initial, up to 5 retries). This handles the race where an impactless security update invalidates a TD REPORT generated before the update then sent for quote generation. Replace direct attestation::get_quote + tdcall_report calls with quote::get_quote_with_retry in three call sites: - mig_policy.rs: local TCB info initialization - ratls/server_client.rs: RA-TLS quote generation - spdm/mod.rs: SPDM quote generation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Haitao Huang <haitaohuang@microsoft.com>
Also flush log area in more VMCALL handlers so all logs read in time Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Haitao Huang <haitaohuang@microsoft.com>
Adds a new 'Mock Quote Retry' test that exercises the quote retry logic by enabling mock_quote_retry feature. The test verifies: - Migration completes successfully after 5 simulated quote failures - Both source and destination logs contain exactly 5 retry failures and at least 1 success message Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Haitao Huang <haitaohuang@microsoft.com>
Classify tdvmcall_get_quote and buffer status errors into 2 categories: - Busy: VMCALL_RETRY, GET_QUOTE_IN_FLIGHT, GET_QUOTE_ERROR, GET_QUOTE_SERVICE_UNAVAILABLE Retried with exponential backoff (1s initial), up to 5 attempts. - Non-retriable: VMCALL_OPERAND_INVALID and other errors cause immediate failure. Propagate error categories through attest.rs and igvmattest.rs. Update mock quote emulation to return Ok with error status in buffer (matching real VMM behavior) instead of returning Err, and trigger the notification interrupt so ghci.rs wakes from wait_for_vmm_notification. Add igvm-attest feature to mock-quote-retry CI test since retry differentiation only applies to the igvm-attest path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Haitao Huang <haitaohuang@microsoft.com>
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.
refresh of #754
improved error handling and rebase