From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web09.2274.1646180902366421497 for ; Tue, 01 Mar 2022 16:28:23 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=F7Lch16m; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: min.m.xu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646180902; x=1677716902; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Ss+Vh/KEELHTdryy+ywhwdLnabT6BuxtI4kfEWWUjuY=; b=F7Lch16mtNylDwM2Zo8MSUbHUVUUNUe5sYe38UQH8jn/NQE1zqaayYTN QAJpyBH0tRqn/cmA9m2spAkXPvGZGpTlIWjBSe8H++OiFrlm+BcJeAD9k WmCoaWl0xr41k+PTlPR1V5H0nMUiOejKIfAXPFn7EvGXgNF17V5oURmO9 YrrPhh+gAsiNRaSas9D0Ye87M9rjxQ05+7HTyhajRnqx599+DbPi2aZIE esL5qZ8jMgh+HIKezsx+/x8/Pp+xC6kh3nfRulwjbPYQhu78ZYefvwv8z JU5AoP8lcIkcuXLVjI4rdawxtI8rgFUPepTSrF2/JYGnSbYgumTksR6lZ w==; X-IronPort-AV: E=McAfee;i="6200,9189,10273"; a="253006522" X-IronPort-AV: E=Sophos;i="5.90,146,1643702400"; d="scan'208";a="253006522" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2022 16:28:21 -0800 X-IronPort-AV: E=Sophos;i="5.90,146,1643702400"; d="scan'208";a="641482153" Received: from mxu9-mobl1.ccr.corp.intel.com ([10.238.2.184]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2022 16:28:17 -0800 From: "Min Xu" To: devel@edk2.groups.io Cc: Min Xu , Jiewen Yao , Jian J Wang , Gerd Hoffmann , Xiaoyu Lu , Guomin Jiang , Michael D Kinney , Liming Gao , Zhiguang Liu , Sami Mujawar , Ken Lu , Ard Biesheuvel , Jordan Justen , Brijesh Singh , Erdem Aktas , James Bottomley , Tom Lendacky Subject: [PATCH 0/8] Enable RTMR based measurement and measure boot for Td guest Date: Wed, 2 Mar 2022 08:27:59 +0800 Message-Id: <20220302002807.982-1-min.m.xu@intel.com> X-Mailer: git-send-email 2.29.2.windows.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3853 Intel's Trust Domain Extensions (Intel TDX) refers to an Intel technology that extends Virtual Machines Extensions (VMX) and Multi-Key Total Memory Encryption (MKTME) with a new kind of virutal machines guest called a Trust Domain (TD). A TD is desinged to run in a CPU mode that protects the confidentiality of TD memory contents and the TD's CPU state from other software, including the hosting Virtual-Machine Monitor (VMM), unless explicitly shared by the TD itself. There are 2 configurations for TDVF to upstream. See below link for the definitions of the 2 configurations. https://edk2.groups.io/g/devel/message/76367 This patch-set is to enable below features of Config-B in OvmfPkg. - Enable RTMR based measurement and measured boot - Install CC_MEASUREMENT_PROTOCOL instance in Td guest The measurement for the other components, such as kernel image, initrd, will be in the following patch-sets. Patch 1: HashLibBaseCryptoRouterTdx provides SHA384 service and extend to RTMR registers. Patch 2: SecCryptLib is the cryptographic library instance for SEC. Patch 3 - 7: These 5 patches are related to RTMR based measurement and CC Eventlog ACPI table. Patch 8: Update IntelTdxX64.dsc/IntelTdxX64.fdf to support RTMR based measurement and measured boot. Code at: https://github.com/mxu9/edk2/tree/tdvf_wave4.v1 Cc: Jiewen Yao Cc: Jian J Wang Cc: Gerd Hoffmann Cc: Xiaoyu Lu Cc: Guomin Jiang Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Sami Mujawar Cc: Ken Lu Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Brijesh Singh Cc: Erdem Aktas Cc: James Bottomley Cc: Tom Lendacky Signed-off-by: Min Xu Min Xu (8): Security: Add HashLibBaseCryptoRouterTdx CryptoPkg: Add SecCryptLib MdePkg: Add definition of EFI_CC_EVENT_HOB_GUID OvmfPkg/IntelTdx: Measure Td HobList and Configuration FV MdePkg: Define CC Measure EventLog ACPI Table OvmfPkg: Add PCDs for LAML/LASA field in CC EVENTLOG ACPI table OvmfPkg/IntelTdx: Add TdTcg2Dxe OvmfPkg/IntelTdx: Enable RTMR based measurement and measure boot CryptoPkg/CryptoPkg.dsc | 4 + .../Library/BaseCryptLib/SecCryptLib.inf | 67 + MdePkg/Include/Protocol/CcMeasurement.h | 28 + MdePkg/MdePkg.dec | 1 + OvmfPkg/IntelTdx/IntelTdxX64.dsc | 15 +- OvmfPkg/IntelTdx/IntelTdxX64.fdf | 5 + OvmfPkg/IntelTdx/PeilessStartupLib/IntelTdx.c | 497 ++++ .../PeilessStartupLib/PeilessStartup.c | 30 + .../PeilessStartupInternal.h | 57 + .../PeilessStartupLib/PeilessStartupLib.inf | 7 +- .../IntelTdx/TdTcg2Dxe/MeasureBootPeCoff.c | 407 +++ OvmfPkg/IntelTdx/TdTcg2Dxe/TdTcg2Dxe.c | 2487 +++++++++++++++++ OvmfPkg/IntelTdx/TdTcg2Dxe/TdTcg2Dxe.inf | 101 + OvmfPkg/OvmfPkg.dec | 6 + .../HashLibBaseCryptoRouterTdx.c | 214 ++ .../HashLibBaseCryptoRouterTdx.inf | 41 + SecurityPkg/SecurityPkg.dsc | 10 + 17 files changed, 3974 insertions(+), 3 deletions(-) create mode 100644 CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf create mode 100644 OvmfPkg/IntelTdx/PeilessStartupLib/IntelTdx.c create mode 100644 OvmfPkg/IntelTdx/TdTcg2Dxe/MeasureBootPeCoff.c create mode 100644 OvmfPkg/IntelTdx/TdTcg2Dxe/TdTcg2Dxe.c create mode 100644 OvmfPkg/IntelTdx/TdTcg2Dxe/TdTcg2Dxe.inf create mode 100644 SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterTdx.c create mode 100644 SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterTdx.inf -- 2.29.2.windows.2