From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web12.5424.1626052808517988836 for ; Sun, 11 Jul 2021 18:20:08 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: min.m.xu@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10042"; a="209726380" X-IronPort-AV: E=Sophos;i="5.84,232,1620716400"; d="scan'208";a="209726380" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jul 2021 18:20:07 -0700 X-IronPort-AV: E=Sophos;i="5.84,232,1620716400"; d="scan'208";a="459018115" Received: from mxu9-mobl1.ccr.corp.intel.com ([10.238.4.4]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jul 2021 18:20:04 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min Xu , Ard Biesheuvel , Jordan Justen , Brijesh Singh , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky , Eric Dong , Ray Ni , Debkumar De Subject: [PATCH 0/6] Add Intel TDX support in OvmfPkg/ResetVector Date: Mon, 12 Jul 2021 09:19:36 +0800 Message-Id: X-Mailer: git-send-email 2.29.2.windows.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3249 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. The patch-sets to support Intel TDX in OvmfPkg is split into several waves. This is wave1 which adds Intel TDX support in OvmfPkg/ResetVector. Patch 1 add the PCDs of BFV/CFV. BFV is the code part of the image. CFV is the configuration part. BFV is measured by VMM and CFV is measured by TDVF itself. Patch 2 add TdxMetadata in OvmfPkg/ResetVector. It describes the information about the image so that VMM can do the initialization and measurement based on these information. Patch 3 add a null entry point of InitTdx in UefiCpuPkg/ResetVector. The actual implemenation of InitTdx is in OvmfPkg/ResetVector. Patch 4 add the ReloadFlat32 in UefiCpuPkg/ResetVector. Patch 5 update the UefiCpuPkg/Vtf0/Main.asm to add Main32 entrypoint. It is because on reset all the CPUs are in 32-bit protected mode. Patch 6 put above stuff all together to enable Intel TDX in OvmfPkg ResetVector phase. [TDX]: https://software.intel.com/content/dam/develop/external/us/en/ documents/tdx-whitepaper-final9-17.pdf [TDVF]: https://software.intel.com/content/dam/develop/external/us/en/ documents/tdx-virtual-firmware-design-guide-rev-1.pdf Code is at https://github.com/mxu9/edk2/tree/tdvf_wave1 Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Brijesh Singh Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Eric Dong Cc: Ray Ni CC: Debkumar De Signed-off-by: Min Xu Min Xu (6): OvmfPkg: Add Tdx BFV/CFV PCDs and PcdOvmfImageSizeInKb OvmfPkg: Add Tdx metadata UefiCpuPkg/ResetVector: Add InitTdx in UefiCpuPkg UefiCpuPkg/ResetVector: Add ReloadFlat32 in UefiCpuPkg UefiCpuPkg/ResetVector: Add Main32 entry point in Main.asm OvmfPkg/ResetVector: Update ResetVector to support Tdx OvmfPkg/OvmfPkg.dec | 13 +++ OvmfPkg/OvmfPkgDefines.fdf.inc | 12 ++- OvmfPkg/ResetVector/Ia16/ResetVectorVtf0.asm | 38 ++++++++ OvmfPkg/ResetVector/Ia32/Flat32ToFlat64.asm | 47 +++++++++ OvmfPkg/ResetVector/Ia32/InitTdx.asm | 57 +++++++++++ OvmfPkg/ResetVector/Ia32/PageTables64.asm | 41 ++++++++ OvmfPkg/ResetVector/ResetVector.inf | 11 ++- OvmfPkg/ResetVector/ResetVector.nasmb | 64 +++++++++++- OvmfPkg/ResetVector/X64/TdxMetadata.asm | 97 +++++++++++++++++++ UefiCpuPkg/ResetVector/Vtf0/Ia32/InitTdx.asm | 15 +++ .../ResetVector/Vtf0/Ia32/ReloadFlat32.asm | 43 ++++++++ UefiCpuPkg/ResetVector/Vtf0/Main.asm | 45 +++++++++ UefiCpuPkg/ResetVector/Vtf0/Vtf0.nasmb | 2 + 13 files changed, 481 insertions(+), 4 deletions(-) create mode 100644 OvmfPkg/ResetVector/Ia32/InitTdx.asm create mode 100644 OvmfPkg/ResetVector/X64/TdxMetadata.asm create mode 100644 UefiCpuPkg/ResetVector/Vtf0/Ia32/InitTdx.asm create mode 100644 UefiCpuPkg/ResetVector/Vtf0/Ia32/ReloadFlat32.asm -- 2.29.2.windows.2