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=1796408515; b=us2NH1uuP7qT427SPA2kxoIhr5G1bK0QhZdwYuA3kan2JwvqqFK95o6tvy+Z6M+vmwih afYBYMTXgRMCX7UBbUvfnnEr72/ut6Yt+QNdRQh+oT8zymsFpgLHY+Gra/BxsMxBnGvYF +SjFyd7P48vK16V/UDwjbhedn3QFk/ipR0JEUmbupUddQ4F2XiXQ6Rq1d5xUUHpM16TdA b95U25i7R493wUtHoY27lYYmKZz2aIsgl2i7YJtmRGErs5eStXb59IubuZspLsZQJpQir s4E3KMA9lFrCXONHcaF7tJh58wH0/iC9xiS55nSC+UQPcF7xl0TU59kqcZvdK5FYA1Q== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796408515; 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:In-Reply-To:References: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=u0+brU+ri4qdfMFCHAupDN/YvOUBMhyhJouMVZJIS4w=; b=1TkNWuffvpE3iZkytldTZXWZK6JwZ7EE4AMcrE+XeQIIsT8E+e9iG+j+v8DdcXkdKB1Z ly6CCQVgkf3uYu/TbXpGMdAFqnU7lg5x3O/NxbBUp1KTvWaT16/yRJBc5Pb+CUWITXbow MWfsro6lQgmPhbyA2GCe+eKyg56HxEm4hrGc/WbvX03sHYoImMFG6eZlzv071QcFhnQo9 E5kVfmZz84Fik1R24aQA98s+GN4/fiqBKIeojM56gXTfE43L/Bb2yfG5axI7agMNkYLAd 4Owa8B8I0EMpJWLQymk8CV/sDV37JSHu4O06oJfFMpVH7FKxjra6eX004qSy0SYcJ3A== 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=WTAxiATJ; 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 077C1606A333; Fri, 4 Dec 2026 18:21:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 077C1606A333 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=WTAxiATJ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796408516; x=1827944516; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=u0+brU+ri4qdfMFCHAupDN/YvOUBMhyhJouMVZJIS4w=; b=WTAxiATJMChYLc0r/jn/QRS2oE7z/mMedAJIxi1xyzrBvPlx3ajZud/1 NJJWIWTGRmjgtDj+6Y9Ak2BU+nMJAdZrLGBd9mZ4HhSqaztrYj7x+RB6P mu3tHczysr0uO/hOlWd3eew1L2PKVTBSInjrPC/wOp1H4953YdkBtuVzt IcGkVOtgJ4ly4T4Rx+sl2MOZwFU/rBBRyqHhzUcB6CkRFpyeGhOlVo/cV 03d2Ll23mJA3l4jfZklImaQ2Z8OBsMNdpsa4fICF3yU7xW/Nc2EQJ0zef rk6x/N7542+TeVLUp8GpRfVU81RwveN44HWF1YzT1UjipPwvuejQfQh23 A==; X-CSE-ConnectionGUID: kbhzMkvkSwWYVfbrx9thfQ== X-CSE-MsgGUID: cShUWqFqSyiLuV5ZGUipUQ== X-IronPort-AV: E=McAfee;i="6800,10657,11986"; a="5284267" X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="5284267" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 10:21:55 -0800 X-CSE-ConnectionGUID: tV91brXGQFiuTB/tmiImug== X-CSE-MsgGUID: 52q9h2GaQ2GNnacAp7NFBw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="13962565" Received: from fmsmsx903.amr.corp.intel.com ([10.18.126.92]) by orviesa004.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 10:21:54 -0800 Received: from FMSMSX903.amr.corp.intel.com (10.18.126.92) by fmsmsx903.amr.corp.intel.com (10.18.126.92) 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:53 -0800 Received: from fmsedg903.ED.cps.intel.com (10.1.192.145) by FMSMSX903.amr.corp.intel.com (10.18.126.92) 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:53 -0800 Received: from MW6PR02CU001.outbound.protection.outlook.com (52.101.48.15) by edgegateway.intel.com (192.55.55.83) 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:53 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yW7CMuhymdz/iBqRccasftDghmW1vsh9rJrT7eH629gmOGdGLstBRwfxLIWsIj1XWZJ7x49lv6LJsccPL77lHpCn/Uo9GAheu7qFe+OOd3GJS5A0VMsc5f5lWnb24c/TrnCn2cBMfrVYSZpLUc2slu74+MV+wkTj2EO7dxsuxVMpbizRQ2s7mIoZFpLT8oP4WoDN5usVfE0avNv23z8y00Z8UZfa+co4C4nRAlETSNtmKxhaCWYQLwldQsSBt/laSnCAJD7wrZLhtUOQhGU2CMrtatVcBn7xtSp2+ZctpHSgQPnJpH6f1RzPOVHZHKJ0ZY12GfmrFnyPcuE8NLoyGQ== 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=u0+brU+ri4qdfMFCHAupDN/YvOUBMhyhJouMVZJIS4w=; b=nhyLuRq/QG71/DrF4rh5I2YFzHsEsHfD6ktKKSbWVOyzSGfuE5AfKFzD2RFUA+43Xy33Qkr0CqMw2bWWmCLZRxhvTMeVgVmURITUW9/PKi2G3F2QDtzuDnkTCJiPCiru4WOsLlQZzHLuberzr2rva7odQQPmUcnFjpoKFJwDj1v0ouMuYSvd2wwNgeudelNsSiPAIxwMgQnfBJxvYfAmlji/PRgTCg7Oy1aKLLaYCJ7haZCPYGPxp/7W12dJqmJCXo67I75+Nlcj1qda/SvqD6J7fxbBMNzyq6nwtXbhwB7rA/0VLCU6Qu55J71/8RGLua/QF5D6a+YGER4f4bsK1w== 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 SJ2PR11MB8345.namprd11.prod.outlook.com (2603:10b6:a03:53c::15) 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:51 +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:51 +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 6/8] KVM: TDX: Document KVM_TDX_GET_QUOTE Date: Fri, 4 Dec 2026 10:18:27 -0800 Message-ID: <20261204182022.324230-7-peter.fang@intel.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261204182022.324230-1-peter.fang@intel.com> References: <20261204182022.324230-1-peter.fang@intel.com> 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: kvm@vger.kernel.org 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_|SJ2PR11MB8345:EE_ X-MS-Office365-Filtering-Correlation-Id: 6777806e-fb1a-4cb0-9c58-08df52337754 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|7416014|376014|23010399003|18002099003|22082099003|10067099003|56012099006|261028144727099003|261026140227099003|261021123027099003|261102123227099003|261021121427099003|261022105027099003|261022075727099003|261026121527099003|261009223027099003|11063799006|5023799004|6133799003|3023799007; X-Microsoft-Antispam-Message-Info: 9mWzljQk+/Z70mCZG5B5LvBJK0XCglpFqvsrJlRH1krOIqCftRufBUu0furiWLUotyUWEPzGt2JOmdnvqrpW4u4R/kG9pZxtSg0bqMGoJSW2XTHFvVVaR4yYB01xwK2q3xloy3iTg6SDNG5j4Jj3J0trsHUZTDYzPAAxJA0wtU/RGcdt+PZ9qZADfd973GMcNEnDFRbyNw4PSTrOjOabCF5CfDthNNq5BqJ60ppk3Z2aKo78OdANFQcLa7LL0PgqBNFPwJ0d6MBmvNztbHYYD6X4T//4G9eR16gB+GPdzK8GKq+26//CMnfwMoxZdkqG5l4T9ZCu6IQWHp4Ka1e0unfsLKLRWEqIJnZNg5aZmJVnYUajvS6cA4lTTdWVFzN7v6/9Hc9G4V3hI87d1jH5ch7kSd6f8uvctDZIcrXpQ8itAMcIHjOCU1Omq2klLU7mUQ7T3S0qK3QQQdqRpUMjaMO7Y0jgL3CP2WhKnEb60AoGjMIL2BRSKD3ucjTbFxcXynwo2tJof1Bw/9KpcJkQgd2yCV2z/oLv6eYpU6SrtQcJZ65w9cSe6tPP3dk5AN3MTxVlOk67zPcJ/hdlSBBzIWudijspdY80B8fr0EaYcBWcdOCE/QdsPHN/H25abmmivpbPsaQ607Qrkj86549uE+v9qGPTr2BDfcOt6F1IqyI= 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)(366016)(1800799024)(7416014)(376014)(23010399003)(18002099003)(22082099003)(10067099003)(56012099006)(261028144727099003)(261026140227099003)(261021123027099003)(261102123227099003)(261021121427099003)(261022105027099003)(261022075727099003)(261026121527099003)(261009223027099003)(11063799006)(5023799004)(6133799003)(3023799007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ecLhIr4r0+lm6Apd9wRoaUd6TWb6xFmc6angqtWZv67aYPRr6Y0E+bFptCjg?= =?us-ascii?Q?fMnJINsSvSRGb6iAQwAETanB8tvNQNEPa5pp2lY2PqDDTG930ch10ox7L9Fj?= =?us-ascii?Q?UZ3TUO+57huN03fPAmPUf9TR6ulqJxPy92jt3wK/0s8aKuUGstBlM5MkwzD4?= =?us-ascii?Q?780beO+ri2o6hV5ze4uirKDlBDtRFy3llq7m+ghaSbpRUADGIWDi3JaXFGd0?= =?us-ascii?Q?0mRqAiq/nKvdDsEZnfjaChNi/mfLRcI0uRh0VmRKqsPDd+ZOzaiJQjqvw3YN?= =?us-ascii?Q?ANKfGaA3lHG8Y1Z6bLzIv2+uQY8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: 6777806e-fb1a-4cb0-9c58-08df52337754 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:50.9692 (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: yWcu1gWDFvzXYN2mOrxR8l9CFdZoylo2HEc/IKYy7ubGGWyVixtaWeyk/Y4XAG0bRaf6kzKjCOwgdRyT6iUHow== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR11MB8345 X-OriginatorOrg: intel.com Document the KVM_TDX_GET_QUOTE command, which lets userspace request DICE-based Quotes from the TDX module, without using a Quoting Enclave on the host. Signed-off-by: Peter Fang --- v3: - New patch based on the redesigned Quote generation path. --- Documentation/virt/kvm/api.rst | 21 ++++++----- Documentation/virt/kvm/x86/intel-tdx.rst | 47 +++++++++++++++++++++++- 2 files changed, 58 insertions(+), 10 deletions(-) diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst index e95c9cda085d9..f6418e91aa3e4 100644 --- a/Documentation/virt/kvm/api.rst +++ b/Documentation/virt/kvm/api.rst @@ -7561,15 +7561,18 @@ inputs and outputs of the TDVMCALL. Currently the following values of ``nr`` are defined: * ``TDVMCALL_GET_QUOTE``: the guest has requested to generate a TD-Quote - signed by a service hosting TD-Quoting Enclave operating on the host. - Parameters and return value are in the ``get_quote`` field of the union. - The ``gpa`` field and ``size`` specify the guest physical address - (without the shared bit set) and the size of a shared-memory buffer, in - which the TDX guest passes a TD Report. The ``ret`` field represents - the return value of the GetQuote request. When the request has been - queued successfully, the TDX guest can poll the status field in the - shared-memory area to check whether the Quote generation is completed or - not. When completed, the generated Quote is returned via the same buffer. + from a TD Report, signed by a certified attestation key. Userspace can + get it from a TD-Quoting Enclave on the host. Or, if the TDX module + supports quoting, the ``KVM_TDX_GET_QUOTE`` command can generate a + DICE-based Quote. Parameters and return value are in the ``get_quote`` + field of the union. The ``gpa`` field and ``size`` specify the guest + physical address (without the shared bit set) and the size of a + shared-memory buffer, in which the TDX guest passes a TD Report. The + ``ret`` field represents the return value of the GetQuote request. When + the request has been queued successfully, the TDX guest can poll the + status field in the shared-memory area to check whether the Quote + generation is completed or not. When completed, the generated Quote is + returned via the same buffer. * ``TDVMCALL_GET_TD_VM_CALL_INFO``: the guest has requested the support status of TDVMCALLs. The output values for the given leaf should be diff --git a/Documentation/virt/kvm/x86/intel-tdx.rst b/Documentation/virt/kvm/x86/intel-tdx.rst index d8d9409120e61..1bd95f6df49d6 100644 --- a/Documentation/virt/kvm/x86/intel-tdx.rst +++ b/Documentation/virt/kvm/x86/intel-tdx.rst @@ -38,6 +38,7 @@ ioctl with TDX specific sub-ioctl() commands. KVM_TDX_INIT_MEM_REGION, KVM_TDX_FINALIZE_VM, KVM_TDX_GET_CPUID, + KVM_TDX_GET_QUOTE, KVM_TDX_CMD_NR_MAX, }; @@ -92,7 +93,12 @@ to be configured to the TDX guest. __u64 kernel_tdvmcallinfo_1_r12; __u64 user_tdvmcallinfo_1_r12; - __u64 reserved[250]; + /* Maximum size of a Quote for KVM_TDX_GET_QUOTE, or 0 if quoting isn't + * available + */ + __u64 quote_max_size; + + __u64 reserved[249]; /* Configurable CPUID bits for userspace */ struct kvm_cpuid2 cpuid; @@ -197,6 +203,45 @@ Complete measurement of the initial TD contents and mark it ready to run. - hw_error: must be 0 +KVM_TDX_GET_QUOTE +----------------- +:Type: vm ioctl +:Returns: 0 on success, <0 on error + +Generate a DICE-based Quote from a TD Report. @report_uaddr points to the +TD Report, and @report_size is its size. @quote_buf_uaddr points to the +buffer for the Quote, and @quote_buf_size is its size. On success, KVM +writes the Quote to the buffer, and the size of the Quote to @quote_size. +This needs to be called after KVM_TDX_FINALIZE_VM succeeds. + +@report_uaddr and @quote_buf_uaddr must be page-aligned, and @report_size +must not exceed the size of a page. @quote_buf_size must be at least the +quote_max_size reported by KVM_TDX_CAPABILITIES. + +When TDs are oversubscribed, i.e. when there are more TDs than logical +CPUs, KVM returns -EBUSY if there are as many Quote requests in progress +as logical CPUs, and userspace can retry later. KVM never returns -EBUSY +when TDs aren't oversubscribed. + +- id: KVM_TDX_GET_QUOTE +- flags: must be 0 +- data: pointer to struct kvm_tdx_get_quote (in/out) +- hw_error: must be 0 (out) + +:: + + struct kvm_tdx_get_quote { + __u64 report_uaddr; + __u64 report_size; + + __u64 quote_buf_uaddr; + __u64 quote_buf_size; + __u64 quote_size; + + __u64 reserved[27]; + }; + + KVM_TDX_GET_CPUID ----------------- :Type: vcpu ioctl -- 2.53.0