From patchwork Fri Aug 6 07:02:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 492810 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp45639jap; Fri, 6 Aug 2021 00:03:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUV/p/eP8UPNtP3JMtsvn8eUuIdt3XK9vPBK3MQXJQWAvZ8lkYHqqvTYxFprgxzbnjGjQj X-Received: by 2002:aa7:c794:: with SMTP id n20mr453998eds.244.1628233438355; Fri, 06 Aug 2021 00:03:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628233438; cv=none; d=google.com; s=arc-20160816; b=gC3oukjGakS2zhb4dIGUNxwaer+wCvSS+lHDoOckFVp/t2z81D/UYKYLKp4+4Y82Qw /onDHp7aOWiSoSg3iuiF7qGDtT/av0/8UODMm+0+FUmEqzwuvLOAbyeM960JkMATdfzX 1tGJfYcKFT6LiTGrY2NG5JJ+h9PvybdAHwhKtSZtULeWHkRJBSy/eyMpKjW1aXVm7srX ls2ZTCJzbRZzjHSREOQldr/CIdEkqLV1fyONr98tvbgDWfkdJNk7Z6LSQug+8B3dKiy+ 0vE0keAXLNi4h4Y3QNtIswqNq1HIo50qUlNFMk5Cx+4hF4B2lx7EVaIyWtwH4+tYUbxa KSLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=yinBnJBxQjuI4tZQyapGmUTjdu1gCyGp9T0IeXwRNLI=; b=R97SGrHhSGLHEKl7XT1SWifvLeNGdHxQe+O/wO7pmyF5iem7MhhBgC2+o/o36V18jy 7u7iVDM8uNeBGh7kJOH5I1DGN6ybpXEZDwmBwPGM8MuAZp8kH/krpbNN6UruMdFX9FG3 eQhEin9ClWd4iuCByikI9CLt9I36zjDvqQ/XpYP9FO7G26l5vmE62b5V/5MZGa6NpzXF Uz5mFfEQc/7XvMqhanncztB1cM7GmRRNOyCB58YcEDlCTi3s6KPRy47dX2W4H6lspl6U Y1pxEIBxDabwhOz/fLu/cGdQAuV/MUL7uqcVWa1XIU+YQYNlZlDYvhFcSOjA7nYxTITa D0/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SjQSVMwZ; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id cw8si7111152edb.20.2021.08.06.00.03.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 00:03:58 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SjQSVMwZ; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A854782EBD; Fri, 6 Aug 2021 09:03:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="SjQSVMwZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 10C1982EBB; Fri, 6 Aug 2021 09:03:17 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 31B5182E8D for ; Fri, 6 Aug 2021 09:03:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masahisa.kojima@linaro.org Received: by mail-pj1-x1031.google.com with SMTP id u13-20020a17090abb0db0290177e1d9b3f7so21143659pjr.1 for ; Fri, 06 Aug 2021 00:03:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=yinBnJBxQjuI4tZQyapGmUTjdu1gCyGp9T0IeXwRNLI=; b=SjQSVMwZvWDenrH8HhbF2Af8W8QK90qf395jx1HXf6BkpoP46rPQxaIeMXowceaa7i aJvZA7hCD9dLw8qNvbx/qpwjg14XRM6VUPoG6Ydg5N3Sb60TlnKmaV7tIblckrIzTB2O vDPQmghTVevuBZcuepsO9BxvXSFlIBaFc0N9drbpFD9/SliuVMSzQzrmL+ZEXK0prkTd bZyxBmghb+k4aDy6A/CoDqb5adnLV28Zoj3rKiWSKoGaOZcGy8oNT/k7Qc67hNNZ5rjI v1jEXHTMgCsKRcb1kDxk1iRyjNKljLCetdioQjGgIm885TtIp01xD60TzHlmgd7us6l/ T0tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=yinBnJBxQjuI4tZQyapGmUTjdu1gCyGp9T0IeXwRNLI=; b=UzZyQOmv8bXCxHfClqBC9dzJn3hndrImGOuMQIYLXZ5c6WtpQTi0ll0uyajg6da95L ApUvGfLdNXWaAfjaprsK1aXlQTPhY4xy5AKbtZSh+FaMMHQaZcNLccZYoLkYizy5oaD6 y0mOPt3o7tLIpXv1LYXX8aKQfwmNBTrzby7DYQG3AgPVEUdnuX+xKI/H9MqHmjijY/q5 3vASZydFtIYeLuBhDxJM0jDayJeYUBzvgMV07Ann55ln/o+l7YrQmCL86tdZGM5k1Ks9 ZFwAzMTvstMPvCPeydl1We3bbU4OsutH4knT7wWaAKSE637Os+9kLKSq2btgjEDNSsMI TeFQ== X-Gm-Message-State: AOAM531gG9TQvFmvlzp8xgVCEa4m7/1taSXFXX8r+G5pJiqKAYUuBgso JXoamiKF5eWuZDiZusR5M/z11A== X-Received: by 2002:aa7:93b1:0:b029:3c0:a7b7:3db0 with SMTP id x17-20020aa793b10000b02903c0a7b73db0mr3370449pff.40.1628233385429; Fri, 06 Aug 2021 00:03:05 -0700 (PDT) Received: from localhost.localdomain ([2400:2411:502:a100:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id u24sm5145304pfm.27.2021.08.06.00.03.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 00:03:04 -0700 (PDT) From: Masahisa Kojima To: Heinrich Schuchardt , Alexander Graf , Ilias Apalodimas , Simon Glass , Masahisa Kojima , Dhananjay Phadke , u-boot@lists.denx.de Subject: [PATCH v3 5/5] efi_loader: add comment for efi_tcg2.h Date: Fri, 6 Aug 2021 16:02:15 +0900 Message-Id: <20210806070215.19887-6-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210806070215.19887-1-masahisa.kojima@linaro.org> References: <20210806070215.19887-1-masahisa.kojima@linaro.org> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean This commit adds the comment of the TCG Specification efi_tcg2.h file refers, and comment for the structure. Signed-off-by: Masahisa Kojima --- Changes in v3: - update comment format Changes in v2: - newly create commit from v2 include/efi_tcg2.h | 57 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/include/efi_tcg2.h b/include/efi_tcg2.h index 497ba3ce94..b6b958da51 100644 --- a/include/efi_tcg2.h +++ b/include/efi_tcg2.h @@ -3,6 +3,13 @@ * Defines data structures and APIs that allow an OS to interact with UEFI * firmware to query information about the device * + * This file refers the following TCG specification. + * - TCG PC Client Platform Firmware Profile Specification + * https://trustedcomputinggroup.org/resource/pc-client-specific-platform-firmware-profile-specification/ + * + * - TCG EFI Protocol Specification + * https://trustedcomputinggroup.org/resource/tcg-efi-protocol-specification/ + * * Copyright (c) 2020, Linaro Limited */ @@ -36,11 +43,23 @@ typedef u32 efi_tcg_event_log_bitmap; typedef u32 efi_tcg_event_log_format; typedef u32 efi_tcg_event_algorithm_bitmap; +/** + * struct tdEFI_TCG2_VERSION - structure of EFI TCG2 version + * @major: major version + * @minor: minor version + */ struct efi_tcg2_version { u8 major; u8 minor; }; +/** + * struct tdEFI_TCG2_EVENT_HEADER - structure of EFI TCG2 event header + * @header_size: size of the event header + * @header_version: header version + * @pcr_index: index of the PCR that is extended + * @event_type: type of the event that is extended + */ struct efi_tcg2_event_header { u32 header_size; u16 header_version; @@ -48,12 +67,27 @@ struct efi_tcg2_event_header { u32 event_type; } __packed; +/** + * struct tdEFI_TCG2_EVENT - structure of EFI TCG2 event + * @size: total size of the event including the size component, the header + * and the event data + * @header: event header + * @event: event to add + */ struct efi_tcg2_event { u32 size; struct efi_tcg2_event_header header; u8 event[]; } __packed; +/** + * struct tdUEFI_IMAGE_LOAD_EVENT - structure of PE/COFF image measurement + * @image_location_in_memory: image address + * @image_length_in_memory: image size + * @image_link_time_address: image link time address + * @length_of_device_path: devive path size + * @device_path: device path + */ struct uefi_image_load_event { efi_physical_addr_t image_location_in_memory; u64 image_length_in_memory; @@ -62,6 +96,23 @@ struct uefi_image_load_event { struct efi_device_path device_path[]; }; +/** + * struct tdEFI_TCG2_BOOT_SERVICE_CAPABILITY - protocol capability information + * @size: allocated size of the structure + * @structure_version: version of this structure + * @protocol_version: version of the EFI TCG2 protocol. + * @hash_algorithm_bitmap: supported hash algorithms + * @supported_event_logs: bitmap of supported event log formats + * @tpm_present_flag: false = TPM not present + * @max_command_size: max size (in bytes) of a command + * that can be sent to the TPM + * @max_response_size: max size (in bytes) of a response that + * can be provided by the TPM + * @manufacturer_id: 4-byte Vendor ID + * @number_of_pcr_banks: maximum number of PCR banks + * @active_pcr_banks: bitmap of currently active + * PCR banks (hashing algorithms). + */ struct efi_tcg2_boot_service_capability { u8 size; struct efi_tcg2_version structure_version; @@ -86,7 +137,7 @@ struct efi_tcg2_boot_service_capability { #define TCG_EFI_SPEC_ID_EVENT_SPEC_VERSION_ERRATA_TPM2 2 /** - * struct TCG_EfiSpecIdEventAlgorithmSize + * struct TCG_EfiSpecIdEventAlgorithmSize - hashing algorithm information * * @algorithm_id: algorithm defined in enum tpm2_algorithms * @digest_size: size of the algorithm @@ -97,7 +148,7 @@ struct tcg_efi_spec_id_event_algorithm_size { } __packed; /** - * struct TCG_EfiSpecIDEventStruct + * struct TCG_EfiSpecIDEventStruct - content of the event log header * * @signature: signature, set to Spec ID Event03 * @platform_class: class defined in TCG ACPI Specification @@ -130,7 +181,7 @@ struct tcg_efi_spec_id_event { } __packed; /** - * struct tdEFI_TCG2_FINAL_EVENTS_TABLE + * struct tdEFI_TCG2_FINAL_EVENTS_TABLE - log entries after Get Event Log * @version: version number for this structure * @number_of_events: number of events recorded after invocation of * GetEventLog()