From nobody Mon Apr 29 02:42:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+52476+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+52476+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1576912080; cv=none; d=zohomail.com; s=zohoarc; b=BOjHPAr/awF6KB74z3qORLmNMgBFCsDMyQ8Lm6gJ8BmntTybK1WygQgxTbuWX7VokHIUZlqlvn7rSVVe0Zvrmu/hFCE7M/pDW66RwcAYcVq45XvyhBQgtSkptvd22C8mlFD+hgMMMXk/vePoV5uqQ2IOwryFQpQMVSKe7TKo8c0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576912080; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=Hlk9e6V0944wMPhsYA2kkGZDmTI8GVkSQHbIj97w4uI=; b=cPzjMfeoto+/QH+qLkWToEwd9wT0kjJ08ZOr/0xgAVpKzB1A/syjwwz/uHkjBtscz3y6ZD2hjJU2W1OhdTPWjF0xzbaA16NXReGK/DXzE/igFBM2+PjscPA/cnKgP8dl3DLsGW2gShWNL4IyPIXPvY6xp8XdICUQ+ljT3GSQZzU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+52476+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 1576912080067379.16342706335854; Fri, 20 Dec 2019 23:08:00 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 2dluYY1788612xmVkBCO5MUb; Fri, 20 Dec 2019 23:07:59 -0800 X-Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web10.4661.1576912078190192475 for ; Fri, 20 Dec 2019 23:07:58 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Dec 2019 23:07:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,338,1571727600"; d="scan'208";a="219022978" X-Received: from jyao1-mobl2.ccr.corp.intel.com ([10.254.215.100]) by orsmga003.jf.intel.com with ESMTP; 20 Dec 2019 23:07:56 -0800 From: "Yao, Jiewen" To: devel@edk2.groups.io Cc: Ray Ni , Rangasai V Chaganty Subject: [edk2-devel] [PATCH] IntelSiliconPkg/IntelPciDeviceSecurity: Use EDKII TCG definition. Date: Sat, 21 Dec 2019 15:07:43 +0800 Message-Id: <20191221070743.10720-1-jiewen.yao@intel.com> MIME-Version: 1.0 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,jiewen.yao@intel.com X-Gm-Message-State: cYFnmAePNtLnWPvnP1NvGr4gx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1576912079; bh=Q9SXJp0QWrYlA/TSvc3/L+OMeNd8gX8ZaolxAeGuEhc=; h=Cc:Date:From:Reply-To:Subject:To; b=dS0k2pOSHjxSS+WbRyrWkkgMQXmLjrak76z8IIukkJyXxdZY3GIPdtLEs7mcDN3y3C8 OfZvwQWPHHhDjn59YMrBN0ivL2lEwFWY8wBjTcKyhVQv19Y5qMau/yr6OTeloIVfGbBnM OCD93pF6VCamBSJ9tgQ9lP5FqW7mloS0A04= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Since official TCG definition is added to MdePkg, IntelPciDeviceSecurityDxe should not define its own TCG event log. Cc: Ray Ni Cc: Rangasai V Chaganty Signed-off-by: Jiewen Yao --- .../IntelPciDeviceSecurityDxe.c | 19 ++-- .../IntelPciDeviceSecurityDxe.inf | 1 - .../TcgDeviceEvent.h | 101 ------------------ 3 files changed, 9 insertions(+), 112 deletions(-) delete mode 100644 Silicon/Intel/IntelSiliconPkg/Feature/PcieSecurity/Inte= lPciDeviceSecurityDxe/TcgDeviceEvent.h diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/PcieSecurity/IntelPciDev= iceSecurityDxe/IntelPciDeviceSecurityDxe.c b/Silicon/Intel/IntelSiliconPkg/= Feature/PcieSecurity/IntelPciDeviceSecurityDxe/IntelPciDeviceSecurityDxe.c index 2922fb8deb..d46862a1c4 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/PcieSecurity/IntelPciDeviceSecu= rityDxe/IntelPciDeviceSecurityDxe.c +++ b/Silicon/Intel/IntelSiliconPkg/Feature/PcieSecurity/IntelPciDeviceSecu= rityDxe/IntelPciDeviceSecurityDxe.c @@ -22,14 +22,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include -#include "TcgDeviceEvent.h" =20 typedef struct { - EDKII_DEVICE_SECURITY_EVENT_DATA_HEADER EventData; + TCG_DEVICE_SECURITY_EVENT_DATA_HEADER EventData; SPDM_MEASUREMENT_BLOCK_COMMON_HEADER CommonHeader; SPDM_MEASUREMENT_BLOCK_DMTF_HEADER DmtfHeader; UINT8 Digest[SHA256_DIGEST_SIZE]; - EDKII_DEVICE_SECURITY_EVENT_DATA_PCI_CONTEXT PciContext; + TCG_DEVICE_SECURITY_EVENT_DATA_PCI_CONTEXT PciContext; } EDKII_DEVICE_SECURITY_PCI_EVENT_DATA; =20 typedef struct { @@ -327,14 +326,14 @@ ExtendDigestRegister ( Status =3D PciIo->Pci.Read (PciIo, EfiPciIoWidthUint8, 0, sizeof(PciData= ), &PciData); ASSERT_EFI_ERROR(Status); =20 - PcrIndex =3D EDKII_DEVICE_MEASUREMENT_COMPONENT_PCR_INDEX; - EventType =3D EDKII_DEVICE_MEASUREMENT_COMPONENT_EVENT_TYPE; + PcrIndex =3D 2; + EventType =3D EV_EFI_SPDM_FIRMWARE_BLOB; =20 - CopyMem (EventLog.EventData.Signature, EDKII_DEVICE_SECURITY_EVENT_DATA_= SIGNATURE, sizeof(EventLog.EventData.Signature)); - EventLog.EventData.Version =3D EDKII_DEVICE_SECURITY_EV= ENT_DATA_VERSION; + CopyMem (EventLog.EventData.Signature, TCG_DEVICE_SECURITY_EVENT_DATA_SI= GNATURE, sizeof(EventLog.EventData.Signature)); + EventLog.EventData.Version =3D TCG_DEVICE_SECURITY_EVEN= T_DATA_VERSION; EventLog.EventData.Length =3D sizeof(EDKII_DEVICE_SECU= RITY_PCI_EVENT_DATA); EventLog.EventData.SpdmHashAlgo =3D TcgAlgIdToSpdmHashAlgo (= TcgAlgId); - EventLog.EventData.DeviceType =3D EDKII_DEVICE_SECURITY_EV= ENT_DATA_DEVICE_TYPE_PCI; + EventLog.EventData.DeviceType =3D TCG_DEVICE_SECURITY_EVEN= T_DATA_DEVICE_TYPE_PCI; =20 EventLog.CommonHeader.Index =3D DigestSel; EventLog.CommonHeader.MeasurementSpecification =3D SPDM_MEASUREMENT_BL= OCK_HEADER_SPECIFICATION_DMTF; @@ -343,8 +342,8 @@ ExtendDigestRegister ( EventLog.DmtfHeader.DMTFSpecMeasurementValueSize =3D SHA256_DIGEST_SIZE; CopyMem (&EventLog.Digest, Digest, SHA256_DIGEST_SIZE); =20 - EventLog.PciContext.Version =3D EDKII_DEVICE_SECURITY_EVENT_DA= TA_PCI_CONTEXT_VERSION; - EventLog.PciContext.Length =3D sizeof(EDKII_DEVICE_SECURITY_E= VENT_DATA_PCI_CONTEXT); + EventLog.PciContext.Version =3D TCG_DEVICE_SECURITY_EVENT_DATA= _PCI_CONTEXT_VERSION; + EventLog.PciContext.Length =3D sizeof(TCG_DEVICE_SECURITY_EVE= NT_DATA_PCI_CONTEXT); EventLog.PciContext.VendorId =3D PciData.Hdr.VendorId; EventLog.PciContext.DeviceId =3D PciData.Hdr.DeviceId; EventLog.PciContext.RevisionID =3D PciData.Hdr.RevisionID; diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/PcieSecurity/IntelPciDev= iceSecurityDxe/IntelPciDeviceSecurityDxe.inf b/Silicon/Intel/IntelSiliconPk= g/Feature/PcieSecurity/IntelPciDeviceSecurityDxe/IntelPciDeviceSecurityDxe.= inf index 89a4c8fadd..b51b843bb5 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/PcieSecurity/IntelPciDeviceSecu= rityDxe/IntelPciDeviceSecurityDxe.inf +++ b/Silicon/Intel/IntelSiliconPkg/Feature/PcieSecurity/IntelPciDeviceSecu= rityDxe/IntelPciDeviceSecurityDxe.inf @@ -16,7 +16,6 @@ =20 [Sources] IntelPciDeviceSecurityDxe.c - TcgDeviceEvent.h =20 [Packages] MdePkg/MdePkg.dec diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/PcieSecurity/IntelPciDev= iceSecurityDxe/TcgDeviceEvent.h b/Silicon/Intel/IntelSiliconPkg/Feature/Pci= eSecurity/IntelPciDeviceSecurityDxe/TcgDeviceEvent.h deleted file mode 100644 index a0ce344112..0000000000 --- a/Silicon/Intel/IntelSiliconPkg/Feature/PcieSecurity/IntelPciDeviceSecu= rityDxe/TcgDeviceEvent.h +++ /dev/null @@ -1,101 +0,0 @@ -/** @file - TCG Device Event data structure -Copyright (c) 2019, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent -**/ - - -#ifndef __TCG_EVENT_DATA_H__ -#define __TCG_EVENT_DATA_H__ - -#include - -#pragma pack(1) - -// ------------------------------------------- -// TCG Measurement for SPDM Device Measurement -// ------------------------------------------- - -// -// Device Firmware Component (including immutable ROM or mutable firmware) -// -#define EDKII_DEVICE_MEASUREMENT_COMPONENT_PCR_INDEX 2 -#define EDKII_DEVICE_MEASUREMENT_COMPONENT_EVENT_TYPE 0x800000E1 -// -// Device Firmware Configuration (including hardware configuration or firm= ware configuration) -// -#define EDKII_DEVICE_MEASUREMENT_CONFIGURATION_PCR_INDEX 4 -#define EDKII_DEVICE_MEASUREMENT_CONFIGURATION_EVENT_TYPE 0x800000E2 - -// -// Device Firmware Measurement Measurement Data -// The measurement data is the device firmware measurement. -// -// In order to support crypto agile, the firmware will hash the DeviceMeas= urement again. -// As such the device measurement algo might be different with host firmwa= re measurement algo. -// - -// -// Device Firmware Measurement Event Data -// -#define EDKII_DEVICE_SECURITY_EVENT_DATA_SIGNATURE "SPDM Device Sec\0" -#define EDKII_DEVICE_SECURITY_EVENT_DATA_VERSION 0 - -// -// Device Type -// 0x03 ~ 0xDF reserved by TCG. -// 0xE0 ~ 0xFF reserved by OEM. -// -#define EDKII_DEVICE_SECURITY_EVENT_DATA_DEVICE_TYPE_NULL 0 -#define EDKII_DEVICE_SECURITY_EVENT_DATA_DEVICE_TYPE_PCI 1 -#define EDKII_DEVICE_SECURITY_EVENT_DATA_DEVICE_TYPE_USB 2 - -// -// Device Firmware Measurement Event Data Common Part -// The device specific part should follow this data structure. -// -typedef struct { - // - // It must be EDKII_DEVICE_SECURITY_EVENT_DATA_SIGNATURE. - // - UINT8 Signature[16]; - // - // It must be EDKII_DEVICE_SECURITY_EVENT_DATA_VERSION. - // - UINT16 Version; - // - // The length of whole data structure, including Device Context. - // - UINT16 Length; - // - // The SpdmHashAlgo - // - UINT32 SpdmHashAlgo; - // - // The type of device. This field is to determine the Device Context fol= lowed by. - // - UINT32 DeviceType; - // - // The SPDM measurement block. - // -//SPDM_MEASUREMENT_BLOCK SpdmMeasurementBlock; -} EDKII_DEVICE_SECURITY_EVENT_DATA_HEADER; - -// -// PCI device specific context -// -#define EDKII_DEVICE_SECURITY_EVENT_DATA_PCI_CONTEXT_VERSION 0 -typedef struct { - UINT16 Version; - UINT16 Length; - UINT16 VendorId; - UINT16 DeviceId; - UINT8 RevisionID; - UINT8 ClassCode[3]; - UINT16 SubsystemVendorID; - UINT16 SubsystemID; -} EDKII_DEVICE_SECURITY_EVENT_DATA_PCI_CONTEXT; - -#pragma pack() - -#endif --=20 2.19.2.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 (#52476): https://edk2.groups.io/g/devel/message/52476 Mute This Topic: https://groups.io/mt/68955508/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-