From nobody Sun May 5 11:05:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+48260+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+48260+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1569737785; cv=none; d=zoho.com; s=zohoarc; b=kxaAoTZQ794DtpSMUmHn5M0xNrc3960WkPHy62SYEsbXjjidAKBy28hCcmbPjLuZb6rUaebiONKM4/PmAdofJ2iN7Ey1jzXBaxcByVSzFa0oK6GjiKZwvPTW9KyWIBMDx7i5WBIs5ZIGTO9OtQq4QTsYrdT5SS8axTY9Bz0hbg8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569737785; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=j5E0cLHnqveV2HQd6h32HeLOWhJfGTVsHSNVteJknNw=; b=WID5ff18MmgOcWlDeOyv4XVo8ENdwM8ZRYPXs/bhF3o3HUz8KZlHh1Q0+bEpjrhEPUuonN5CMAxIlWtqcxFLEfE2h6I+vNhYNP8HYseNNFR8Lcl54qMXbg3pxhpAvgssuWGIkyr5zNCAgyUysySob5/tkwCnYVlDEOq1D7uIYGM= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+48260+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1569737785690297.3102696023735; Sat, 28 Sep 2019 23:16:25 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id aaaaYY1788612xaaaaaaaaaa; Sat, 28 Sep 2019 23:16:25 -0700 X-Received: from mga07.intel.com (mga07.intel.com []) by groups.io with SMTP; Sat, 28 Sep 2019 23:16:24 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Sep 2019 23:16:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,562,1559545200"; d="scan'208";a="189910267" X-Received: from jyao1-mobl2.ccr.corp.intel.com ([10.254.212.144]) by fmsmga008.fm.intel.com with ESMTP; 28 Sep 2019 23:16:23 -0700 From: "Yao, Jiewen" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao Subject: [edk2-devel] [PATCH 1/3] MdePkg/Include: correct Lasa in Tpm2Acpi. Date: Sun, 29 Sep 2019 14:15:56 +0800 Message-Id: <20190929061558.22512-2-jiewen.yao@intel.com> In-Reply-To: <20190929061558.22512-1-jiewen.yao@intel.com> References: <20190929061558.22512-1-jiewen.yao@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,jiewen.yao@intel.com X-Gm-Message-State: aaaaaaaaaaaaaaaaaaaaaaaax1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1569737785; bh=P4oi1hk05lt6vQovM/SdT/o9I/7ZG7IFkSUbebqxi1U=; h=Cc:Date:From:Reply-To:Subject:To; b=uMFxJf5BGKYrtSCLAPIwYzyi3HRlgWrcXhaKkt11H22RaACt8LPBSea7kFggvT3oJD9 vz7T2MUoYFUjGff91vapPB5EYwL/EpWFs3fk9aRdiTSZ+Ni52M28M+F7CCcU+GyjINX5Z MIf05+KvtWDu2OsbfEARQ3zqVeX4jT/B/WM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Correct Lasa according to TCG ACPI spec. Cc: Michael D Kinney Cc: Liming Gao Signed-off-by: Jiewen Yao Reviewed-by: Jian J Wang Reviewed-by: Liming Gao --- MdePkg/Include/IndustryStandard/Tpm2Acpi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdePkg/Include/IndustryStandard/Tpm2Acpi.h b/MdePkg/Include/In= dustryStandard/Tpm2Acpi.h index b75f025f03..3ed6834cc9 100644 --- a/MdePkg/Include/IndustryStandard/Tpm2Acpi.h +++ b/MdePkg/Include/IndustryStandard/Tpm2Acpi.h @@ -27,7 +27,7 @@ typedef struct { UINT32 StartMethod; //UINT8 PlatformSpecificParameters[]; // size up to= 12 //UINT32 Laml; // Optional -//UINT32 Lasa; // Optional +//UINT64 Lasa; // Optional } EFI_TPM2_ACPI_TABLE; =20 #define EFI_TPM2_ACPI_TABLE_START_METHOD_ACPI = 2 --=20 2.19.2.windows.1 -=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 (#48260): https://edk2.groups.io/g/devel/message/48260 Mute This Topic: https://groups.io/mt/34330939/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- From nobody Sun May 5 11:05:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+48261+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+48261+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1569737786; cv=none; d=zoho.com; s=zohoarc; b=eGlOO3sE6jlHlIdu3lIHIBRDvXGbGIl1pwbReuIRqgAgXkApk6to+WR0fRZr3m50KvE+eB9+cnpBMBb8WJBa0EW9teNO0mIpgQwHNJcBP9q9ZdBhNSdgY5dBzi7b0NS0MwE07LN5d/wrKTIQJLyudNkQ50KtUnNEZq3XaWSLZpo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569737786; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=l38mc0Ow5oAZCwmW73aYYzKWv88mRkFvnLrBVZJki+s=; b=VKnsO31uvqr0St3INYoOCXZY7upeeTey3TXrRGGCD4822cKVa8cCsmP/4wRrz78Riv6Qhutw+u2FMkk6kN1qYHzSu6+jD0ooZQOzBUQHLE5gZYBDfg91J40gRC4hLWvTxebzDNSNwZl2KbKCuJ26Vs7rP+eUa+L+EKlYf+Df3/0= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+48261+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1569737786607747.5878370020358; Sat, 28 Sep 2019 23:16:26 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id aaaaYY1788612xaaaaaaaaaa; Sat, 28 Sep 2019 23:16:26 -0700 X-Received: from mga07.intel.com (mga07.intel.com []) by groups.io with SMTP; Sat, 28 Sep 2019 23:16:25 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Sep 2019 23:16:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,562,1559545200"; d="scan'208";a="189910280" X-Received: from jyao1-mobl2.ccr.corp.intel.com ([10.254.212.144]) by fmsmga008.fm.intel.com with ESMTP; 28 Sep 2019 23:16:24 -0700 From: "Yao, Jiewen" To: devel@edk2.groups.io Cc: Jian J Wang , Chao Zhang Subject: [edk2-devel] [PATCH 2/3] SecurityPkg/dsc: Add PCD for Laml, Lasa for TPM2. Date: Sun, 29 Sep 2019 14:15:57 +0800 Message-Id: <20190929061558.22512-3-jiewen.yao@intel.com> In-Reply-To: <20190929061558.22512-1-jiewen.yao@intel.com> References: <20190929061558.22512-1-jiewen.yao@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,jiewen.yao@intel.com X-Gm-Message-State: aaaaaaaaaaaaaaaaaaaaaaaax1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1569737786; bh=eHwZYGX3LN2oLwJA8DIEvQ7rKO4MfhCQFvRM9VkAtx0=; h=Cc:Date:From:Reply-To:Subject:To; b=UvIN0OzkCtBsK836e1dJYHkM9/nu06pILK0pWcorj4ru2tv2+E605sj2vbyWUDfMeDh XJItlSRV2ftkp+jpeHQZZ3nfeaWrpdIrC4LXTIuCTLSA7ZUOhAufWx1iA+uk9zwoWZydM ms18jECc/A1mIU681FGR0P8ldVtyJpFhT/Y= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Those PCDs will be used for TPM2 ACPI table. Tcg2Dxe need produce those for event log address. Tcg2Smm need consume those to fill TPM2 ACPI table. Cc: Jian J Wang Cc: Chao Zhang Signed-off-by: Jiewen Yao Reviewed-by: Jian J Wang --- SecurityPkg/SecurityPkg.dec | 8 ++++++++ SecurityPkg/SecurityPkg.uni | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/SecurityPkg/SecurityPkg.dec b/SecurityPkg/SecurityPkg.dec index 6dbaff1a0c..8249bf0220 100644 --- a/SecurityPkg/SecurityPkg.dec +++ b/SecurityPkg/SecurityPkg.dec @@ -488,5 +488,13 @@ # @Prompt IdleByass status supported by current active TPM interface. gEfiSecurityPkgTokenSpaceGuid.PcdCRBIdleByPass|0xFF|UINT8|0x0001001F =20 + ## This PCD records LAML field in TPM2 ACPI table. + # @Prompt Tpm2AcpiTableLaml LAML field in TPM2 ACPI table. + gEfiSecurityPkgTokenSpaceGuid.PcdTpm2AcpiTableLaml|0|UINT32|0x00010022 + + ## This PCD records LASA field in TPM2 ACPI table. + # @Prompt Tpm2AcpiTableLasa LASA field in TPM2 ACPI table. + gEfiSecurityPkgTokenSpaceGuid.PcdTpm2AcpiTableLasa|0|UINT64|0x00010023 + [UserExtensions.TianoCore."ExtraFiles"] SecurityPkgExtra.uni diff --git a/SecurityPkg/SecurityPkg.uni b/SecurityPkg/SecurityPkg.uni index 14077fbc28..ee79b98f0d 100644 --- a/SecurityPkg/SecurityPkg.uni +++ b/SecurityPkg/SecurityPkg.uni @@ -286,3 +286,12 @@ = " TRUE - Skip password prompt.\n" = " FALSE - Does not skip password prompt.\n" =20 +#string STR_gEfiSecurityPkgTokenSpaceGuid_PcdTpm2AcpiTableLaml_PROMPT #la= nguage en-US "The LAML of TPM2 ACPI table" + +#string STR_gEfiSecurityPkgTokenSpaceGuid_PcdTpm2AcpiTableLaml_HELP #lang= uage en-US "This PCD defines LAML of TPM2 ACPI table\n\n" + = "0 means this field is unsupported\n" + +#string STR_gEfiSecurityPkgTokenSpaceGuid_PcdTpm2AcpiTableLasa_PROMPT #la= nguage en-US "The LASA of TPM2 ACPI table" + +#string STR_gEfiSecurityPkgTokenSpaceGuid_PcdTpm2AcpiTableLasa_HELP #lang= uage en-US "This PCD defines LASA of TPM2 ACPI table\n\n" + = "0 means this field is unsupported\n" --=20 2.19.2.windows.1 -=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 (#48261): https://edk2.groups.io/g/devel/message/48261 Mute This Topic: https://groups.io/mt/34330940/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- From nobody Sun May 5 11:05:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+48262+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+48262+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1569737788; cv=none; d=zoho.com; s=zohoarc; b=jgYTVPoHvYs0+z7Ygvs272PmgdiHP+1vY4uXTwbNWH2M9hkLhwcq9BVw1FaV1OOT75vZl5+hA+YGmr4rn3wkLl2HEJCz0IqlVIb07EuesxGT589Wzd3IqeG0DHv5WA9Ua1zf/fCikX7vFQfgWlrRSaGJcBKRcCrrSDViHoXe1Dw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569737788; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=PJsBFS5hSJUbqW2aafB+QaLKi70rAWWNlK3Vt0O6dGc=; b=XokqK1Rgjmo4PBUKav4IztLvoLkmeHhSlElGgyXcv4+pTv6o4meE5FAWACMFKT5PtGJreRN+ekQ0azl0jmUGhSgvFj1XL12av56+tMJq1J5A4EHm+YQOYjRnQXDwbI6/lMADXXbpP/srBPfsc+8iVmAxRrEULgpuSZCKe7wzncY= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+48262+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1569737788157911.9948817195282; Sat, 28 Sep 2019 23:16:28 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id aaaaYY1788612xaaaaaaaaaa; Sat, 28 Sep 2019 23:16:27 -0700 X-Received: from mga07.intel.com (mga07.intel.com []) by groups.io with SMTP; Sat, 28 Sep 2019 23:16:26 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Sep 2019 23:16:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,562,1559545200"; d="scan'208";a="189910290" X-Received: from jyao1-mobl2.ccr.corp.intel.com ([10.254.212.144]) by fmsmga008.fm.intel.com with ESMTP; 28 Sep 2019 23:16:25 -0700 From: "Yao, Jiewen" To: devel@edk2.groups.io Cc: Jian J Wang , Chao Zhang Subject: [edk2-devel] [PATCH 3/3] SecurityPkg/Tcg2: Add Support Laml, Lasa for TPM2 ACPI. Date: Sun, 29 Sep 2019 14:15:58 +0800 Message-Id: <20190929061558.22512-4-jiewen.yao@intel.com> In-Reply-To: <20190929061558.22512-1-jiewen.yao@intel.com> References: <20190929061558.22512-1-jiewen.yao@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,jiewen.yao@intel.com X-Gm-Message-State: aaaaaaaaaaaaaaaaaaaaaaaax1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1569737787; bh=yNKhfYVdVOrP7Bp9Ev7udu6iC/DH41w7n3J5rV5RdEA=; h=Cc:Date:From:Reply-To:Subject:To; b=V1BrU+whIrfDJDltNcm3pyk9WeV25EKqSyg0xU63TzaFRhdr9HwC/mDdfM+OsyDFqNJ O6ChI+gPO6nbidnUtiJV0tclTziqQ3TIgFDTkBfX38m9RTnkiK9LBJ6HohOtEbq2PcPWI hAUvjroxeUaZFtnGT+VZ2mnsaEniknppiZw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Tcg2Dxe produces PcdTpm2AcpiTableLaml/Lasa for event log address. Tcg2Smm consumes PcdTpm2AcpiTableLaml/Lasa to fill TPM2 ACPI table. Cc: Jian J Wang Cc: Chao Zhang Signed-off-by: Jiewen Yao Reviewed-by: Jian J Wang --- SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c | 32 +++++++++++++++++++++++------ SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf | 3 +++ SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c | 32 ++++++++++++++++++++++++++--- SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.inf | 2 ++ 4 files changed, 60 insertions(+), 9 deletions(-) diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c b/SecurityPkg/Tcg/Tcg2Dxe/Tc= g2Dxe.c index a2729457b7..85f2e0ae38 100644 --- a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c +++ b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c @@ -1467,17 +1467,37 @@ SetupEventLog ( for (Index =3D 0; Index < sizeof(mTcg2EventInfo)/sizeof(mTcg2EventInfo[0= ]); Index++) { if ((mTcgDxeData.BsCap.SupportedEventLogs & mTcg2EventInfo[Index].LogF= ormat) !=3D 0) { mTcgDxeData.EventLogAreaStruct[Index].EventLogFormat =3D mTcg2EventI= nfo[Index].LogFormat; - Status =3D gBS->AllocatePages ( - AllocateAnyPages, - EfiBootServicesData, - EFI_SIZE_TO_PAGES (PcdGet32 (PcdTcgLogAreaMinLen)), - &Lasa - ); + if (PcdGet8(PcdTpm2AcpiTableRev) >=3D 4) { + Status =3D gBS->AllocatePages ( + AllocateAnyPages, + EfiACPIMemoryNVS, + EFI_SIZE_TO_PAGES (PcdGet32 (PcdTcgLogAreaMinLen)), + &Lasa + ); + } else { + Status =3D gBS->AllocatePages ( + AllocateAnyPages, + EfiBootServicesData, + EFI_SIZE_TO_PAGES (PcdGet32 (PcdTcgLogAreaMinLen)), + &Lasa + ); + } if (EFI_ERROR (Status)) { return Status; } mTcgDxeData.EventLogAreaStruct[Index].Lasa =3D Lasa; mTcgDxeData.EventLogAreaStruct[Index].Laml =3D PcdGet32 (PcdTcgLogAr= eaMinLen); + + if ((PcdGet8(PcdTpm2AcpiTableRev) >=3D 4) || + (mTcg2EventInfo[Index].LogFormat =3D=3D EFI_TCG2_EVENT_LOG_FORMA= T_TCG_2)) { + // + // Report TCG2 event log address and length, so that they can be r= eported in TPM2 ACPI table. + // Ignore the return status, because those fields are optional. + // + PcdSet32S(PcdTpm2AcpiTableLaml, (UINT32)mTcgDxeData.EventLogAreaSt= ruct[Index].Laml); + PcdSet64S(PcdTpm2AcpiTableLasa, mTcgDxeData.EventLogAreaStruct[Ind= ex].Lasa); + } + // // To initialize them as 0xFF is recommended // because the OS can know the last entry for that. diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf b/SecurityPkg/Tcg/Tcg2Dxe/= Tcg2Dxe.inf index 9a44aadea6..c41c50a7a2 100644 --- a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf +++ b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf @@ -102,6 +102,9 @@ gEfiSecurityPkgTokenSpaceGuid.PcdTcg2NumberOfPCRBanks = ## CONSUMES gEfiSecurityPkgTokenSpaceGuid.PcdTcgLogAreaMinLen = ## CONSUMES gEfiSecurityPkgTokenSpaceGuid.PcdTcg2FinalLogAreaLen = ## CONSUMES + gEfiSecurityPkgTokenSpaceGuid.PcdTpm2AcpiTableRev = ## CONSUMES + gEfiSecurityPkgTokenSpaceGuid.PcdTpm2AcpiTableLaml = ## PRODUCES + gEfiSecurityPkgTokenSpaceGuid.PcdTpm2AcpiTableLasa = ## PRODUCES =20 [Depex] TRUE diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c b/SecurityPkg/Tcg/Tcg2Smm/Tc= g2Smm.c index a2d71741f2..14e4ed0ee1 100644 --- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c +++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c @@ -16,8 +16,24 @@ SPDX-License-Identifier: BSD-2-Clause-Patent =20 #include "Tcg2Smm.h" =20 +#pragma pack(1) =20 -EFI_TPM2_ACPI_TABLE mTpm2AcpiTemplate =3D { +typedef struct { + EFI_ACPI_DESCRIPTION_HEADER Header; + // Flags field is replaced in version 4 and above + // BIT0~15: PlatformClass This field is only valid for version = 4 and above + // BIT16~31: Reserved + UINT32 Flags; + UINT64 AddressOfControlArea; + UINT32 StartMethod; + UINT8 PlatformSpecificParameters[12]; // size up = to 12 + UINT32 Laml; // Optional + UINT64 Lasa; // Optional +} EFI_TPM2_ACPI_TABLE_V4; + +#pragma pack() + +EFI_TPM2_ACPI_TABLE_V4 mTpm2AcpiTemplate =3D { { EFI_ACPI_5_0_TRUSTED_COMPUTING_PLATFORM_2_TABLE_SIGNATURE, sizeof (mTpm2AcpiTemplate), @@ -748,6 +764,16 @@ PublishTpm2 ( DEBUG((DEBUG_INFO, "Tpm2 ACPI table PlatformClass is %d\n", (mTpm2Acpi= Template.Flags & 0x0000FFFF))); } =20 + mTpm2AcpiTemplate.Laml =3D PcdGet32(PcdTpm2AcpiTableLaml); + mTpm2AcpiTemplate.Lasa =3D PcdGet64(PcdTpm2AcpiTableLasa); + if ((mTpm2AcpiTemplate.Header.Revision < EFI_TPM2_ACPI_TABLE_REVISION_4)= || + (mTpm2AcpiTemplate.Laml =3D=3D 0) || (mTpm2AcpiTemplate.Lasa =3D=3D = 0)) { + // + // If version is smaller than 4 or Laml/Lasa is not valid, rollback to= original Length. + // + mTpm2AcpiTemplate.Header.Length =3D sizeof(EFI_TPM2_ACPI_TABLE); + } + // // Measure to PCR[0] with event EV_POST_CODE ACPI DATA // @@ -757,7 +783,7 @@ PublishTpm2 ( EV_POSTCODE_INFO_ACPI_DATA, ACPI_DATA_LEN, &mTpm2AcpiTemplate, - sizeof(mTpm2AcpiTemplate) + mTpm2AcpiTemplate.Header.Length ); =20 InterfaceType =3D PcdGet8(PcdActiveTpmInterfaceType); @@ -795,7 +821,7 @@ PublishTpm2 ( Status =3D AcpiTable->InstallAcpiTable ( AcpiTable, &mTpm2AcpiTemplate, - sizeof(mTpm2AcpiTemplate), + mTpm2AcpiTemplate.Header.Length, &TableKey ); ASSERT_EFI_ERROR (Status); diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.inf b/SecurityPkg/Tcg/Tcg2Smm/= Tcg2Smm.inf index 471342703f..e33cbcc491 100644 --- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.inf +++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.inf @@ -84,6 +84,8 @@ gEfiSecurityPkgTokenSpaceGuid.PcdTpm2CurrentIrqNum ## CONSUMES gEfiSecurityPkgTokenSpaceGuid.PcdTpm2PossibleIrqNumBuf ## CONSUMES gEfiSecurityPkgTokenSpaceGuid.PcdActiveTpmInterfaceType ## CONSUMES + gEfiSecurityPkgTokenSpaceGuid.PcdTpm2AcpiTableLaml ## CONSUMES + gEfiSecurityPkgTokenSpaceGuid.PcdTpm2AcpiTableLasa ## CONSUMES =20 [Depex] gEfiAcpiTableProtocolGuid AND --=20 2.19.2.windows.1 -=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 (#48262): https://edk2.groups.io/g/devel/message/48262 Mute This Topic: https://groups.io/mt/34330941/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-