Repository navigation
Conversation
The kernel's configfs TSM path waits for the quote with msleep_interruptible(MSEC_PER_SEC) in wait_for_quote_completion(), and the request is always still in flight on the first check. Every quote therefore takes at least a second, although QGS answers in a few milliseconds. The guest agent serializes quotes, so one-second quotes are what let its queue back up. Prefer vsock when /etc/tdx-attest.conf sets a port. Images ship the port whether or not the host serves it, so a vsock failure falls back to configfs when configfs exists. An explicit DCAP_TDX_QUOTE_CONFIGFS_PATH still selects configfs alone. Both paths reach the same host QGS and return the same QE-signed quote: vsock sends the guest's own TDREPORT, while configfs has the kernel and QEMU forward it. Signed-off-by: Kevin Wang <wy721@qq.com>
This branch has not been deployed
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.
Problem
tdx-attestprefers configfs whenever it exists. The kernel's configfs path polls for the quote once a second (wait_for_quote_completion()indrivers/virt/coco/tdx-guest/tdx-guest.csleepsMSEC_PER_SECper check), so every quote takes at least 1 s even though QGS answers in a few milliseconds. The guest agent serializes quotes, so this is the root cause of the queue backlog addressed in #1659.Change
/etc/tdx-attest.confsets a port.port=4050whether or not the host serves it, so a vsock failure falls back to configfs.DCAP_TDX_QUOTE_CONFIGFS_PATHstill forces configfs.Measurements
Setup: tdxlab, dstack-0.6.5 image (kernel 6.18.59-dstack), 2 vCPU / 2 GB TDX CVM, host
qgsdon vsock port 4050 withnumber_threads = 4and PCCSpccs.phala.network. Sequentialtdx_attest::get_quote()calls from a small binary inside the CVM, 64-byte report data:next, configfs firstport=4051) → configfsDCAP_TDX_QUOTE_CONFIGFS_PATHset → configfsAll quotes are 5243 bytes. A vsock quote passes
dcap-qvl verifywith statusUpToDate, and its MRTD and RTMRs match configfs quotes.End to end on the same CVM, a stock 0.6.5 guest agent with configfs hidden from its unit (so it takes the existing vsock path) produced:
/v1/Attest, n=20, avg/v1/Attest, max