From nobody Mon Feb 9 08:56:39 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+98852+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+98852+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1674098940; cv=none; d=zohomail.com; s=zohoarc; b=Zen8ojljq6fPsMjpeDGuht0M/rDhDK9fjD8i442b8UcyFgxxZppy4fZ5o+cUBUiL/3iJOuu2mDl/55QqNmrN5Oozt8sukfQvZt0A4y1Mq1RWXaUf5f2El8g9FtU3CMrBVBdUMJSGMyJmQMKpBqgxKMoagjbEVviJIOfiUlnD7x0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674098940; 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=Zd7bwV4ZFZmRK8YUxQDZlCA8SNa8/cLX2PMc1IsSlAI=; b=jSuqzHVVfeXw8UHUfov6QlU8l2pvtIHA4UP+ghU3JNE2oeG9ef+/Iv+wj2lOxJvHDDT+pwuDllnR30BnF1++Ikad2p9s/UiL2UUpn1uvHyuhZl26QUCEeyNs9tYOOwiuyOxxA/JEm5Cx1oyYLwAsD6NcmeTyoS/CdlrIg/zCJOU= 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+98852+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 1674098940224602.5738528463147; Wed, 18 Jan 2023 19:29:00 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id dMxIYY1788612xmdmiHE3Yuk; Wed, 18 Jan 2023 19:28:59 -0800 X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web11.37667.1674098921938942214 for ; Wed, 18 Jan 2023 19:28:59 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10594"; a="387531257" X-IronPort-AV: E=Sophos;i="5.97,226,1669104000"; d="scan'208";a="387531257" X-Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2023 19:28:58 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10594"; a="692264441" X-IronPort-AV: E=Sophos;i="5.97,226,1669104000"; d="scan'208";a="692264441" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.254.211.169]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2023 19:28:56 -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 V2 07/10] OvmfPkg/IntelTdx: Update tdx measurement in SEC phase Date: Thu, 19 Jan 2023 11:28:19 +0800 Message-Id: <20230119032822.1406-8-min.m.xu@intel.com> In-Reply-To: <20230119032822.1406-1-min.m.xu@intel.com> References: <20230119032822.1406-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: mNnhgKmeW9r3UrTG1EYJzP8nx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1674098939; bh=ogCKUDVziJnhC1sp5m3kDAxvqjNWIpbtwX6z0Al1dDo=; h=Cc:Date:From:Reply-To:Subject:To; b=FJalP27gHUbcxitdn8dFoDx1C0BhAPc1fg+NrAMdu/s8VeEpPB4Ozs6hAKhx/bi04RY YVNs/zH/dXoOv0g3DBFV4N+GJape/DRmizDmCh9HlXdo/oZfC2t1aaNTH9A+A1j8sTSVm v5p+sRpkqGvq4uLvVQzPj39uFZyIAcleysw= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1674098940659100014 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 Acked-by: Gerd Hoffmann --- 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 (#98852): https://edk2.groups.io/g/devel/message/98852 Mute This Topic: https://groups.io/mt/96370903/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-