Re: [PATCH v4 2/2] virt: tdx-guest: Poll Quote status every 10 ms
From: Kiryl Shutsemau (Meta)
Date: Fri Dec 04 2026 - 18:43:59 EST
On Wed, Nov 25, 2026 at 02:11:51PM +0000, Moe Mahhouk wrote:
> wait_for_quote_completion() checks the status of a GetQuote request
> once and then sleeps for a full second before each further check. The
> VMM has rarely completed the request at the first check, so every Quote
> request takes at least one second, however quickly the host answers.
>
> With a local Quote Generation Service the VMM completes the request in
> a few milliseconds. On an Emerald Rapids host (KVM, QEMU 11.1, Intel
> QGS), back-to-back Quote requests through configfs-tsm took 1021-1024 ms
> each; with this change they take 14-21 ms (median 16 ms) at HZ=250.
> Since quote_lock serializes requests, the one-second floor also caps a
> TD at about one Quote per second, which hurts users that bind a fresh
> Quote to every connection, such as attested TLS.
>
> Recheck the status every 10 ms instead. msleep_interruptible() rounds
> up to whole jiffies and adds one, so at HZ=250 a step takes 16 ms. The
> sleep stays interruptible, and the timeout becomes a deadline in
> jiffies.
>
> Suggested-by: Rick Edgecombe <rick.p.edgecombe@xxxxxxxxx>
> Signed-off-by: Moe Mahhouk <moe@xxxxxxxxxxxxx>
Reviewed-by: Kiryl Shutsemau (Meta) <kas@xxxxxxxxxx>
--
Kiryl Shutsemau / Kirill A. Shutemov