public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] SecuritPkg: Tcg2Smm: Add PlatformClass to TPM2 Table
@ 2017-01-12  2:44 Zhang, Chao B
  2017-01-12  2:49 ` Zeng, Star
  2017-01-12  3:26 ` Yao, Jiewen
  0 siblings, 2 replies; 3+ messages in thread
From: Zhang, Chao B @ 2017-01-12  2:44 UTC (permalink / raw)
  To: edk2-devel; +Cc: jiewen.yao, star.zeng, Chao Zhang

Add PlatformClass info into TPM2 ACPI table, it is only valid with table
Rev 4 and later.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Yao Jiewen <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
---
 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/Tcg2Smm.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));
 
   //
+  // PlatformClass is only valid for version 4 and above
+  //    BIT0~15:  PlatformClass 
+  //    BIT16~31: Reserved
+  //
+  if (mTpm2AcpiTemplate.Header.Revision >= EFI_TPM2_ACPI_TABLE_REVISION_4) {
+    mTpm2AcpiTemplate.Flags = (mTpm2AcpiTemplate.Flags & 0xFFFF0000) | PcdGet8(PcdTpmPlatformClass);
+    DEBUG((DEBUG_INFO, "Tpm2 ACPI table PlatformClass is %d\n", (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               ## CONSUMES
   gEfiSecurityPkgTokenSpaceGuid.PcdTcgPhysicalPresenceInterfaceVer  ## CONSUMES
   gEfiSecurityPkgTokenSpaceGuid.PcdTpm2AcpiTableRev                 ## CONSUMES
+  gEfiSecurityPkgTokenSpaceGuid.PcdTpmPlatformClass                 ## SOMETIMES_CONSUMES
 
 [Depex]
   gEfiAcpiTableProtocolGuid AND
-- 
1.9.5.msysgit.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] SecuritPkg: Tcg2Smm: Add PlatformClass to TPM2 Table
  2017-01-12  2:44 [PATCH] SecuritPkg: Tcg2Smm: Add PlatformClass to TPM2 Table Zhang, Chao B
@ 2017-01-12  2:49 ` Zeng, Star
  2017-01-12  3:26 ` Yao, Jiewen
  1 sibling, 0 replies; 3+ messages in thread
From: Zeng, Star @ 2017-01-12  2:49 UTC (permalink / raw)
  To: Zhang, Chao B, edk2-devel@lists.01.org; +Cc: Yao, Jiewen, Zeng, Star

Reviewed-by: Star Zeng <star.zeng@intel.com>

-----Original Message-----
From: Zhang, Chao B 
Sent: Thursday, January 12, 2017 10:44 AM
To: edk2-devel@lists.01.org
Cc: Yao, Jiewen <jiewen.yao@intel.com>; Zeng, Star <star.zeng@intel.com>; Zhang, Chao B <chao.b.zhang@intel.com>
Subject: [PATCH] SecuritPkg: Tcg2Smm: Add PlatformClass to TPM2 Table

Add PlatformClass info into TPM2 ACPI table, it is only valid with table Rev 4 and later.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Yao Jiewen <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
---
 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/Tcg2Smm.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));
 
   //
+  // PlatformClass is only valid for version 4 and above
+  //    BIT0~15:  PlatformClass 
+  //    BIT16~31: Reserved
+  //
+  if (mTpm2AcpiTemplate.Header.Revision >= EFI_TPM2_ACPI_TABLE_REVISION_4) {
+    mTpm2AcpiTemplate.Flags = (mTpm2AcpiTemplate.Flags & 0xFFFF0000) | PcdGet8(PcdTpmPlatformClass);
+    DEBUG((DEBUG_INFO, "Tpm2 ACPI table PlatformClass is %d\n", 
+ (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               ## CONSUMES
   gEfiSecurityPkgTokenSpaceGuid.PcdTcgPhysicalPresenceInterfaceVer  ## CONSUMES
   gEfiSecurityPkgTokenSpaceGuid.PcdTpm2AcpiTableRev                 ## CONSUMES
+  gEfiSecurityPkgTokenSpaceGuid.PcdTpmPlatformClass                 ## SOMETIMES_CONSUMES
 
 [Depex]
   gEfiAcpiTableProtocolGuid AND
--
1.9.5.msysgit.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] SecuritPkg: Tcg2Smm: Add PlatformClass to TPM2 Table
  2017-01-12  2:44 [PATCH] SecuritPkg: Tcg2Smm: Add PlatformClass to TPM2 Table Zhang, Chao B
  2017-01-12  2:49 ` Zeng, Star
@ 2017-01-12  3:26 ` Yao, Jiewen
  1 sibling, 0 replies; 3+ messages in thread
From: Yao, Jiewen @ 2017-01-12  3:26 UTC (permalink / raw)
  To: Zhang, Chao B, edk2-devel@lists.01.org; +Cc: Zeng, Star

Reviewed-by: jiewen.yao@intel.com

> -----Original Message-----
> From: Zhang, Chao B
> Sent: Thursday, January 12, 2017 10:44 AM
> To: edk2-devel@lists.01.org
> Cc: Yao, Jiewen <jiewen.yao@intel.com>; Zeng, Star <star.zeng@intel.com>;
> Zhang, Chao B <chao.b.zhang@intel.com>
> Subject: [PATCH] SecuritPkg: Tcg2Smm: Add PlatformClass to TPM2 Table
> 
> Add PlatformClass info into TPM2 ACPI table, it is only valid with table
> Rev 4 and later.
> 
> Cc: Star Zeng <star.zeng@intel.com>
> Cc: Yao Jiewen <jiewen.yao@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
> ---
>  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/Tcg2Smm.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));
> 
>    //
> +  // PlatformClass is only valid for version 4 and above
> +  //    BIT0~15:  PlatformClass
> +  //    BIT16~31: Reserved
> +  //
> +  if (mTpm2AcpiTemplate.Header.Revision >=
> EFI_TPM2_ACPI_TABLE_REVISION_4) {
> +    mTpm2AcpiTemplate.Flags = (mTpm2AcpiTemplate.Flags & 0xFFFF0000) |
> PcdGet8(PcdTpmPlatformClass);
> +    DEBUG((DEBUG_INFO, "Tpm2 ACPI table PlatformClass is %d\n",
> (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               ##
> CONSUMES
>    gEfiSecurityPkgTokenSpaceGuid.PcdTcgPhysicalPresenceInterfaceVer  ##
> CONSUMES
>    gEfiSecurityPkgTokenSpaceGuid.PcdTpm2AcpiTableRev                 ##
> CONSUMES
> +  gEfiSecurityPkgTokenSpaceGuid.PcdTpmPlatformClass                 ##
> SOMETIMES_CONSUMES
> 
>  [Depex]
>    gEfiAcpiTableProtocolGuid AND
> --
> 1.9.5.msysgit.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-12  3:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-12  2:44 [PATCH] SecuritPkg: Tcg2Smm: Add PlatformClass to TPM2 Table Zhang, Chao B
2017-01-12  2:49 ` Zeng, Star
2017-01-12  3:26 ` Yao, Jiewen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox