public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 0/2] OvmfPkg, SecurityPkg: small followup patches after the TPM2 addition to OVMF
@ 2018-03-09 20:05 Laszlo Ersek
  2018-03-09 20:05 ` [PATCH 1/2] OvmfPkg/Tcg2ConfigPei: trivial coding style updates Laszlo Ersek
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Laszlo Ersek @ 2018-03-09 20:05 UTC (permalink / raw)
  To: edk2-devel-01
  Cc: Ard Biesheuvel, Chao Zhang, Jiewen Yao, Jordan Justen,
	Marc-André Lureau

Repo:   https://github.com/lersek/edk2.git
Branch: ovmf_tcg2_followup

The first patch brings small coding style improvements to
OvmfPkg/Tcg/Tcg2Config. The second patch trims a superfluous PPI from
SecurityPkg/Tcg/TcgPei's DEPEX.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>

Laszlo Ersek (2):
  OvmfPkg/Tcg2ConfigPei: trivial coding style updates
  SecurityPkg/TcgPei: drop PeiReadOnlyVariable from Depex

 OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf | 20 +++----
 OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c  | 55 +++++++++++---------
 SecurityPkg/Tcg/TcgPei/TcgPei.inf        |  1 -
 3 files changed, 40 insertions(+), 36 deletions(-)

-- 
2.14.1.3.gb7cf6e02401b



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

* [PATCH 1/2] OvmfPkg/Tcg2ConfigPei: trivial coding style updates
  2018-03-09 20:05 [PATCH 0/2] OvmfPkg, SecurityPkg: small followup patches after the TPM2 addition to OVMF Laszlo Ersek
@ 2018-03-09 20:05 ` Laszlo Ersek
  2018-03-09 20:05 ` [PATCH 2/2] SecurityPkg/TcgPei: drop PeiReadOnlyVariable from Depex Laszlo Ersek
  2018-03-09 23:50 ` [PATCH 0/2] OvmfPkg, SecurityPkg: small followup patches after the TPM2 addition to OVMF Jordan Justen
  2 siblings, 0 replies; 7+ messages in thread
From: Laszlo Ersek @ 2018-03-09 20:05 UTC (permalink / raw)
  To: edk2-devel-01; +Cc: Ard Biesheuvel, Jordan Justen, Marc-André Lureau

- the @file comment block should match between INF and main C file

- rewrap / refill columns to 79 characters

- insert space before opening paren

- prefix and suffix //-style comment block with empty // lines

- fix indentation of arguments in multi-line function call

- general tab spacing (indent step) is 2 in edk2, unlike QEMU's 4

No functional changes.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf | 20 +++----
 OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c  | 55 +++++++++++---------
 2 files changed, 40 insertions(+), 35 deletions(-)

diff --git a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
index 234cdd6cb40c..8c2d5863ea6c 100644
--- a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
+++ b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
@@ -1,20 +1,20 @@
 ## @file
-#  Set TPM device type
+# Set TPM device type
 #
-#  In SecurityPkg, this module initializes the TPM device type based on
-#  a UEFI variable and/or hardware detection. In OvmfPkg, the module
-#  only performs TPM2 hardware detection.
+# In SecurityPkg, this module initializes the TPM device type based on a UEFI
+# variable and/or hardware detection. In OvmfPkg, the module only performs TPM2
+# hardware detection.
 #
 # Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
 # Copyright (C) 2018, Red Hat, Inc.
 #
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
+# This program and the accompanying materials are licensed and made available
+# under the terms and conditions of the BSD License which accompanies this
+# distribution. The full text of the license may be found at
 # http://opensource.org/licenses/bsd-license.php
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
+# WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 ##
 
 [Defines]
@@ -40,7 +40,7 @@ [LibraryClasses]
   Tpm2DeviceLib
 
 [Guids]
-  gEfiTpmDeviceSelectedGuid           ## PRODUCES             ## GUID    # Used as a PPI GUID
+  gEfiTpmDeviceSelectedGuid           ## PRODUCES ## GUID # Used as a PPI GUID
   gEfiTpmDeviceInstanceTpm20DtpmGuid  ## SOMETIMES_CONSUMES
 
 [Ppis]
diff --git a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c
index 8bee1926b3c4..0befc6c54c87 100644
--- a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c
+++ b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c
@@ -1,17 +1,20 @@
 /** @file
-  The module entry point for Tcg2 configuration module.
+  Set TPM device type
 
-Copyright (c) 2018, Red Hat, Inc.
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+  In SecurityPkg, this module initializes the TPM device type based on a UEFI
+  variable and/or hardware detection. In OvmfPkg, the module only performs TPM2
+  hardware detection.
 
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution.  The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
+  Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+  Copyright (C) 2018, Red Hat, Inc.
 
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+  This program and the accompanying materials are licensed and made available
+  under the terms and conditions of the BSD License which accompanies this
+  distribution. The full text of the license may be found at
+  http://opensource.org/licenses/bsd-license.php
 
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
+  WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 **/
 
 
@@ -55,23 +58,25 @@ Tcg2ConfigPeimEntryPoint (
 
   Status = Tpm2RequestUseTpm ();
   if (!EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_INFO, "%a: TPM2 detected\n", __FUNCTION__));
-      Size = sizeof(gEfiTpmDeviceInstanceTpm20DtpmGuid);
-      Status = PcdSetPtrS (
-          PcdTpmInstanceGuid,
-          &Size,
-          &gEfiTpmDeviceInstanceTpm20DtpmGuid
-          );
-      ASSERT_EFI_ERROR (Status);
+    DEBUG ((DEBUG_INFO, "%a: TPM2 detected\n", __FUNCTION__));
+    Size = sizeof (gEfiTpmDeviceInstanceTpm20DtpmGuid);
+    Status = PcdSetPtrS (
+               PcdTpmInstanceGuid,
+               &Size,
+               &gEfiTpmDeviceInstanceTpm20DtpmGuid
+               );
+    ASSERT_EFI_ERROR (Status);
   } else {
-      DEBUG ((DEBUG_INFO, "%a: no TPM2 detected\n", __FUNCTION__));
-      // If no TPM2 was detected, we still need to install
-      // TpmInitializationDonePpi. Namely, Tcg2Pei will exit early upon
-      // seeing the default (all-bits-zero) contents of
-      // PcdTpmInstanceGuid, thus we have to install the PPI in its place,
-      // in order to unblock any dependent PEIMs.
-      Status = PeiServicesInstallPpi (&mTpmInitializationDonePpiList);
-      ASSERT_EFI_ERROR (Status);
+    DEBUG ((DEBUG_INFO, "%a: no TPM2 detected\n", __FUNCTION__));
+    //
+    // If no TPM2 was detected, we still need to install
+    // TpmInitializationDonePpi. Namely, Tcg2Pei will exit early upon seeing
+    // the default (all-bits-zero) contents of PcdTpmInstanceGuid, thus we have
+    // to install the PPI in its place, in order to unblock any dependent
+    // PEIMs.
+    //
+    Status = PeiServicesInstallPpi (&mTpmInitializationDonePpiList);
+    ASSERT_EFI_ERROR (Status);
   }
 
   //
-- 
2.14.1.3.gb7cf6e02401b




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

* [PATCH 2/2] SecurityPkg/TcgPei: drop PeiReadOnlyVariable from Depex
  2018-03-09 20:05 [PATCH 0/2] OvmfPkg, SecurityPkg: small followup patches after the TPM2 addition to OVMF Laszlo Ersek
  2018-03-09 20:05 ` [PATCH 1/2] OvmfPkg/Tcg2ConfigPei: trivial coding style updates Laszlo Ersek
@ 2018-03-09 20:05 ` Laszlo Ersek
  2018-03-09 23:12   ` Yao, Jiewen
  2018-03-13  1:20   ` Zhang, Chao B
  2018-03-09 23:50 ` [PATCH 0/2] OvmfPkg, SecurityPkg: small followup patches after the TPM2 addition to OVMF Jordan Justen
  2 siblings, 2 replies; 7+ messages in thread
From: Laszlo Ersek @ 2018-03-09 20:05 UTC (permalink / raw)
  To: edk2-devel-01; +Cc: Chao Zhang, Jiewen Yao

TcgPei doesn't actually use the PEI-phase read-only variable service, so
drop that from the Depex.

This patch was inspired by commit ab9e11da6651 ("SecurityPkg/Tcg2Pei: drop
PeiReadOnlyVariable from Depex", 2018-03-09).

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Suggested-by: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 SecurityPkg/Tcg/TcgPei/TcgPei.inf | 1 -
 1 file changed, 1 deletion(-)

diff --git a/SecurityPkg/Tcg/TcgPei/TcgPei.inf b/SecurityPkg/Tcg/TcgPei/TcgPei.inf
index 9a44d8fbda51..57ce7263e909 100644
--- a/SecurityPkg/Tcg/TcgPei/TcgPei.inf
+++ b/SecurityPkg/Tcg/TcgPei/TcgPei.inf
@@ -85,7 +85,6 @@ [Pcd]
 
 [Depex]
   gEfiPeiMasterBootModePpiGuid AND
-  gEfiPeiReadOnlyVariable2PpiGuid AND
   gEfiTpmDeviceSelectedGuid
 
 [UserExtensions.TianoCore."ExtraFiles"]
-- 
2.14.1.3.gb7cf6e02401b



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

* Re: [PATCH 2/2] SecurityPkg/TcgPei: drop PeiReadOnlyVariable from Depex
  2018-03-09 20:05 ` [PATCH 2/2] SecurityPkg/TcgPei: drop PeiReadOnlyVariable from Depex Laszlo Ersek
@ 2018-03-09 23:12   ` Yao, Jiewen
  2018-03-13  1:20   ` Zhang, Chao B
  1 sibling, 0 replies; 7+ messages in thread
From: Yao, Jiewen @ 2018-03-09 23:12 UTC (permalink / raw)
  To: Laszlo Ersek; +Cc: edk2-devel-01, Zhang, Chao B

reviewed by: jiewen.yao@intel.com

thank you!
Yao, Jiewen


> 在 2018年3月10日,上午4:05,Laszlo Ersek <lersek@redhat.com> 写道:
> 
> TcgPei doesn't actually use the PEI-phase read-only variable service, so
> drop that from the Depex.
> 
> This patch was inspired by commit ab9e11da6651 ("SecurityPkg/Tcg2Pei: drop
> PeiReadOnlyVariable from Depex", 2018-03-09).
> 
> Cc: Chao Zhang <chao.b.zhang@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Suggested-by: Chao Zhang <chao.b.zhang@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
> SecurityPkg/Tcg/TcgPei/TcgPei.inf | 1 -
> 1 file changed, 1 deletion(-)
> 
> diff --git a/SecurityPkg/Tcg/TcgPei/TcgPei.inf b/SecurityPkg/Tcg/TcgPei/TcgPei.inf
> index 9a44d8fbda51..57ce7263e909 100644
> --- a/SecurityPkg/Tcg/TcgPei/TcgPei.inf
> +++ b/SecurityPkg/Tcg/TcgPei/TcgPei.inf
> @@ -85,7 +85,6 @@ [Pcd]
> 
> [Depex]
>   gEfiPeiMasterBootModePpiGuid AND
> -  gEfiPeiReadOnlyVariable2PpiGuid AND
>   gEfiTpmDeviceSelectedGuid
> 
> [UserExtensions.TianoCore."ExtraFiles"]
> -- 
> 2.14.1.3.gb7cf6e02401b
> 

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

* Re: [PATCH 0/2] OvmfPkg, SecurityPkg: small followup patches after the TPM2 addition to OVMF
  2018-03-09 20:05 [PATCH 0/2] OvmfPkg, SecurityPkg: small followup patches after the TPM2 addition to OVMF Laszlo Ersek
  2018-03-09 20:05 ` [PATCH 1/2] OvmfPkg/Tcg2ConfigPei: trivial coding style updates Laszlo Ersek
  2018-03-09 20:05 ` [PATCH 2/2] SecurityPkg/TcgPei: drop PeiReadOnlyVariable from Depex Laszlo Ersek
@ 2018-03-09 23:50 ` Jordan Justen
  2018-03-10 15:34   ` Laszlo Ersek
  2 siblings, 1 reply; 7+ messages in thread
From: Jordan Justen @ 2018-03-09 23:50 UTC (permalink / raw)
  To: Laszlo Ersek, edk2-devel-01
  Cc: Ard Biesheuvel, Chao Zhang, Jiewen Yao, Marc-André Lureau

Series Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

On 2018-03-09 12:05:23, Laszlo Ersek wrote:
> Repo:   https://github.com/lersek/edk2.git
> Branch: ovmf_tcg2_followup
> 
> The first patch brings small coding style improvements to
> OvmfPkg/Tcg/Tcg2Config. The second patch trims a superfluous PPI from
> SecurityPkg/Tcg/TcgPei's DEPEX.
> 
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Chao Zhang <chao.b.zhang@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Laszlo Ersek (2):
>   OvmfPkg/Tcg2ConfigPei: trivial coding style updates
>   SecurityPkg/TcgPei: drop PeiReadOnlyVariable from Depex
> 
>  OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf | 20 +++----
>  OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c  | 55 +++++++++++---------
>  SecurityPkg/Tcg/TcgPei/TcgPei.inf        |  1 -
>  3 files changed, 40 insertions(+), 36 deletions(-)
> 
> -- 
> 2.14.1.3.gb7cf6e02401b
> 


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

* Re: [PATCH 0/2] OvmfPkg, SecurityPkg: small followup patches after the TPM2 addition to OVMF
  2018-03-09 23:50 ` [PATCH 0/2] OvmfPkg, SecurityPkg: small followup patches after the TPM2 addition to OVMF Jordan Justen
@ 2018-03-10 15:34   ` Laszlo Ersek
  0 siblings, 0 replies; 7+ messages in thread
From: Laszlo Ersek @ 2018-03-10 15:34 UTC (permalink / raw)
  To: Jordan Justen, edk2-devel-01; +Cc: Jiewen Yao, Chao Zhang, Ard Biesheuvel

On 03/10/18 00:50, Jordan Justen wrote:
> Series Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

Thanks! :)

Commit range e4a1d5a7c4e4..7548947d040e.

Thank you Jiewen as well,
Laszlo

> On 2018-03-09 12:05:23, Laszlo Ersek wrote:
>> Repo:   https://github.com/lersek/edk2.git
>> Branch: ovmf_tcg2_followup
>>
>> The first patch brings small coding style improvements to
>> OvmfPkg/Tcg/Tcg2Config. The second patch trims a superfluous PPI from
>> SecurityPkg/Tcg/TcgPei's DEPEX.
>>
>> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> Cc: Chao Zhang <chao.b.zhang@intel.com>
>> Cc: Jiewen Yao <jiewen.yao@intel.com>
>> Cc: Jordan Justen <jordan.l.justen@intel.com>
>> Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
>>
>> Laszlo Ersek (2):
>>   OvmfPkg/Tcg2ConfigPei: trivial coding style updates
>>   SecurityPkg/TcgPei: drop PeiReadOnlyVariable from Depex
>>
>>  OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf | 20 +++----
>>  OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c  | 55 +++++++++++---------
>>  SecurityPkg/Tcg/TcgPei/TcgPei.inf        |  1 -
>>  3 files changed, 40 insertions(+), 36 deletions(-)
>>
>> -- 
>> 2.14.1.3.gb7cf6e02401b
>>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
> 



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

* Re: [PATCH 2/2] SecurityPkg/TcgPei: drop PeiReadOnlyVariable from Depex
  2018-03-09 20:05 ` [PATCH 2/2] SecurityPkg/TcgPei: drop PeiReadOnlyVariable from Depex Laszlo Ersek
  2018-03-09 23:12   ` Yao, Jiewen
@ 2018-03-13  1:20   ` Zhang, Chao B
  1 sibling, 0 replies; 7+ messages in thread
From: Zhang, Chao B @ 2018-03-13  1:20 UTC (permalink / raw)
  To: Laszlo Ersek, edk2-devel-01; +Cc: Yao, Jiewen

Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>

-----Original Message-----
From: Laszlo Ersek [mailto:lersek@redhat.com] 
Sent: Saturday, March 10, 2018 4:05 AM
To: edk2-devel-01 <edk2-devel@lists.01.org>
Cc: Zhang, Chao B <chao.b.zhang@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>
Subject: [PATCH 2/2] SecurityPkg/TcgPei: drop PeiReadOnlyVariable from Depex

TcgPei doesn't actually use the PEI-phase read-only variable service, so drop that from the Depex.

This patch was inspired by commit ab9e11da6651 ("SecurityPkg/Tcg2Pei: drop PeiReadOnlyVariable from Depex", 2018-03-09).

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Suggested-by: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 SecurityPkg/Tcg/TcgPei/TcgPei.inf | 1 -
 1 file changed, 1 deletion(-)

diff --git a/SecurityPkg/Tcg/TcgPei/TcgPei.inf b/SecurityPkg/Tcg/TcgPei/TcgPei.inf
index 9a44d8fbda51..57ce7263e909 100644
--- a/SecurityPkg/Tcg/TcgPei/TcgPei.inf
+++ b/SecurityPkg/Tcg/TcgPei/TcgPei.inf
@@ -85,7 +85,6 @@ [Pcd]
 
 [Depex]
   gEfiPeiMasterBootModePpiGuid AND
-  gEfiPeiReadOnlyVariable2PpiGuid AND
   gEfiTpmDeviceSelectedGuid
 
 [UserExtensions.TianoCore."ExtraFiles"]
--
2.14.1.3.gb7cf6e02401b



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

end of thread, other threads:[~2018-03-13  1:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-09 20:05 [PATCH 0/2] OvmfPkg, SecurityPkg: small followup patches after the TPM2 addition to OVMF Laszlo Ersek
2018-03-09 20:05 ` [PATCH 1/2] OvmfPkg/Tcg2ConfigPei: trivial coding style updates Laszlo Ersek
2018-03-09 20:05 ` [PATCH 2/2] SecurityPkg/TcgPei: drop PeiReadOnlyVariable from Depex Laszlo Ersek
2018-03-09 23:12   ` Yao, Jiewen
2018-03-13  1:20   ` Zhang, Chao B
2018-03-09 23:50 ` [PATCH 0/2] OvmfPkg, SecurityPkg: small followup patches after the TPM2 addition to OVMF Jordan Justen
2018-03-10 15:34   ` Laszlo Ersek

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