From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web10.10309.1576765675073078937 for ; Thu, 19 Dec 2019 06:27:55 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: liming.gao@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Dec 2019 06:27:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,332,1571727600"; d="scan'208";a="213021821" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga007.fm.intel.com with ESMTP; 19 Dec 2019 06:27:54 -0800 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 19 Dec 2019 06:27:53 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 19 Dec 2019 06:27:53 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.90]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.214]) with mapi id 14.03.0439.000; Thu, 19 Dec 2019 22:27:51 +0800 From: "Liming Gao" To: "devel@edk2.groups.io" , "Yao, Jiewen" CC: "Kinney, Michael D" Subject: Re: [edk2-devel] [PATCH] MdePkg/Tcg: Add new definition in TCG PFP spec. Thread-Topic: [edk2-devel] [PATCH] MdePkg/Tcg: Add new definition in TCG PFP spec. Thread-Index: AQHVtXMsrKJGrPS4i0ihC5bJKeBS56fBBrSA Date: Thu, 19 Dec 2019 14:27:50 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E5685DB@SHSMSX104.ccr.corp.intel.com> References: <20191218071700.20588-1-jiewen.yao@intel.com> In-Reply-To: <20191218071700.20588-1-jiewen.yao@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZGI4NGI3YTEtNmYwMy00Mjk5LWFiZDItNzM3Y2ZmZDUyNmUzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiREJMN0FhZnhjQWhrWFVCUThTMkVXS1RBSTAra2ZrdnMxOFNGZ0xEVTdaWGJrellOb1FsU1I0VmQ2WFpUNElZYSJ9 dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: liming.gao@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Jiewen: I see this patch removes some old definitions. Is there any impact on thi= s change? Thanks Liming > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Yao, Jiew= en > Sent: Wednesday, December 18, 2019 3:17 PM > To: devel@edk2.groups.io > Cc: Kinney, Michael D ; Gao, Liming > Subject: [edk2-devel] [PATCH] MdePkg/Tcg: Add new definition in TCG PFP = spec. >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2428 >=20 > The latest TCG PFP specification (TCG PC Client Platform Firmware Profil= e > Specification, Revision 1.05) added new data structure. For example, > the SPDM device measurement. This patch adds the new content. >=20 > Cc: Michael D Kinney > Cc: Liming Gao > Signed-off-by: Jiewen Yao > --- > .../IndustryStandard/UefiTcgPlatform.h | 182 +++++++++++++++++- > 1 file changed, 173 insertions(+), 9 deletions(-) >=20 > diff --git a/MdePkg/Include/IndustryStandard/UefiTcgPlatform.h b/MdePkg/= Include/IndustryStandard/UefiTcgPlatform.h > index 3f1d444aed..84023c4347 100644 > --- a/MdePkg/Include/IndustryStandard/UefiTcgPlatform.h > +++ b/MdePkg/Include/IndustryStandard/UefiTcgPlatform.h > @@ -1,7 +1,8 @@ > /** @file > - TCG EFI Platform Definition in TCG_EFI_Platform_1_20_Final > + TCG EFI Platform Definition in TCG_EFI_Platform_1_20_Final and > + TCG PC Client Platform Firmware Profile Specification, Revision 1.05 >=20 > - Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved. > + Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved. > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -21,6 +22,7 @@ > #define EV_NO_ACTION ((TCG_EVENTTYPE) 0x00000003) > #define EV_SEPARATOR ((TCG_EVENTTYPE) 0x00000004) > #define EV_ACTION ((TCG_EVENTTYPE) 0x00000005) > +#define EV_EVENT_TAG ((TCG_EVENTTYPE) 0x00000006) > #define EV_S_CRTM_CONTENTS ((TCG_EVENTTYPE) 0x00000007) > #define EV_S_CRTM_VERSION ((TCG_EVENTTYPE) 0x00000008) > #define EV_CPU_MICROCODE ((TCG_EVENTTYPE) 0x00000009) > @@ -45,8 +47,12 @@ > #define EV_EFI_ACTION (EV_EFI_EVENT_BASE + 7) > #define EV_EFI_PLATFORM_FIRMWARE_BLOB (EV_EFI_EVENT_BASE + 8) > #define EV_EFI_HANDOFF_TABLES (EV_EFI_EVENT_BASE + 9) > +#define EV_EFI_PLATFORM_FIRMWARE_BLOB2 (EV_EFI_EVENT_BASE + 0xA) > +#define EV_EFI_HANDOFF_TABLES2 (EV_EFI_EVENT_BASE + 0xB) > #define EV_EFI_HCRTM_EVENT (EV_EFI_EVENT_BASE + 0x10) > #define EV_EFI_VARIABLE_AUTHORITY (EV_EFI_EVENT_BASE + 0xE0) > +#define EV_EFI_SPDM_FIRMWARE_BLOB (EV_EFI_EVENT_BASE + 0xE1) > +#define EV_EFI_SPDM_FIRMWARE_CONFIG (EV_EFI_EVENT_BASE + 0xE2) >=20 > #define EFI_CALLING_EFI_APPLICATION \ > "Calling EFI Application from Boot Option" > @@ -78,6 +84,9 @@ > #define EV_POSTCODE_INFO_OPROM "Embedded Option ROM" > #define OPROM_LEN (sizeof(EV_POSTCODE_INFO_OPROM) -= 1) >=20 > +#define EV_POSTCODE_INFO_EMBEDDED_UEFI_DRIVER "Embedded UEFI Driver" > +#define EMBEDDED_UEFI_DRIVER_LEN (sizeof(EV_POSTCODE_INFO= _EMBEDDED_UEFI_DRIVER) - 1) > + > #define FIRMWARE_DEBUGGER_EVENT_STRING "UEFI Debug Mode" > #define FIRMWARE_DEBUGGER_EVENT_STRING_LEN (sizeof(FIRMWARE_DEBUGGER_E= VENT_STRING) - 1) >=20 > @@ -123,6 +132,30 @@ typedef struct tdEFI_PLATFORM_FIRMWARE_BLOB { > UINT64 BlobLength; > } EFI_PLATFORM_FIRMWARE_BLOB; >=20 > +/// > +/// UEFI_PLATFORM_FIRMWARE_BLOB > +/// > +/// This structure is used in EV_EFI_PLATFORM_FIRMWARE_BLOB > +/// event to facilitate the measurement of firmware volume. > +/// > +typedef struct tdUEFI_PLATFORM_FIRMWARE_BLOB { > + EFI_PHYSICAL_ADDRESS BlobBase; > + UINT64 BlobLength; > +} UEFI_PLATFORM_FIRMWARE_BLOB; > + > +/// > +/// UEFI_PLATFORM_FIRMWARE_BLOB2 > +/// > +/// This structure is used in EV_EFI_PLATFORM_FIRMWARE_BLOB2 > +/// event to facilitate the measurement of firmware volume. > +/// > +typedef struct tdUEFI_PLATFORM_FIRMWARE_BLOB2 { > + UINT8 BlobDescriptionSize; > +//UINT8 BlobDescription[BlobDescriptionSize= ]; > +//EFI_PHYSICAL_ADDRESS BlobBase; > +//UINT64 BlobLength; > +} UEFI_PLATFORM_FIRMWARE_BLOB2; > + > /// > /// EFI_IMAGE_LOAD_EVENT > /// > @@ -137,6 +170,20 @@ typedef struct tdEFI_IMAGE_LOAD_EVENT { > EFI_DEVICE_PATH_PROTOCOL DevicePath[1]; > } EFI_IMAGE_LOAD_EVENT; >=20 > +/// > +/// UEFI_IMAGE_LOAD_EVENT > +/// > +/// This structure is used in EV_EFI_BOOT_SERVICES_APPLICATION, > +/// EV_EFI_BOOT_SERVICES_DRIVER and EV_EFI_RUNTIME_SERVICES_DRIVER > +/// > +typedef struct tdUEFI_IMAGE_LOAD_EVENT { > + EFI_PHYSICAL_ADDRESS ImageLocationInMemory; > + UINT64 ImageLengthInMemory; > + UINT64 ImageLinkTimeAddress; > + UINT64 LengthOfDevicePath; > + EFI_DEVICE_PATH_PROTOCOL DevicePath[1]; > +} UEFI_IMAGE_LOAD_EVENT; > + > /// > /// EFI_HANDOFF_TABLE_POINTERS > /// > @@ -148,6 +195,30 @@ typedef struct tdEFI_HANDOFF_TABLE_POINTERS { > EFI_CONFIGURATION_TABLE TableEntry[1]; > } EFI_HANDOFF_TABLE_POINTERS; >=20 > +/// > +/// UEFI_HANDOFF_TABLE_POINTERS > +/// > +/// This structure is used in EV_EFI_HANDOFF_TABLES event to facilitate > +/// the measurement of given configuration tables. > +/// > +typedef struct tdUEFI_HANDOFF_TABLE_POINTERS { > + UINT64 NumberOfTables; > + EFI_CONFIGURATION_TABLE TableEntry[1]; > +} UEFI_HANDOFF_TABLE_POINTERS; > + > +/// > +/// UEFI_HANDOFF_TABLE_POINTERS2 > +/// > +/// This structure is used in EV_EFI_HANDOFF_TABLES2 event to facilitat= e > +/// the measurement of given configuration tables. > +/// > +typedef struct tdUEFI_HANDOFF_TABLE_POINTERS2 { > + UINT8 TableDescriptionSize; > +//UINT8 TableDescription[TableDescriptionSi= ze]; > +//UINT64 NumberOfTables; > +//EFI_CONFIGURATION_TABLE TableEntry[1]; > +} UEFI_HANDOFF_TABLE_POINTERS2; > + > /// > /// EFI_VARIABLE_DATA > /// > @@ -197,6 +268,66 @@ typedef struct tdEFI_GPT_DATA { > EFI_PARTITION_ENTRY Partitions[1]; > } EFI_GPT_DATA; >=20 > +typedef struct tdUEFI_GPT_DATA { > + EFI_PARTITION_TABLE_HEADER EfiPartitionHeader; > + UINT64 NumberOfPartitions; > + EFI_PARTITION_ENTRY Partitions[1]; > +} UEFI_GPT_DATA; > + > +#define TCG_DEVICE_SECURITY_EVENT_DATA_SIGNATURE "SPDM Device Sec" > +#define TCG_DEVICE_SECURITY_EVENT_DATA_VERSION 0 > + > +#define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_TYPE_NULL 0 > +#define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_TYPE_PCI 1 > +#define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_TYPE_USB 2 > + > +/// > +/// TCG_DEVICE_SECURITY_EVENT_DATA_HEADER > +/// This is the header of TCG_DEVICE_SECURITY_EVENT_DATA, which is > +/// used in EV_EFI_SPDM_FIRMWARE_BLOB and EV_EFI_SPDM_FIRMWARE_CONFIG. > +/// > +typedef struct { > + UINT8 Signature[16]; > + UINT16 Version; > + UINT16 Length; > + UINT32 SpdmHashAlgo; > + UINT32 DeviceType; > +//SPDM_MEASUREMENT_BLOCK SpdmMeasurementBlock; > +} TCG_DEVICE_SECURITY_EVENT_DATA_HEADER; > + > +#define TCG_DEVICE_SECURITY_EVENT_DATA_PCI_CONTEXT_VERSION 0 > + > +/// > +/// TCG_DEVICE_SECURITY_EVENT_DATA_PCI_CONTEXT > +/// This is the PCI context data of TCG_DEVICE_SECURITY_EVENT_DATA, whi= ch is > +/// used in EV_EFI_SPDM_FIRMWARE_BLOB and EV_EFI_SPDM_FIRMWARE_CONFIG. > +/// > +typedef struct { > + UINT16 Version; > + UINT16 Length; > + UINT16 VendorId; > + UINT16 DeviceId; > + UINT8 RevisionID; > + UINT8 ClassCode[3]; > + UINT16 SubsystemVendorID; > + UINT16 SubsystemID; > +} TCG_DEVICE_SECURITY_EVENT_DATA_PCI_CONTEXT; > + > +#define TCG_DEVICE_SECURITY_EVENT_DATA_USB_CONTEXT_VERSION 0 > + > +/// > +/// TCG_DEVICE_SECURITY_EVENT_DATA_USB_CONTEXT > +/// This is the USB context data of TCG_DEVICE_SECURITY_EVENT_DATA, whi= ch is > +/// used in EV_EFI_SPDM_FIRMWARE_BLOB and EV_EFI_SPDM_FIRMWARE_CONFIG. > +/// > +typedef struct { > + UINT16 Version; > + UINT16 Length; > +//UINT8 DeviceDescriptor[DescLen]; > +//UINT8 BodDescriptor[DescLen]; > +//UINT8 ConfigurationDescriptor[DescLen][NumOfConfiguration]; > +} TCG_DEVICE_SECURITY_EVENT_DATA_USB_CONTEXT; > + > // > // Crypto Agile Log Entry Format > // > @@ -243,6 +374,7 @@ typedef struct { > #define TCG_EfiSpecIDEventStruct_SPEC_VERSION_MAJOR_TPM2 2 > #define TCG_EfiSpecIDEventStruct_SPEC_VERSION_MINOR_TPM2 0 > #define TCG_EfiSpecIDEventStruct_SPEC_ERRATA_TPM2 0 > +#define TCG_EfiSpecIDEventStruct_SPEC_ERRATA_TPM2_REV_105 105 >=20 > typedef struct { > UINT8 signature[16]; > @@ -299,20 +431,52 @@ typedef struct { > //UINT8 vendorInfo[vendorInfoSize]; > } TCG_EfiSpecIDEventStruct; >=20 > +typedef struct tdTCG_PCClientTaggedEvent { > + UINT32 taggedEventID; > + UINT32 taggedEventDataSize; > +//UINT8 taggedEventData[taggedEventDataSize]; > +} TCG_PCClientTaggedEvent; > + > +#define TCG_Sp800_155_PlatformId_Event_SIGNATURE "SP800-155 Event" > +#define TCG_Sp800_155_PlatformId_Event2_SIGNATURE "SP800-155 Event2" >=20 > +typedef struct tdTCG_Sp800_155_PlatformId_Event2 { > + UINT8 Signature[16]; > + // > + // Where Vendor ID is an integer defined > + // at http://www.iana.org/assignments/enterprisenumbers > + // > + UINT32 VendorId; > + // > + // 16-byte identifier of a given platform's static configuration of c= ode > + // > + EFI_GUID ReferenceManifestGuid; > + // > + // Below structure is newly added in TCG_Sp800_155_PlatformId_Event2. > + // > +//UINT8 PlatformManufacturerStrSize; > +//UINT8 PlatformManufacturerStr[PlatformManufacturerStrSi= ze]; > +//UINT8 PlatformModelSize; > +//UINT8 PlatformModel[PlatformModelSize]; > +//UINT8 PlatformVersionSize; > +//UINT8 PlatformVersion[PlatformVersionSize]; > +//UINT8 PlatformModelSize; > +//UINT8 PlatformModel[PlatformModelSize]; > +//UINT8 FirmwareManufacturerStrSize; > +//UINT8 FirmwareManufacturerStr[FirmwareManufacturerStrSi= ze]; > +//UINT32 FirmwareManufacturerId; > +//UINT8 FirmwareVersion; > +//UINT8 FirmwareVersion[FirmwareVersionSize]]; > +} TCG_Sp800_155_PlatformId_Event2; >=20 > #define TCG_EfiStartupLocalityEvent_SIGNATURE "StartupLocality" >=20 >=20 > // > -// PC Client PTP spec Table 8 Relationship between Locality and Localit= y Attribute > +// The Locality Indicator which sent the TPM2_Startup command > // > -#define LOCALITY_0_INDICATOR 0x01 > -#define LOCALITY_1_INDICATOR 0x02 > -#define LOCALITY_2_INDICATOR 0x03 > -#define LOCALITY_3_INDICATOR 0x04 > -#define LOCALITY_4_INDICATOR 0x05 > - > +#define LOCALITY_0_INDICATOR 0x00 > +#define LOCALITY_3_INDICATOR 0x03 >=20 > // > // Startup Locality Event > -- > 2.19.2.windows.1 >=20 >=20 >=20