Skip to content

add retry for quote generation#846

Open
haitaohuang wants to merge 4 commits into
intel:mainfrom
haitaohuang:upstream/pr2-quote-retry
Open

add retry for quote generation#846
haitaohuang wants to merge 4 commits into
intel:mainfrom
haitaohuang:upstream/pr2-quote-retry

Conversation

@haitaohuang
Copy link
Copy Markdown
Contributor

refresh of #754
improved error handling and rebase

haitaohuang and others added 4 commits May 22, 2026 00:59
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>
@haitaohuang haitaohuang requested review from jyao1 and sgrams as code owners May 22, 2026 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant