From nobody Mon Feb 9 09:34:47 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+98645+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+98645+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1673941245; cv=none; d=zohomail.com; s=zohoarc; b=fLmN4ptOF56PU7I2Y/3v7Dtd3NWyhCNyfgLg9IYEnQb7KNQm7ZyvDEAf7gwpHCJkqgCuOBAFjVuJFK+i4hIizjQM0URGnwssuCScvyMlNmEn3acdkCF+VAiv9DV0KvW8a5IFxyi3amtmUW/QcS3w/jKghBcjDkkexLEFRII+SPE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673941245; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=R9lViBryVUCpcY0yT5nP91qA//g//YcCCS7DcNTJiYo=; b=J5lqQZChHJb0XlE9zu3CiGGIvtcEu4XQZDuzSqG4eOrBhuUKe0QehRJ+lvYhN94PIJBNfl04i++Ig4I6s/OaW5T55q4ZEVx22KbZBH5h4ZLAkF75V2g1BLCFOBSNHUdiMKWYOiZCgcz+0BMMuykUmn/GgX/RIUwCmfYSPviJqH4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+98645+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1673941245611713.217268515568; Mon, 16 Jan 2023 23:40:45 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id GqSVYY1788612xT5zR9K4D1o; Mon, 16 Jan 2023 23:40:45 -0800 X-Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web11.191458.1673941232793135292 for ; Mon, 16 Jan 2023 23:40:44 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10592"; a="304320311" X-IronPort-AV: E=Sophos;i="5.97,222,1669104000"; d="scan'208";a="304320311" X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jan 2023 23:40:42 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10592"; a="636772001" X-IronPort-AV: E=Sophos;i="5.97,222,1669104000"; d="scan'208";a="636772001" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.254.211.139]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jan 2023 23:40:39 -0800 From: "Min Xu" To: devel@edk2.groups.io Cc: Min M Xu , Erdem Aktas , James Bottomley , Jiewen Yao , Gerd Hoffmann , Tom Lendacky , Michael Roth Subject: [edk2-devel] [PATCH V1 4/7] OvmfPkg/IntelTdx: Update tdx measurement in SEC phase Date: Tue, 17 Jan 2023 15:40:13 +0800 Message-Id: <20230117074016.1056-5-min.m.xu@intel.com> In-Reply-To: <20230117074016.1056-1-min.m.xu@intel.com> References: <20230117074016.1056-1-min.m.xu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,min.m.xu@intel.com X-Gm-Message-State: QuAp9vZR6kjG9znWBET9Cvtbx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1673941245; bh=Z8YlmCEyovkvablAmlSuKdELB04fogtE0rWv3F0H8fA=; h=Cc:Date:From:Reply-To:Subject:To; b=STXxpOpoa9WmBkZZgVDmJW5nNuX3daWLMNXnPpVcUyz+Xvz89aPXPSS1W49JqR6a811 XErdETv8VhshGtNZ7sOFj3YXly6EmTl6c+xK5IP/bo0vyeshr1Ij7ImDJulvMoN8er99r 76U4Ox1Sk2jg7QOq0Q22bXPtb78MEfG7wZE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1673941246345100001 Content-Type: text/plain; charset="utf-8" From: Min M Xu BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4243 After TdxHelperLib is instroduced, the SecMain.c in IntelTdx is updated with the new functions provided by TdxHelperLib. Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Gerd Hoffmann Cc: Tom Lendacky Cc: Michael Roth Signed-off-by: Min Xu --- OvmfPkg/IntelTdx/IntelTdxX64.dsc | 4 +--- OvmfPkg/IntelTdx/Sec/SecMain.c | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc b/OvmfPkg/IntelTdx/IntelTdxX6= 4.dsc index 81511e3556a6..d8232f27dae9 100644 --- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc +++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc @@ -541,10 +541,8 @@ OvmfPkg/IntelTdx/Sec/SecMain.inf { NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompre= ssLib.inf - TpmMeasurementLib|SecurityPkg/Library/SecTpmMeasurementLib/SecTpmMea= surementLibTdx.inf + NULL|OvmfPkg/IntelTdx/TdxHelperLib/SecTdxHelperLib.inf BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf - HashLib|SecurityPkg/Library/HashLibTdx/HashLibTdx.inf - NULL|SecurityPkg/Library/HashInstanceLibSha384/HashInstanceLibSha384= .inf } =20 # diff --git a/OvmfPkg/IntelTdx/Sec/SecMain.c b/OvmfPkg/IntelTdx/Sec/SecMain.c index ab01ec9ab19c..ccb217b709a0 100644 --- a/OvmfPkg/IntelTdx/Sec/SecMain.c +++ b/OvmfPkg/IntelTdx/Sec/SecMain.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include =20 @@ -62,12 +62,25 @@ SecCoreStartupWithStack ( volatile UINT8 *Table; =20 if (CcProbe () =3D=3D CcGuestTypeIntelTdx) { + // + // From the security perspective all the external input should be meas= ured before + // it is consumed. TdHob and Configuration FV (Cfv) image are passed f= rom VMM + // and should be measured here. + // + if (EFI_ERROR (TdxHelperMeasureTdHob ())) { + CpuDeadLoop (); + } + + if (EFI_ERROR (TdxHelperMeasureCfvImage ())) { + CpuDeadLoop (); + } + // // For Td guests, the memory map info is in TdHobLib. It should be pro= cessed // first so that the memory is accepted. Otherwise access to the unacc= epted // memory will trigger tripple fault. // - if (ProcessTdxHobList () !=3D EFI_SUCCESS) { + if (TdxHelperProcessTdHob () !=3D EFI_SUCCESS) { CpuDeadLoop (); } } --=20 2.29.2.windows.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#98645): https://edk2.groups.io/g/devel/message/98645 Mute This Topic: https://groups.io/mt/96325911/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-