From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 374F981BCF for ; Wed, 11 Jan 2017 18:49:48 -0800 (PST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP; 11 Jan 2017 18:49:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,348,1477983600"; d="scan'208";a="52860837" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga006.fm.intel.com with ESMTP; 11 Jan 2017 18:49:48 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 11 Jan 2017 18:49:47 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.204]) with mapi id 14.03.0248.002; Thu, 12 Jan 2017 10:49:45 +0800 From: "Zeng, Star" To: "Zhang, Chao B" , "edk2-devel@lists.01.org" CC: "Yao, Jiewen" , "Zeng, Star" Thread-Topic: [PATCH] SecuritPkg: Tcg2Smm: Add PlatformClass to TPM2 Table Thread-Index: AQHSbH3HGLPaphqFGUGfd3giA6+zlqE0I/7Q Date: Thu, 12 Jan 2017 02:49:43 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103B8160A7@shsmsx102.ccr.corp.intel.com> References: <20170112024414.21444-1-chao.b.zhang@intel.com> In-Reply-To: <20170112024414.21444-1-chao.b.zhang@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] SecuritPkg: Tcg2Smm: Add PlatformClass to TPM2 Table X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 02:49:48 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Star Zeng -----Original Message----- From: Zhang, Chao B=20 Sent: Thursday, January 12, 2017 10:44 AM To: edk2-devel@lists.01.org Cc: Yao, Jiewen ; Zeng, Star ; Z= hang, Chao B Subject: [PATCH] SecuritPkg: Tcg2Smm: Add PlatformClass to TPM2 Table Add PlatformClass info into TPM2 ACPI table, it is only valid with table Re= v 4 and later. Cc: Star Zeng Cc: Yao Jiewen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chao Zhang --- SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c | 10 ++++++++++ SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.inf | 1 + 2 files changed, 11 insertions(+) diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c b/SecurityPkg/Tcg/Tcg2Smm/Tc= g2Smm.c index 0c3b19c..5a1fd3e 100644 --- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c +++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c @@ -513,6 +513,16 @@ PublishTpm2 ( DEBUG((DEBUG_INFO, "Tpm2 ACPI table revision is %d\n", mTpm2AcpiTemplate= .Header.Revision)); =20 // + // PlatformClass is only valid for version 4 and above + // BIT0~15: PlatformClass=20 + // BIT16~31: Reserved + // + if (mTpm2AcpiTemplate.Header.Revision >=3D EFI_TPM2_ACPI_TABLE_REVISION_= 4) { + mTpm2AcpiTemplate.Flags =3D (mTpm2AcpiTemplate.Flags & 0xFFFF0000) | P= cdGet8(PcdTpmPlatformClass); + DEBUG((DEBUG_INFO, "Tpm2 ACPI table PlatformClass is %d\n",=20 + (mTpm2AcpiTemplate.Flags & 0x0000FFFF))); } + + // // Measure to PCR[0] with event EV_POST_CODE ACPI DATA // TpmMeasureAndLogData( diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.inf b/SecurityPkg/Tcg/Tcg2Smm/= Tcg2Smm.inf index 2793242..7018474 100644 --- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.inf +++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.inf @@ -74,6 +74,7 @@ gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress ## CONSUME= S gEfiSecurityPkgTokenSpaceGuid.PcdTcgPhysicalPresenceInterfaceVer ## CON= SUMES gEfiSecurityPkgTokenSpaceGuid.PcdTpm2AcpiTableRev ## CON= SUMES + gEfiSecurityPkgTokenSpaceGuid.PcdTpmPlatformClass ## SOM= ETIMES_CONSUMES =20 [Depex] gEfiAcpiTableProtocolGuid AND -- 1.9.5.msysgit.1