From nobody Tue Apr 23 19:18:03 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+47042+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+47042+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1568040965; cv=none; d=zoho.com; s=zohoarc; b=DnzwZRGxLhMTcC1vwyqAcmwth40zjO4EoZ0pXWox1b6YkIr8f6iDuFFqQHFpC0RkbrqQ0B2kWKWfd3zLI3CkcwJwDsESwwPlUX+DCbIyh826AeKCA8TOvYnxzucR/mBYwqIXMcJn3evIt8u2OHdhtWOefsFu1xTyLxNyAkFRUvY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568040965; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To:ARC-Authentication-Results; bh=5q5IsUL94CZ+3RARd2OJMFYx85JqNppgxr15QmETD4Q=; b=RZxWhoZlsee7zlM3RwV0n+QR3VySM0Xj9cEoj70wqfW0wei2FexOxyOdDbckjkMC+eVDBr+E4u484VzZ9gOI32MW2NDbmXFVefVyXxYll9FMByUbhIBb4eI4A2HutyCia1bCSQ7rw+5OTbyA4I0IcY8MkHfaPCPH1WBsk5c5fHY= 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+47042+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 1568040965092356.51169689953076; Mon, 9 Sep 2019 07:56:05 -0700 (PDT) Return-Path: X-Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by groups.io with SMTP; Mon, 09 Sep 2019 07:56:03 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Sep 2019 07:56:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,486,1559545200"; d="scan'208";a="268097718" X-Received: from lgao4-mobl1.ccr.corp.intel.com ([10.249.170.140]) by orsmga001.jf.intel.com with ESMTP; 09 Sep 2019 07:56:01 -0700 From: "Liming Gao" To: devel@edk2.groups.io Cc: Jian Wang , Chao Zhang Subject: [edk2-devel] [Patch] SecurityPkg Tcg2Config: Move common definitions to new Tcg2Internal.h Date: Mon, 9 Sep 2019 22:55:54 +0800 Message-Id: <20190909145554.14200-1-liming.gao@intel.com> 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,liming.gao@intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1568040964; bh=lHwrqyhJn31BkMu4eb4RkyvSqgBxW+UmNaWtix4Y4c0=; h=Cc:Date:From:Reply-To:Subject:To; b=W329QXdhVcW6xbt7uzhCLAJdNEF4zRr6XM9/mwhiwyrikygxbGMneduIGD0yyU7O7T2 WebgcGT9vdIOBVekIq3UI4RoK9vSAzp2TAyLzVO0Tswa2vNVLA6WIFV1UYi5JzDS7spSz zqMG74c0TINdUFFVMUMAfu+0LO1GumxsHvA= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2178 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 Cc: Chao Zhang Signed-off-by: Liming Gao --- 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 | 48 -----------------------= ---- SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf | 1 + SecurityPkg/Tcg/Tcg2Config/Tcg2Internal.h | 39 ++++++++++++++++++++++ 7 files changed, 46 insertions(+), 48 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 =20 #include "Tcg2ConfigNvData.h" +#include "Tcg2Internal.h" =20 TPM_INSTANCE_ID mTpmInstanceId[] =3D TPM_INSTANCE_ID_LIST; =20 diff --git a/SecurityPkg/Tcg/Tcg2Config/TpmDetection.c b/SecurityPkg/Tcg/Tc= g2Config/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 =20 #include "Tcg2ConfigNvData.h" +#include "Tcg2Internal.h" =20 /** This routine check both SetupVariable and real TPM device, and return fi= nal 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 =20 [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 =20 #include "Tcg2ConfigNvData.h" +#include "Tcg2Internal.h" + +#define TCG2_PROTOCOL_VERSION_DEFAULT 0x0001 =20 // // Tool generated IFR binary data and String package data diff --git a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigNvData.h b/SecurityPkg/Tc= g/Tcg2Config/Tcg2ConfigNvData.h index d0a124684f..cfc9872611 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 #include =20 -// -// BUGBUG: In order to pass VfrCompiler, we have to redefine below MACRO, = which already in . -// -#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 =20 -#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" =20 @@ -84,40 +72,4 @@ typedef struct { BOOLEAN TpmDeviceInterfacePtpCrbSupported; } TCG2_CONFIGURATION_INFO; =20 -// -// Variable saved for S3, TPM detected, only valid in S3 path. -// This variable is ReadOnly. -// -typedef struct { - UINT8 TpmDeviceDetected; -} TCG2_DEVICE_DETECTION; - -#define TCG2_STORAGE_NAME L"TCG2_CONFIGURATION" -#define TCG2_STORAGE_INFO_NAME L"TCG2_CONFIGURATION_INFO" -#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 =20 [Packages] diff --git a/SecurityPkg/Tcg/Tcg2Config/Tcg2Internal.h b/SecurityPkg/Tcg/Tc= g2Config/Tcg2Internal.h new file mode 100644 index 0000000000..f21773bd25 --- /dev/null +++ b/SecurityPkg/Tcg/Tcg2Config/Tcg2Internal.h @@ -0,0 +1,39 @@ +/** @file + The internal header file defines the common structures for PEI and DXE m= odules. + +Copyright (c) 2019, Intel Corporation. All rights reserved.
+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_TC= G_1_2 | EFI_TCG2_EVENT_LOG_FORMAT_TCG_2) + +// +// Variable saved for S3, TPM detected, only valid in S3 path. +// This variable is ReadOnly. +// +typedef struct { + UINT8 TpmDeviceDetected; +} TCG2_DEVICE_DETECTION; + +#define TCG2_STORAGE_NAME L"TCG2_CONFIGURATION" +#define TCG2_STORAGE_INFO_NAME L"TCG2_CONFIGURATION_INFO" +#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}, \ +} + +typedef struct { + GUID TpmInstanceGuid; + UINT8 TpmDevice; +} TPM_INSTANCE_ID; + +#endif --=20 2.13.0.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 (#47042): https://edk2.groups.io/g/devel/message/47042 Mute This Topic: https://groups.io/mt/34080790/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-