From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=192.198.163.10 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796408510; b=fBsbHtVCSM/0PyxVIFsMzSaBFAWW0gHuZFfJKtbagbiSlhVC+5fBjvSHvKVG5+pzm+3i gxTDb22hXZ6nrBVhCIRliT+iqaDCUSvoyWKrDn6tsKnW1pIRV7fDY8+t7cizzlBh1gFW2 LBxlvnrwBoJu8aHAdomYjd4q+7k5FBUVUpuDEsb8jLMfYSVXCSnLwnvSUl5GOEoS7I/Fb oAnn83vzbzPcqt+Nz26/9P2Ms4QsiNzcB7R/xUmJUdmKGYIyOerYSsjXIKrw0LBHrSGrd piFlvtQf+RJQTP/OSQzPYS4LgFYtOpnVdamhV55x0EvutY7cmKgf6vJ1hpKoZBleRIA== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796408510; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Received:Received: Received:Received:Received:From:To:CC:Subject:Date:Message-ID: X-Mailer:Content-Transfer-Encoding:Content-Type:X-ClientProxiedBy: MIME-Version:X-MS-PublicTrafficType:X-MS-TrafficTypeDiagnostic: X-MS-Office365-Filtering-Correlation-Id:X-MS-Exchange-SenderADCheck: X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam: X-Microsoft-Antispam-Message-Info:X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-Exchange-RoutingPolicyChecked: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-CrossTenant-Id:X-MS-Exchange-CrossTenant-MailboxType: X-MS-Exchange-CrossTenant-UserPrincipalName: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg; bh=JZXiLtr1oiCnB4Og+efWAqZ8jjLxRVASzeRk64Ro70Y=; b=EM6pAFfXoTuJSrKDhFrdZFsNOk5+Ef178pc6YSxzFgwxqPJinX3m+OmrFn9m/lS+lIRI 57M+NRjyPhCR+/MBfzBe0Uw6YXntAI6lU/g8sZhOLBdH07Mq78E5gqbe+C4J31GCaWzz9 Gt9nacozEZoH6O2cmMWQIIekcA69l7GgPI768qyI7g7hAcdGtAAjluFuYRKapRnt5y/s8 TwhRYmr7cU8VvbHiYsJGs5aXhWVa+cY7aLyet+SjLu4HUPHm07osaPREV9GYSEtX1BezW XhkTjN/IfunTSHqL30dBGj+6jUZC2kMGRh3jReH/X6DLbp5MC/js6XTNXofe84jBkOQ== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=DC7Azn6+; arc=pass header.oldest-pass=0 smtp.remote-ip=192.198.163.10 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E7569606A339 for ; Fri, 4 Dec 2026 18:21:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E7569606A339 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=DC7Azn6+ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796408510; x=1827944510; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=JZXiLtr1oiCnB4Og+efWAqZ8jjLxRVASzeRk64Ro70Y=; b=DC7Azn6+V22TaLPj0sbX5rqKmLxYBT1k7uvjayiRtxBwXNuAXxjINAc1 aTo8Ef74H2+A20cHFRtj8J1Nk8D07iLv2epJwMM9baYYTpsp4CI7QJ1qE fwrwWpUnXT3wDmOjh7TYFg12tyHL01StZWgtWlN/YucK3ZFcoRrAShDBU pDTaLURvcafGV4qsPFs1L5xhXjgbR4E/KYDlYmw6o7tTzfNN9ChcqTKlb aaCKve3e5NU5kj+xSWodv3tfVMEaSrqetPfIXwPN+9BG6ImqwlteIHocn XTcZkxG/cWuqlzI19EedNnvg4TJRg4t9cG3a9lt4oN40Q5yRw0pjNbRKk Q==; X-CSE-ConnectionGUID: t4jt40+URSWr7A/vdnuFGA== X-CSE-MsgGUID: ZblkFgBzTMWiGLtzm/SvUQ== X-IronPort-AV: E=McAfee;i="6800,10657,11986"; a="5284231" X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="5284231" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 10:21:50 -0800 X-CSE-ConnectionGUID: snO4Wae8RQS/EDJpH2R1wg== X-CSE-MsgGUID: S9liXKk0QB2Wn4ARO5fpyQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="14397000" Received: from orsmsx902.amr.corp.intel.com ([10.22.229.24]) by fmviesa002.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 10:21:49 -0800 Received: from ORSMSX903.amr.corp.intel.com (10.22.229.25) by ORSMSX902.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Fri, 4 Dec 2026 10:21:48 -0800 Received: from ORSEDG903.ED.cps.intel.com (10.7.248.13) by ORSMSX903.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57 via Frontend Transport; Fri, 4 Dec 2026 10:21:48 -0800 Received: from CO1PR03CU002.outbound.protection.outlook.com (52.101.46.23) by edgegateway.intel.com (134.134.137.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Fri, 4 Dec 2026 10:21:48 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jSD7+Decv5bgtRYZAng3mtH1cUWvqZvLJzfw41VS3C5hET2w4AHwFJVCJkRIw7QcB6ZlaAExbutbyUgIDro3qDm12qDZjpMXMpYB/Cd44KwaRfja60dXDoErFWBVJq/5b64V4I5ufRkTdGGVlr3xOLXyZX0/ORVwutetEVhW4Oo1wM2nZGiqmGcia7EZa6SoLEEJvpfyRW20hqWl5D6jIaviVmW0JqBmTaz3lcol8NhdKDXymzPMAxNrlSNyVayCjg7h/v7ID48kTsz0iiRYXJS9t6k0I6DTYDWbKAlAQW2amMesyJirAcZ/oZZqJezCwWtWKCeuyqEdOsD+M0QhbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JZXiLtr1oiCnB4Og+efWAqZ8jjLxRVASzeRk64Ro70Y=; b=npGJHcsrk9j19H/WWMM3oVfDNVZAsEDjdtcwpJgnvmHF7ctiBUaNp0b3FAgk5CFhq+yhgiD5MOCseBaEoKtfeVJq1+sJY1+I4/KGrPj1XjCinPaVvczskfo9DS4azzE40D4XULG1UrvIoxK5X10wTm28KXzLwMQ72iZaoMc57ZdHWrYK6/Qb8QRh+lb5rD6mDN9UAdQZ83jFMYNsjCQ5Cb+2RW8WyX4UqUUCSCvpCkCZwTf+vLQsPsF8JJFZzNEAYd8K7K1MsKBi8DLyvrozNsV17TSn/HOFqrtyhMT5jDH/3LcL8+PQXhEbkbcB02XJpEhYk8ccc99GVKBWMzrIbQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from CH3PR11MB435924.namprd11.prod.outlook.com (2603:10b6:610:34a::8) by SJ0PR11MB8269.namprd11.prod.outlook.com (2603:10b6:a03:478::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.10; Fri, 4 Dec 2026 18:21:40 +0000 Received: from CH3PR11MB435924.namprd11.prod.outlook.com ([fe80::1696:c90e:60af:a0cd]) by CH3PR11MB435924.namprd11.prod.outlook.com ([fe80::1696:c90e:60af:a0cd%3]) with mapi id 15.21.0688.011; Fri, 4 Dec 2026 18:21:40 +0000 From: Peter Fang To: Dave Hansen , Kiryl Shutsemau , Rick Edgecombe , "Sean Christopherson" , Paolo Bonzini CC: Thomas Gleixner , Ingo Molnar , Borislav Petkov , , "H. Peter Anvin" , , , , Xu Yilun , Jason Gunthorpe , Tony Lindgren , Chao Gao , Xiaoyao Li , Binbin Wu , Sohil Mehta , Adrian Hunter , "Kishen Maloor" , Nikolay Borisov , Elena Reshetova , Peter Fang Subject: [PATCH v3 0/8] Enable DICE-based TDX quoting Date: Fri, 4 Dec 2026 10:18:21 -0800 Message-ID: <20261204182022.324230-1-peter.fang@intel.com> X-Mailer: git-send-email 2.53.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR13CA0236.namprd13.prod.outlook.com (2603:10b6:a03:2c1::31) To CH3PR11MB435924.namprd11.prod.outlook.com (2603:10b6:610:34a::8) X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR11MB435924:EE_|SJ0PR11MB8269:EE_ X-MS-Office365-Filtering-Correlation-Id: 22bb6ecc-fe59-46f6-e875-08df523370d5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|376014|23010399003|366016|260925022911599003|260925021311599003|56012099006|261102123227099003|260925021911599003|261021123027099003|261026121527099003|261021121427099003|261102124527099003|261028144727099003|261022113327099003|261022105027099003|10067099003|261026140227099003|261022075727099003|261009223027099003|18002099003|11063799006|5023799004|6133799003; X-Microsoft-Antispam-Message-Info: iN6HJ2L2xrJKUSMT2vmLZAnPdXdYEwc9PTCeoxu3zAM8dIbovlK1HoITvDBYBvx4HbsMwqFr6xcQphI12SnTUfHcyn4hgoEh1CMK7PvyuIxbpUbxNhN8iXKTFsomNrjBE6e781A2ccA42l2LVT16WmBhoepuZnnfSx+e0VBpAL9RqjeHVkvixCSAnc0U3UokFTClK4g22Z0YFmsOyEZV2eFIDQEeFTIzHAQ3bUFdQe8TUy927vGwn88YtLaZC0fTKE8Il7KNWJQ6ghbSC464osbe8D5PUMMeFmOe5rmsCy1YSiUnNNGYxUCFe5Q2Y5FHniCinbWTk9vfLx21YI1K6uihPgX+oi6JzjA4jtSh19acrvqHJRqpsMvThw8/LBrjwuMOuBfZp3wDRnbBvUF8kKWhdUjX8MC/6qBznA7PlD0gL7wQhrmC2r9KLSEUzeiiuGgwP7M5xIvhKxpVvNCDYeokN5VA/qaB2Zj1KN+3/GE2E82hqdMnbcBjkxr8mdQ2Le0dP5zWJPTsrOK4LTOn3g4cN7tTD15hx72vOpT8amHNdm1qjimLOFOHFDuKQWz/Yoz0QNwuDMS/xLYHzkC/gL42IJDf2jG8z68kLjR+YWsv0ZHxxf7w9OJOBD+FhvoF X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH3PR11MB435924.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(7416014)(376014)(23010399003)(366016)(260925022911599003)(260925021311599003)(56012099006)(261102123227099003)(260925021911599003)(261021123027099003)(261026121527099003)(261021121427099003)(261102124527099003)(261028144727099003)(261022113327099003)(261022105027099003)(10067099003)(261026140227099003)(261022075727099003)(261009223027099003)(18002099003)(11063799006)(5023799004)(6133799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?629/ukejVCc6t+onSeD0FiSACKHqSK2IxyBwzKcHgqgrcda5psgaJl6IdLbt?= =?us-ascii?Q?xkdO9o5ldD4iDMqI45RDZa3JP8uhBsLm/kOeWVzO1LXO0mGfeQmzyjYUwBpB?= =?us-ascii?Q?4txxhlelqFOgnvNBhv64ZlcZ9vbbN9RKytCuu/C0nFmzjpFE6Znd/wEE8N4L?= =?us-ascii?Q?xH3GAZwWxv7q2Rnw8UXycB7QS2vCH/c83cSFhXtRxokyZ3mi97bNec2qkFKs?= =?us-ascii?Q?gf9wwdXMQDarUn1VsonbYxauwrOahrYtLxJv7ImziXxPXQ84cjL/iD1zwjZK?= =?us-ascii?Q?UKhiH1l3dQd1lyaViBEoKtaWWRXSPCu9BOtWG7/aCVJ5ApXLifKGQqnT3NzP?= =?us-ascii?Q?iERa9vFMww6NTNeqQSRckrX/cPObV750RSKrdFBFW8oih5Skmw0Zl8604imH?= =?us-ascii?Q?pjkOlGY3XkZqMCzcUGkNDT1DjvxYsaK3TSamZC7FFQ+6Z3ir4ATKQXGhij39?= =?us-ascii?Q?oHAxmmDXD977DR/9KvuAd5kvRi0gQJSu8Zfvw9Em8dchAlmA8BHOFyTQB8gv?= =?us-ascii?Q?A8+wbHsSEdMts16ZnOqaeAfVrDBFfDTcFodwl6FjHja7DzrTP8UENOTpoF4C?= =?us-ascii?Q?WFPawa6E59W6qynI4zIkT2KiyIarJ3agmSPz3DKCHnTyhYBqMOwV2XhAHm35?= =?us-ascii?Q?h8KgsiGjPGYUzYu/3UyTkOcNcCY/VtMa3YrdbThwH8tBorh6ziPDHZ4g/TxJ?= =?us-ascii?Q?GMaN1tTCYeeoR9p2jtCVfgHj7MZd1lI57DWMq+qo4kszTtwniw/DBxJXc44t?= =?us-ascii?Q?seh2WKS9vUI4Q7c+CQRVdU/tFzMUvozwoAfIr29/x3Qi6fRZ+Q9jTA9Od9hs?= =?us-ascii?Q?2fu1JmemJ3UoNRBp6YR/eQUb3QQojLwjAS9s7m20YiMcha1CFdw2nOzlNxuf?= =?us-ascii?Q?PDQ4g97MaXdzvk3znO5d0ApuK3GLsa6gnytpekOGS1SZhOhjTcOMYhQX4UO1?= =?us-ascii?Q?lwpmphhvcx1WT0itupTtj7AWNTZWDth469/6Ruudg0jGfqSb3JS6AS3j5rMt?= =?us-ascii?Q?PkzNzLQmAhCDZnvglnJAQh4lXpe74gDh6RvnPw08QxUypgRkX6wOvBEZo3uH?= =?us-ascii?Q?+feRS7Yi9ITTXj4VlaaEJ4TM0x3kI/AcD4pODKjMlCNr3MyURbBkMt20hIl0?= =?us-ascii?Q?yp2JjPlGiV+RPtx5R1yv5apEkSWR0fOjlijCMk5M1VQv6Ar85qsRTrqON4Un?= =?us-ascii?Q?O0ki+HwUj0mpMpQtKrQdy5tjyZ92N2X/L5p+AzkT+FMIT7SHMfwUDD2gerVo?= =?us-ascii?Q?3vwZpN6XL7/tHgemnLPgn5vUBipaKGhPM9/m4+a6NY3htb2IznAQ57pJrI3A?= =?us-ascii?Q?B8g190/XLE2wTsnrzGJmr3roPpTPg0rei0muYor/0CJLuC/0in3Hoalu1dJs?= =?us-ascii?Q?RMkjYmEkbmT4V9Js4lRPh4HIiJfaMhu1M0O6c2H74B/+qOFTOSe8XGmto2oY?= =?us-ascii?Q?VjZLTJMSQ2pJfrUj2ZksFOHfzwIQZknzTidAIqAY/lHPSaYkJ7TRKomNY1Je?= =?us-ascii?Q?zu+44lZv2FO5dVmXMn6yqM9UH9QgBvQ+vVfFMLlm20aS+X4nmNzFwvbXMi+a?= =?us-ascii?Q?MgzxskwHM7pGIj/PVO9r1+KLGMZOOgEsVXaevfZOdq4ORCD6tSPnt/rrNyx5?= =?us-ascii?Q?DlOnbrHvmxTRv0ct7DdH9n2NQCEfjuL3CWChsHZjmNi7aMTWLiVeUBnawtJO?= =?us-ascii?Q?saJwP9gIZdpZ2TfUm0mK5MYsEtNDiCt+GonAofYLRVnwhnL0wB9X7ws52Lmt?= =?us-ascii?Q?shpyjwg7SA=3D=3D?= X-Exchange-RoutingPolicyChecked: nYvQshdiqXJDj/WkXtSCIqTQ3TFgm43yjnsBiByNVBqa6EKEljqksn7rNQUg1Vk7SXp93i8wne8odYf2YGzCa4zj/4T4MustwxhKh6x8H2ji97sOfxKjl+lDgzXxY768Q0MCv1pwctkd4zv6opLCedI6JCa3vPhJLrsOAaGb540i3OcUinsVN5UbGPYW/TZR+Tra2Hfhhtf50Jvo6W2AFXAZdgAyCC6faYnNjnLqJebOj3ZGkGIEtfVvTfNfhYNvWOisTawsdmMpi7ScL1fsOdnKG8qineG9EXldH7dB2Hi8C5wt/acSJZpdHCeE07jLMLjiXQiGDXs0YTr4ZSXlow== X-MS-Exchange-CrossTenant-Network-Message-Id: 22bb6ecc-fe59-46f6-e875-08df523370d5 X-MS-Exchange-CrossTenant-AuthSource: CH3PR11MB435924.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2026 18:21:40.1070 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Xn0TjwLwgfxX7xyy9QtFp566eEIPgvotPjMnpa8W+zDENLL2IwzDAN2KYKoedL7boaLRSILWqYVuyaxnv1LKkQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB8269 X-OriginatorOrg: intel.com Hi, This is v3 of the host side of DICE-based TDX quoting. It underwent a redesign after the v2 review and a couple of PUCK discussions, so there is quite a bit of delta. The biggest changes are keeping userspace in the GetQuote flow and supporting concurrent quoting. Userspace now requests a Quote with a new KVM VM ioctl. There is no longer a big lock serializing TDH.QUOTE.GET calls in the entire system, and as a result the static global Quote buffer is gone too. The TDX module extensions part of v2 is now its own series [1]. That series can (re)initialize quoting implicitly, so the kernel no longer needs TDH.QUOTE.INIT calls. To keep things simple, only enable quoting when there is no Dynamic PAMT. One upside of this redesign is that it keeps the optional use of event notify interrupts in userspace. Userspace can generate the Quote in a separate thread, and use event notify to tell the guest when the Quote is ready. Also, the kernel doesn't have to worry about end-to-end attestation ABI issues. Userspace decides how quoting should be done, so a kernel upgrade shouldn't break attestation for TDs on existing platforms. Patches 1, 2, 7 and 8 are for tip, and patches 3-6 are for KVM. The plan is for this series to go through tip, so Sean, I'd appreciate it if you could take a look at the KVM patches. Jason, this is initial host enabling only. It doesn't address the guest-side Quote type and labeling feedback [2]. Background ========== In TDX attestation, a "Quote" is a TD Report converted into a signed form that a remote party can verify. To get a Quote, a TD passes its report to the host using the GetQuote TDVMCALL. Host KVM then exits to userspace, which sends the report to an SGX quoting enclave. SGX-based attestation requires per-platform certificates from Intel's servers, so this needs an extra step to register the platform and fetch the certificates. Now, TDX modules on newer platforms can generate DICE-based Quotes themselves. These Quotes carry layered certificate chains built from the platform, so there is no need for any extra step. DICE-based quoting runs as a TDX module extension, a separate execution environment inside the TDX module for long-running work [3]. The TDX module generates these Quotes itself. Its signing key is certified by dedicated security hardware like the S3M. The time it takes to generate this type of Quote using the CPU should be on the order of milliseconds. Each Quote request consists of a quoting "session" (about 16KB of memory), which holds its state, and a quoting "thread" (think struct task_struct or struct kvm_vcpu, about 24KB of memory), which runs the session. Sessions and threads come from a fixed global pool shared by all TDs. A Quote request can be interrupted and resumed later, on any CPU, similar to a preempted task. Once a thread starts a request, it isn't released back to the pool until the request finishes. Design ====== With this series, userspace can ask KVM for a Quote, and KVM does the quoting via a SEAMCALL. The design has two goals: 1. Continue using the existing GetQuote flow, to avoid disturbing the guest driver. 2. Allow as much concurrency as is reasonable, to minimize vCPU stalls. Add a new TDX sub-ioctl, KVM_TDX_GET_QUOTE, to request a Quote from userspace. It's a VM ioctl because the SEAMCALL needs the TD's TDR page. To have a stable and maintainable ABI, both the report and the Quote buffers are page-aligned, so KVM doesn't have to deal with unaligned data in perpetuity. Userspace should check how big a Quote can be in KVM_TDX_CAPABILITIES to know how much memory the Quote buffer needs. Every CPU should be able to generate a Quote at the same time, to avoid a noisy-neighbor problem between TDs. So when the kernel enables quoting, KVM requires at least one quoting session and thread per logical CPU. That takes up about 40KB of TDX module memory per CPU, adding up to tens of megabytes on a large system. KVM manages the quoting sessions, and it handles one request per TD at a time. A typical setup doesn't oversubscribe TDs, meaning there are no more TDs than logical CPUs. Every TD is then guaranteed to get a session whenever it asks for a Quote. On an oversubscribed host, userspace sees -EBUSY if KVM runs out of sessions, and it can retry later. The global session allocator should add a few microseconds of delay at most, which is minuscule compared to generating the Quote itself. A DICE-based Quote can be up to several megabytes in size. When there are a large number of Quote requests in flight, using bounce buffers could cost gigabytes of kernel memory on a large system. So KVM uses GUP to pin the Quote buffer instead. This also helps reduce another noisy-neighbor problem. When userspace frees its buffer, the TLB shootdown only hits the CPUs the VMM runs on, whereas a vfree() on the kernel bounce buffer would eventually trigger a shootdown on every CPU. As a result, a TD that does aggressive quoting mostly throttles itself. TDH.QUOTE.GET takes shared locks on the TD, so it doesn't collide with the other runtime SEAMCALLs, only with the ones that build or tear down the TD. So, instead of taking KVM's heavy tdx_vm_state_guard, only allow quoting at runtime, after the TD is finalized. This avoids causing a build-time SEAMCALL to fail and bug the VM. See patch 4 for more details. In order to not break TDX quoting, after a compatible runtime TDX module update, the module must keep the maximum Quote size the same, and still support at least one quoting session and thread per logical CPU. Alternatives considered ======================= Sean suggested doing all of this quoting in the guest, with a new TDCALL. After some discussion [4] and a follow-up PUCK call on 9/23, the consensus was to go back to the host-based design and rely on the current GetQuote flow. Quotes signed directly by the S3M are out of scope for this series. I also considered other ways to manage quoting sessions. sbitmap usually scales better than an IDA under heavy contention, but that felt like premature optimization and made the code less intuitive. It also mostly exists in the storage subsystem. A per-CPU session ID only works if the whole request is non-preemptible. A per-CPU lock, on the other hand, can protect each CPU's session, but it can cause unnecessary cross-VM contention even when there is no oversubscription. Testing ======= Tested with a TDX module that mocks the interruptible quoting ABI and returns a fake Quote. For the userspace side, I used a mocked quoting service in QEMU. Multiple TDs were able to receive Quotes at the same time through GetQuote and the new KVM ioctl. What's in this series ===================== Patches 1-2 add the core TDX interfaces, and patches 3-6 add the KVM side of quoting and document the new uABI. Patch 7 then enables DICE-based quoting, and patch 8 adds documentation for it. Patch 1/8: Generate a Quote with TDH.QUOTE.GET. Patch 2/8: Report the TDX module's quoting capabilities. Patch 3/8: Require a quoting session and thread per logical CPU. Patch 4/8: Add the KVM_TDX_GET_QUOTE sub-ioctl. Patch 5/8: Report the maximum Quote size to userspace. Patch 6/8: Document KVM_TDX_GET_QUOTE. Patch 7/8: Enable quoting at TDX init. Patch 8/8: Document DICE-based quoting. Base ==== This is based on v7.4-rc1, plus v6 of the TDX module extensions series [1]. You can find the full branch at [5]. A matching QEMU is at [6]. AI use ====== I used AI to polish my code, this cover letter, and the commit messages. I also used it to collect review feedback and to verify details against the TDX specs. AI generated the QEMU quoting service used for testing. The series underwent AI code review, which caught a corner case where quoting threads could run out and a few TDX documentation bugs. The other comments were limited to style suggestions. v2: https://lore.kernel.org/all/20260618081355.3253581-1-yilun.xu@linux.intel.com/ v1: https://lore.kernel.org/all/20260522034128.3144354-1-yilun.xu@linux.intel.com/ Changes in v3: - Rebase onto v6 of the TDX module extensions series. - Redesign the Quote generation path. Keep the GetQuote flow unchanged, and add the KVM_TDX_GET_QUOTE sub-ioctl. [Sean, Rick] - Redesign the core TDX interface. Drop the global Quote buffer and its big lock to support concurrent quoting. [Sean, Dave, Rick, Tony] - Use all-0s as the Quote type instead of all-1s in TDH.QUOTE.GET to improve code readability. No functional change. - Drop the tdx_tdr_pa() move (patch 10 in v2) as it's no longer needed. - Drop TDH.QUOTE.INIT. The TDX module now folds it into TDH.EXT.INIT. - Drop Rick's, Dan's and Tony's RB tags on the v2 patches, as those patches were either dropped or changed substantially. [1] https://lore.kernel.org/all/20261202-tdx-module-ext-v6-0-f6d8510fe498@linux.intel.com/ [2] https://lore.kernel.org/all/3860f37059d4c8807fa588c9f03b3a18e9449cec.camel@intel.com/ [3] Intel TDX Module Extension for Quoting, February 2026 (draft) [4] https://lore.kernel.org/all/24a751d16ba0dc37aa7774df5739f39734cf9aca.camel@intel.com/ [5] https://github.com/peterfang/linux/tree/tdx-host-dice-v3 [6] https://github.com/peterfang/qemu/tree/dice-mock Peter Fang (8): x86/virt/tdx: Add interface to generate a Quote x86/virt/tdx: Add interface to check quoting capabilities KVM: TDX: Require at least one quoting session and thread per CPU KVM: TDX: Add KVM_TDX_GET_QUOTE sub-ioctl for quoting KVM: TDX: Report maximum Quote size in TDX capabilities KVM: TDX: Document KVM_TDX_GET_QUOTE x86/virt/tdx: Enable the quoting extension x86/virt/tdx: Add documentation for DICE-based quoting Documentation/arch/x86/tdx.rst | 23 ++- Documentation/virt/kvm/api.rst | 21 ++- Documentation/virt/kvm/x86/intel-tdx.rst | 47 ++++- arch/x86/include/asm/tdx.h | 7 + arch/x86/include/asm/tdx_global_metadata.h | 5 + arch/x86/include/uapi/asm/kvm.h | 16 +- arch/x86/kvm/vmx/tdx.c | 180 ++++++++++++++++++++ arch/x86/kvm/vmx/tdx.h | 6 + arch/x86/virt/vmx/tdx/tdx.c | 125 +++++++++++++- arch/x86/virt/vmx/tdx/tdx.h | 1 + arch/x86/virt/vmx/tdx/tdx_global_metadata.c | 26 +++ 11 files changed, 438 insertions(+), 19 deletions(-) base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4 prerequisite-patch-id: 5fbf78c6f40c69edec7a5016c950c35486f3ce81 prerequisite-patch-id: 3be62622e14be3de67212102aebbec7347773946 prerequisite-patch-id: ff98c5e54482da8ba3206ce825b299c29b3ca445 prerequisite-patch-id: 644cf6ce49ea8ed32adbfeba2234265537bc8576 prerequisite-patch-id: 6f9d56b183bb6344776bf837e2ca0d7f648bb81d prerequisite-patch-id: 52e5e348d4b196e0cf79bb448b4edd6a4d4b4d9a -- 2.53.0