From: "Wang, Jian J" <jian.j.wang@intel.com>
To: "Gao, Liming" <liming.gao@intel.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Zhang, Chao B" <chao.b.zhang@intel.com>
Subject: Re: [Patch v2] SecurityPkg Tcg2Config: Move common definitions to new Tcg2Internal.h
Date: Mon, 16 Sep 2019 05:57:29 +0000 [thread overview]
Message-ID: <D827630B58408649ACB04F44C510003625979CDF@SHSMSX107.ccr.corp.intel.com> (raw)
In-Reply-To: <1568268405-780-1-git-send-email-liming.gao@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
> -----Original Message-----
> From: Gao, Liming
> Sent: Thursday, September 12, 2019 2:07 PM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J <jian.j.wang@intel.com>; Zhang, Chao B
> <chao.b.zhang@intel.com>
> Subject: [Patch v2] SecurityPkg Tcg2Config: Move common definitions to new
> Tcg2Internal.h
>
> Common definitions are not consumed by VFR. They are not required to be
> defined in Tcg2ConfigNvData.h with WA way. New shared internal header
> file is added to include those common definitions.
>
> Cc: Jian Wang <jian.j.wang@intel.com>
> Cc: Chao Zhang <chao.b.zhang@intel.com>
> Signed-off-by: Liming Gao <liming.gao@intel.com>
> ---
> In V2:
> Keep struct TCG2_DEVICE_DETECTION in Tcg2ConfigNvData.h.
> Only remove BUGBUG definition.
>
> SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c | 1 +
> SecurityPkg/Tcg/Tcg2Config/TpmDetection.c | 1 +
> SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDxe.inf | 1 +
> SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.h | 3 +++
> SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigNvData.h | 35 ---------------------------
> SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf | 1 +
> SecurityPkg/Tcg/Tcg2Config/Tcg2Internal.h | 26 ++++++++++++++++++++
> 7 files changed, 33 insertions(+), 35 deletions(-)
> create mode 100644 SecurityPkg/Tcg/Tcg2Config/Tcg2Internal.h
>
> diff --git a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c
> b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c
> index a50a128766..a15919685e 100644
> --- a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c
> +++ b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c
> @@ -23,6 +23,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> #include <Protocol/Tcg2Protocol.h>
>
> #include "Tcg2ConfigNvData.h"
> +#include "Tcg2Internal.h"
>
> TPM_INSTANCE_ID mTpmInstanceId[] = TPM_INSTANCE_ID_LIST;
>
> diff --git a/SecurityPkg/Tcg/Tcg2Config/TpmDetection.c
> b/SecurityPkg/Tcg/Tcg2Config/TpmDetection.c
> index 2f220c6c90..eeaadc5e2f 100644
> --- a/SecurityPkg/Tcg/Tcg2Config/TpmDetection.c
> +++ b/SecurityPkg/Tcg/Tcg2Config/TpmDetection.c
> @@ -20,6 +20,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> #include <IndustryStandard/Tpm12.h>
>
> #include "Tcg2ConfigNvData.h"
> +#include "Tcg2Internal.h"
>
> /**
> This routine check both SetupVariable and real TPM device, and return final
> TpmDevice configuration.
> diff --git a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDxe.inf
> b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDxe.inf
> index 866e47d23e..6417ab82a1 100644
> --- a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDxe.inf
> +++ b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDxe.inf
> @@ -30,6 +30,7 @@
> Tcg2Config.vfr
> Tcg2ConfigStrings.uni
> Tcg2ConfigNvData.h
> + Tcg2Internal.h
>
> [Packages]
> MdePkg/MdePkg.dec
> diff --git a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.h
> b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.h
> index 4b0e18dfbb..af542d52ef 100644
> --- a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.h
> +++ b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.h
> @@ -36,6 +36,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> #include <Guid/MdeModuleHii.h>
>
> #include "Tcg2ConfigNvData.h"
> +#include "Tcg2Internal.h"
> +
> +#define TCG2_PROTOCOL_VERSION_DEFAULT 0x0001
>
> //
> // Tool generated IFR binary data and String package data
> diff --git a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigNvData.h
> b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigNvData.h
> index d0a124684f..a91c052850 100644
> --- a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigNvData.h
> +++ b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigNvData.h
> @@ -13,15 +13,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> #include <Guid/Tcg2ConfigHii.h>
> #include <IndustryStandard/TcgPhysicalPresence.h>
>
> -//
> -// BUGBUG: In order to pass VfrCompiler, we have to redefine below MACRO,
> which already in <Protocol/Tcg2Protocol.h>.
> -//
> -#ifndef __TCG2_H__
> -#define EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2 0x00000001
> -#define EFI_TCG2_EVENT_LOG_FORMAT_TCG_2 0x00000002
> -#endif
> -#define EFI_TCG2_EVENT_LOG_FORMAT_ALL
> (EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2 |
> EFI_TCG2_EVENT_LOG_FORMAT_TCG_2)
> -
> #define TCG2_CONFIGURATION_VARSTORE_ID 0x0001
> #define TCG2_CONFIGURATION_INFO_VARSTORE_ID 0x0002
> #define TCG2_VERSION_VARSTORE_ID 0x0003
> @@ -55,9 +46,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> #define TPM_DEVICE_INTERFACE_MAX TPM_DEVICE_INTERFACE_PTP_FIFO
> #define TPM_DEVICE_INTERFACE_DEFAULT
> TPM_DEVICE_INTERFACE_PTP_CRB
>
> -#define TCG2_PROTOCOL_VERSION_DEFAULT 0x0001
> -#define EFI_TCG2_EVENT_LOG_FORMAT_DEFAULT
> EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2
> -
> #define TCG2_PPI_VERSION_1_2 0x322E31 // "1.2"
> #define TCG2_PPI_VERSION_1_3 0x332E31 // "1.3"
>
> @@ -97,27 +85,4 @@ typedef struct {
> #define TCG2_DEVICE_DETECTION_NAME L"TCG2_DEVICE_DETECTION"
> #define TCG2_VERSION_NAME L"TCG2_VERSION"
>
> -#define TPM_INSTANCE_ID_LIST { \
> - {TPM_DEVICE_INTERFACE_NONE, TPM_DEVICE_NULL}, \
> - {TPM_DEVICE_INTERFACE_TPM12, TPM_DEVICE_1_2}, \
> - {TPM_DEVICE_INTERFACE_TPM20_DTPM, TPM_DEVICE_2_0_DTPM}, \
> -}
> -
> -//
> -// BUGBUG: In order to pass VfrCompiler, we have to redefine GUID here.
> -//
> -#ifndef __BASE_H__
> -typedef struct {
> - UINT32 Data1;
> - UINT16 Data2;
> - UINT16 Data3;
> - UINT8 Data4[8];
> -} GUID;
> -#endif
> -
> -typedef struct {
> - GUID TpmInstanceGuid;
> - UINT8 TpmDevice;
> -} TPM_INSTANCE_ID;
> -
> #endif
> diff --git a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
> b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
> index 837cbd12f0..f2aa3234ad 100644
> --- a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
> +++ b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
> @@ -28,6 +28,7 @@
> [Sources]
> Tcg2ConfigPeim.c
> Tcg2ConfigNvData.h
> + Tcg2Internal.h
> TpmDetection.c
>
> [Packages]
> diff --git a/SecurityPkg/Tcg/Tcg2Config/Tcg2Internal.h
> b/SecurityPkg/Tcg/Tcg2Config/Tcg2Internal.h
> new file mode 100644
> index 0000000000..6ed1015ef2
> --- /dev/null
> +++ b/SecurityPkg/Tcg/Tcg2Config/Tcg2Internal.h
> @@ -0,0 +1,26 @@
> +/** @file
> + The internal header file defines the common structures for PEI and DXE
> modules.
> +
> +Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
> +SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef __TCG2_INTERNAL_H__
> +#define __TCG2_INTERNAL_H__
> +
> +#define EFI_TCG2_EVENT_LOG_FORMAT_DEFAULT
> EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2
> +#define EFI_TCG2_EVENT_LOG_FORMAT_ALL
> (EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2 |
> EFI_TCG2_EVENT_LOG_FORMAT_TCG_2)
> +
> +#define TPM_INSTANCE_ID_LIST { \
> + {TPM_DEVICE_INTERFACE_NONE, TPM_DEVICE_NULL}, \
> + {TPM_DEVICE_INTERFACE_TPM12, TPM_DEVICE_1_2}, \
> + {TPM_DEVICE_INTERFACE_TPM20_DTPM, TPM_DEVICE_2_0_DTPM}, \
> +}
> +
> +typedef struct {
> + GUID TpmInstanceGuid;
> + UINT8 TpmDevice;
> +} TPM_INSTANCE_ID;
> +
> +#endif
> --
> 2.13.0.windows.1
next prev parent reply other threads:[~2019-09-16 5:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-12 6:06 [Patch v2] SecurityPkg Tcg2Config: Move common definitions to new Tcg2Internal.h Liming Gao
2019-09-16 5:57 ` Wang, Jian J [this message]
2019-09-17 1:28 ` Zhang, Chao B
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=D827630B58408649ACB04F44C510003625979CDF@SHSMSX107.ccr.corp.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox