public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Sunny Wang" <Sunny.Wang@arm.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	Stuart Yoder <Stuart.Yoder@arm.com>,
	G Edhaya Chandran <Edhaya.Chandran@arm.com>,
	"gaojie@byosoft.com.cn" <gaojie@byosoft.com.cn>
Cc: "ilias.apalodimas@linaro.org" <ilias.apalodimas@linaro.org>,
	"heinrich.schuchardt@canonical.com"
	<heinrich.schuchardt@canonical.com>,
	Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>,
	"Jiewen.Yao@intel.com" <Jiewen.Yao@intel.com>,
	Sunny Wang <Sunny.Wang@arm.com>
Subject: Re: [edk2-devel] [PATCH v2 1/6] uefi-sct/SctPkg: TCG2 Protocol: add header with TCG2 protocol definitions
Date: Mon, 18 Mar 2024 20:42:37 +0000	[thread overview]
Message-ID: <AS8PR08MB779133BD1909DB2955424D61852D2@AS8PR08MB7791.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <20240109182053.2540542-2-stuart.yoder@arm.com>

Looks good to me.
For others' reference, the change has been already verified by running SystemReady SIE (Security Interface extension) tests on multiple SystemReady certified Arm systems.
Reviewed-by: Sunny Wang <sunny.wang@arm.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Stuart Yoder via groups.io
Sent: Tuesday, January 9, 2024 12:21 PM
To: devel@edk2.groups.io; G Edhaya Chandran <Edhaya.Chandran@arm.com>; gaojie@byosoft.com.cn
Cc: ilias.apalodimas@linaro.org; heinrich.schuchardt@canonical.com; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; Jiewen.Yao@intel.com
Subject: [edk2-devel] [PATCH v2 1/6] uefi-sct/SctPkg: TCG2 Protocol: add header with TCG2 protocol definitions

From: Joseph Hemann <joseph.hemann@arm.com>

Define constants and data structure specified in the TCG EFI Protocol
specification.

Signed-off-by: Joseph Hemann <Joseph.hemann@arm.com>
Signed-off-by: Stuart Yoder <stuart.yoder@arm.com>
---
 uefi-sct/SctPkg/UEFI/Protocol/TCG2.h | 177 ++++++++++++++++++++
 1 file changed, 177 insertions(+)

diff --git a/uefi-sct/SctPkg/UEFI/Protocol/TCG2.h b/uefi-sct/SctPkg/UEFI/Protocol/TCG2.h
new file mode 100644
index 000000000000..e62ecd85cbe9
--- /dev/null
+++ b/uefi-sct/SctPkg/UEFI/Protocol/TCG2.h
@@ -0,0 +1,177 @@
+/** @file

+

+  Copyright 2006 - 2016 Unified EFI, Inc.<BR>

+  Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.<BR>

+  Copyright (c) 2021 - 2023, Arm Inc. All rights reserved.<BR>

+

+  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.

+

+**/

+/*++

+

+Module Name:

+

+  TCG2.h

+

+Abstract:

+

+  EFI TCG Protocol

+

+--*/

+

+

+#ifndef __TCG2_PROTOCOL_H__

+#define __TCG2_PROTOCOL_H__

+

+//

+// Global ID for the TCG2 Protocol

+//

+#define EFI_TCG2_PROTOCOL_GUID    \

+   {0x607f766c, 0x7455, 0x42be, {0x93, 0x0b, 0xe4, 0xd7, 0x6d, 0xb2, 0x72, 0x0f}}

+

+// Following defintions come from TCG2 Efi Protocol Spec

+#define EFI_TCG2_BOOT_HASH_ALG_SHA1 0x00000001

+

+#define EFI_TCG2_BOOT_HASH_ALG_SHA256 0x00000002

+

+#define EFI_TCG2_BOOT_HASH_ALG_SHA384 0x00000004

+

+#define EFI_TCG2_BOOT_HASH_ALG_SHA512 0x00000008

+

+#define EFI_TCG2_BOOT_HASH_ALG_SM3_256 0x00000010

+

+#define EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2 0x00000001

+

+#define EFI_TCG2_EVENT_LOG_FORMAT_TCG_2 0x00000002

+

+typedef struct _EFI_TCG2_PROTOCOL EFI_TCG2_PROTOCOL;

+

+typedef UINT32 EFI_TCG2_EVENT_LOG_BITMAP;

+

+typedef UINT32 EFI_TCG2_EVENT_LOG_FORMAT;

+

+typedef UINT32 EFI_TCG2_EVENT_ALGORITHM_BITMAP;

+

+typedef UINT32 TCG_PCRINDEX;

+

+typedef UINT32 TCG_EVENTTYPE;

+

+// Following struct defintions come from TCG2 Efi Protocol Spec

+typedef struct {

+  UINT8 Major;

+  UINT8 Minor;

+} EFI_TCG2_VERSION;

+

+typedef struct {

+  UINT8 Size;

+  EFI_TCG2_VERSION StructureVersion;

+  EFI_TCG2_VERSION ProtocolVersion;

+  EFI_TCG2_EVENT_ALGORITHM_BITMAP HashAlgorithmBitmap;

+  EFI_TCG2_EVENT_LOG_BITMAP SupportedEventLogs;

+  BOOLEAN TPMPresentFlag;

+  UINT16 MaxCommandSize;

+  UINT16 MaxResponseSize;

+  UINT32 ManufacturerID;

+  UINT32 NumberOfPcrBanks;

+  EFI_TCG2_EVENT_ALGORITHM_BITMAP ActivePcrBanks;

+} EFI_TCG2_BOOT_SERVICE_CAPABILITY;

+

+typedef

+EFI_STATUS

+(EFIAPI *EFI_TCG2_GET_CAPABILITY) (

+  IN EFI_TCG2_PROTOCOL *This,

+  IN OUT EFI_TCG2_BOOT_SERVICE_CAPABILITY *ProtocolCapability

+);

+

+typedef

+EFI_STATUS

+(EFIAPI *EFI_TCG2_GET_EVENT_LOG) (

+  IN EFI_TCG2_PROTOCOL *This,

+  IN EFI_TCG2_EVENT_LOG_FORMAT EventLogFormat,

+  OUT EFI_PHYSICAL_ADDRESS *EventLogLocation,

+  OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry,

+  OUT BOOLEAN *EventLogTruncated

+);

+

+// all structs except EFI_TCG2_BOOT_SERVICE_CAPABILITY are packed

+#pragma pack(1)

+

+typedef struct tdEFI_TCG2_EVENT_HEADER {

+  UINT32 HeaderSize;

+  UINT16 HeaderVersion;

+  TCG_PCRINDEX PCRIndex;

+  TCG_EVENTTYPE EventType;

+} EFI_TCG2_EVENT_HEADER;

+

+typedef struct tdEFI_TCG2_EVENT {

+  UINT32 Size;

+  EFI_TCG2_EVENT_HEADER Header;

+  UINT8 Event[];

+} EFI_TCG2_EVENT;

+

+#pragma pack()

+

+typedef

+EFI_STATUS

+(EFIAPI * EFI_TCG2_HASH_LOG_EXTEND_EVENT) (

+  IN EFI_TCG2_PROTOCOL *This,

+  IN UINT64 Flags,

+  IN EFI_PHYSICAL_ADDRESS DataToHash,

+  IN UINT64 DataToHashLen,

+  IN EFI_TCG2_EVENT *EfiTcgEvent

+);

+

+typedef

+EFI_STATUS

+(EFIAPI *EFI_TCG2_SUBMIT_COMMAND) (

+  IN EFI_TCG2_PROTOCOL *This,

+  IN UINT32 InputParameterBlockSize,

+  IN UINT8 *InputParameterBlock,

+  IN UINT32 OutputParameterBlockSize,

+  IN UINT8 *OutputParameterBlock

+);

+

+typedef

+EFI_STATUS

+(EFIAPI *EFI_TCG2_GET_ACTIVE_PCR_BANKS) (

+  IN EFI_TCG2_PROTOCOL *This,

+  OUT UINT32 *ActivePcrBanks

+);

+

+typedef

+EFI_STATUS

+(EFIAPI *EFI_TCG2_SET_ACTIVE_PCR_BANKS) (

+  IN EFI_TCG2_PROTOCOL *This,

+  IN UINT32 ActivePcrBanks

+);

+

+typedef

+EFI_STATUS

+(EFIAPI * EFI_TCG2_GET_RESULT_OF_SET_ACTIVE_PCR_BANKS) (

+  IN EFI_TCG2_PROTOCOL *This,

+  OUT UINT32 *OperationPresent,

+  OUT UINT32 *Response

+);

+

+//

+// Interface structure for the TCG2 Protocol

+//

+struct _EFI_TCG2_PROTOCOL {

+  EFI_TCG2_GET_CAPABILITY GetCapability;

+  EFI_TCG2_GET_EVENT_LOG GetEventLog;

+  EFI_TCG2_HASH_LOG_EXTEND_EVENT HashLogExtendEvent;

+  EFI_TCG2_SUBMIT_COMMAND SubmitCommand;

+  EFI_TCG2_GET_ACTIVE_PCR_BANKS GetActivePcrBanks;

+  EFI_TCG2_SET_ACTIVE_PCR_BANKS SetActivePcrBanks;

+  EFI_TCG2_GET_RESULT_OF_SET_ACTIVE_PCR_BANKS GetResultOfSetActivePcrBanks;

+};

+

+extern EFI_GUID gEfiTcg2ProtocolGuid;

+

+#endif

--
2.34.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113490): https://edk2.groups.io/g/devel/message/113490
Mute This Topic: https://groups.io/mt/103625305/5985097
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [Sunny.Wang@arm.com]
-=-=-=-=-=-=


IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116845): https://edk2.groups.io/g/devel/message/116845
Mute This Topic: https://groups.io/mt/103625305/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  parent reply	other threads:[~2024-03-18 20:42 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-09 18:20 [edk2-devel] [PATCH v2 0/6] Tests for TCG2 Protocol Stuart Yoder
2024-01-09 18:20 ` [edk2-devel] [PATCH v2 1/6] uefi-sct/SctPkg: TCG2 Protocol: add header with TCG2 protocol definitions Stuart Yoder
2024-03-05 15:47   ` G Edhaya Chandran
2024-03-18 20:42   ` Sunny Wang [this message]
2024-03-19  9:15   ` G Edhaya Chandran
2024-01-09 18:20 ` [edk2-devel] [PATCH v2 2/6] uefi-sct/SctPkg: TCG2 Protocol: add test infrastructure and GetCapability Test Stuart Yoder
2024-03-05 15:47   ` G Edhaya Chandran
2024-03-18 20:43   ` Sunny Wang
2024-03-19  9:15   ` G Edhaya Chandran
2024-01-09 18:20 ` [edk2-devel] [PATCH v2 3/6] uefi-sct/SctPkg: TCG2 Protocol: add GetActivePcrBanks test Stuart Yoder
2024-03-05 15:48   ` G Edhaya Chandran
2024-03-18 20:43   ` Sunny Wang
2024-03-19  9:13   ` G Edhaya Chandran
2024-01-09 18:20 ` [edk2-devel] [PATCH v2 4/6] uefi-sct/SctPkg: TCG2 Protocol: add HashLogExtendEvent test Stuart Yoder
2024-03-05 15:48   ` G Edhaya Chandran
2024-03-18 20:43   ` Sunny Wang
2024-03-19  9:13   ` G Edhaya Chandran
2024-01-09 18:20 ` [edk2-devel] [PATCH v2 5/6] uefi-sct/SctPkg: TCG2 Protocol: add GetEventLog test Stuart Yoder
2024-03-05 15:49   ` G Edhaya Chandran
2024-03-18 20:44   ` Sunny Wang
2024-03-19  9:12   ` G Edhaya Chandran
2024-01-09 18:20 ` [edk2-devel] [PATCH v2 6/6] uefi-sct/SctPkg: TCG2 Protocol: add SubmitCommand test Stuart Yoder
2024-03-05 15:49   ` G Edhaya Chandran
2024-03-18 20:44   ` Sunny Wang
2024-03-19  9:11   ` G Edhaya Chandran
2024-03-05 15:46 ` [edk2-devel] [PATCH v2 0/6] Tests for TCG2 Protocol G Edhaya Chandran

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=AS8PR08MB779133BD1909DB2955424D61852D2@AS8PR08MB7791.eurprd08.prod.outlook.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