From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796427831; b=Bw6M1IZAuzcTLbMXqiJXzmHCcCrSalycqhSExdtdelIsRrIUSoqX35uJYYSayufFjqPK Jwi3cjTFU6VBD/Lmd3HfCi8hD2RNju3A6OqMXYIkS0GAKwBRvOIfM+uaaL2BIqUw+nrSr nStV97O5D80zyeB/J+k2ykNU6Q29cdgolcosrUqv3dbmWVDuEfkVniKEGNADlN9dslGL7 YIba8xzRIHkzYqiTzIUoFItQeNlqbIQGvJFiZNNbZA7tdYo2O4nBWJqvpTxrTFFIndPOC BB+jBgZ17emMxGcU1V1WIhSiYTVcXcYuAdn0sTvSj4VDjxFabEaEhC+nL2GYRsL0zXg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796427831; h=Received:DKIM-Signature:Received:Received:X-ME-Sender:X-ME-Received: X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; bh=yPzgusQjVzta0dRqhbbcS1XjdXnerpIlSQSct1M4Bbk=; b=R16GlsNZEri3s2q0vPjXikcD5lo30QaeWjZp755+s/hA2hb7KNVKXLBe6Qafcs9e7mXj pCAvvz3IkYTibwgbEyas5++IMMbqJXdrB0qJYiWuSD6fKcvRUX2+RS9jY8cAx5KkxpWIU faaaVBx9XsInXQ9M6gvelXCgDeTbZVqn5o9sUTbITvhS/66/7mGxXOtJDlgMJH2PzDEWi NIP+Dock8LkHe0yV8OdTO8a90wUUGjwejFbpdy5T13VE05azF0gN6+gz0UBel0TqfX4HN UC49biFc6L+RJBA/sOpOf9twgowx9AjWw+7lPdkM3QM9qE8m11VL4cA8X5NNNJK7EGg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=clJZ9fSp; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C9B8606A322; Fri, 4 Dec 2026 23:43:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=clJZ9fSp Received: by smtp.kernel.org (Postfix) with ESMTPSA id 333AC1F00A07; Fri, 4 Dec 2026 23:43:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796427830; bh=yPzgusQjVzta0dRqhbbcS1XjdXnerpIlSQSct1M4Bbk=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=clJZ9fSpLw4G+4+CySai7m6dUOVVG/7ERf/3jc7YIFzOhV9lODdvcrPjoj+PRHb+D o1hJoSRwGadoreumY0YirXpp+S2AsW3HCrh6QDibSWPXRYEt5gnIVQ/qcClZABLdGm rT0tlRjIrsQL5K0tdolG98A0iBAZRoETcF0w3OjebGhl2cd1GsOUr5xfbB57QkTqlq BazKTRYoPwdiB0z7q1SvdFDy4b1l0/myD8h4lp61MY1TVi4ZZKSakGONX93xlgXrPG xClFOww/ZTmLIdIpMrjzklPnckpPKLpDjJXROx1eGsfUD/TxwoQw8OvjCtbc7OZek9 XshdsbNkyIXxw== Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfauth.ams.internal (Postfix) with ESMTP id 75DF2198003A; Fri, 4 Dec 2026 18:43:45 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Fri, 04 Dec 2026 18:43:47 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFR+DrRz9SNbG47QEaCbskSLlLvwpFfzEjp5dnirigkeEQ04QFynNmk+gym2s797Z 36ubvwNvuf9Q3oVRW2PvPt4mkNQmHBW0CnJSMg3CCSRzQA4Si0IeeOFKyOFzykGC2hnN7k USgajxd4P/zlqJAsm1490pa5jc39hJJzfhjCgaZFMwtT4dlENrK6WRbgeSPvBlaOrhGYsI RIAp7mxR67Y1haQdE+goDdm5iv1SWsb8K0Apl80uqKrfoIhBD9b6tQNedX0lO9XrFuIdLr vAwoXvrbjXYwxIFVH86O1nG+D0bQChYOLj/LoYvPGsSJs3XYeYXUZfQ17jEcrUENWRbCkK Oo5LDvF8q5Rw/SwBi9M/FYzAiR4XzXFQY8SMwgE0d8u6ArOgrOfSkuDcCXVs31Jx1/mZ21 7h5r6p5wS74XADEQhNNjMeZNU+Y3LSdW3r6vPj4pNlQ2pZLNJ4J+lDwkh+0MVcc9RHb8C0 UEDjOixwIqAm/wwhNntiqoc6Irpps06IlIBxZXebZ3dZ4GIU+wQ/53T3MI/0huXBroDnqq l5PAmFIiLUJ2O2rn6NaAZ63TkI8m+JeQnWMS6jlSDRDE/yNKNm9LPzdlyPAHrpEsaJaTGB JnYTZezwdxlo4iI5z+y6tRM4pnuuVURuGntWdYpITrrdMpG6A4s0CPjef54A X-ME-Proxy: Feedback-ID: i10464835:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 4 Dec 2026 18:43:44 -0500 (EST) Date: Fri, 4 Dec 2026 15:43:42 -0800 From: "Kiryl Shutsemau (Meta)" To: Moe Mahhouk Cc: Rick Edgecombe , Dave Hansen , Erdem Aktas , Tom Lendacky , Dan Williams , Kuppuswamy Sathyanarayanan , Xiaoyao Li , Jun Miao , x86@kernel.org, linux-coco@lists.linux.dev, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 2/2] virt: tdx-guest: Poll Quote status every 10 ms Message-ID: References: <20261125-tdx-guest-quote-poll-v4-0-d89f26854b88@flashbots.net> <20261125-tdx-guest-quote-poll-v4-2-d89f26854b88@flashbots.net> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261125-tdx-guest-quote-poll-v4-2-d89f26854b88@flashbots.net> 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 > Signed-off-by: Moe Mahhouk Reviewed-by: Kiryl Shutsemau (Meta) -- Kiryl Shutsemau / Kirill A. Shutemov