From patchwork Fri Aug 13 07:12:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 496553 Delivered-To: patch@linaro.org Received: by 2002:a02:cf8a:0:0:0:0:0 with SMTP id w10csp274215jar; Fri, 13 Aug 2021 00:13:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw19GH94E1tXSn2DtLvhQP2u1bKr1WVDatL1yvsAtCR5u/o0hmivs+CEQ28BMfZjJlKuUg0 X-Received: by 2002:a05:6402:29a:: with SMTP id l26mr1306163edv.347.1628838809933; Fri, 13 Aug 2021 00:13:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628838809; cv=none; d=google.com; s=arc-20160816; b=Dtj3NUw1uTdjbiFrT5b+JsvEw+N/kZUZAgRcDmGSFOGzBylR1IrcLiAMp9A/SPBpKn vLLorpx1qgWCKGc8/nmTwRllt+5bg/I3nUY9O33GWV8WGSOTBoEAqBavQVHOgPQ/jV4Z GGntB4/abZFp/u/kV7znfcwr216rrR1OdzlPwyhl8ZAnhparQ6pfBN+6KvGTaEhhhOOD VfG4atPZA1mZPHGclj3ZTppEaxt8FMhs1Q4LDZqgikc8u3FYzd4mhDW4NKV92cev3HMk VpNV/0/vq4HpzownPPitk62P/GzLk0KpQQVjpQOAMvK0iseDZ3dxsbMJebm54V3CyQMs tOKA== 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=SOdD8NWNx1896gTnGo0hZ49DiJQRNarQ+tyItVbXkdQ=; b=U3qMaMeNzUGamDzldPWsyHbmM6Ho056jXZxKwq2EeG9BZTO9PEZd4ukApkuNth9LZC RuXG+pADzO6xqonyeFHuXJc2XhWIUa70cSZrr2SEiGJAzfHYh5Buo3H4nST2OYnZA2Z3 8JqndEaFwaGPSQUQLYas57A1eV4W/w0QWgM04M+W+YJEB3hTS+V3dzPoeTSsMexKyup4 wrURdCSvV0JqPsJnzWB9EwNxxQ3Q4woLUBioMsWnUwDXQi6/z+SQ7VfpUVhaTs7mQrqK P3Qcv4csje1ruPqwDWSgekOY4WMPh8QcYarSbUcseco95bbYw7ByZQQCO8KhZR3j7V00 Zylg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MVwfLBHL; 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 b13si922250ede.445.2021.08.13.00.13.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Aug 2021 00:13:29 -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=MVwfLBHL; 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 97B7182E08; Fri, 13 Aug 2021 09:12:59 +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="MVwfLBHL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 12C5982DEC; Fri, 13 Aug 2021 09:12:45 +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-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) (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 1EB7282DDA for ; Fri, 13 Aug 2021 09:12:33 +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-x1029.google.com with SMTP id u21-20020a17090a8915b02901782c36f543so19387457pjn.4 for ; Fri, 13 Aug 2021 00:12:33 -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=SOdD8NWNx1896gTnGo0hZ49DiJQRNarQ+tyItVbXkdQ=; b=MVwfLBHLWsOuZjpAaPobm92/EaYhq7KaVtvOw7aYbUQfKrqKA+8spzfbrBhq3j4qUX hKHdsx0k1Jiwlmn2WOtgKThKIxJ1u4ggPU0BjyvXy9lh1F/dF+PYGWzjyAHFqd9MRwrq cj7VOP5KUpcHneswFC5sjA670x2ENrRCXpTK7uWDJKeTj+aOkK3t28IG+4xtq9PCkay1 +/Rg39frhLvk61jBp28229kAenH5szker6dOyUcKtIZv/EKFGkDK9Z6fv1uZ7Y1n5VNz eaDhQk79UuxO1bpfKEcih34UuYRbsUy0hA553ArkN/2SlCcTMxQ5WNTujTa9X4KlLSaS lwow== 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=SOdD8NWNx1896gTnGo0hZ49DiJQRNarQ+tyItVbXkdQ=; b=JATAsgSi67wNror64fwezyxyh3Cr4rlexyWAf0ML3rytuJIS9m0BjKgTkr8G9yBmgo 0CxCR+MjEQ9CmWW9nEAnJU7UIU4lfyyCpcWSKKwiL9A+7JUcI9bXQdNyCPemN4Qyu2hG 7TQQhr3UTzIDPnfxXsbyeayV0Te1gRaDG0D/eEK/nueZAHjtG3tlQAE60auDulxumg18 N297qKwSjCmY92bFma+xMntT1DXfEneDXfcwobkq8Bzy3uLDRCOyF3ho3UkWP+DyyI45 zfR5l3eXvqlXGqXFklSigTyFQhH/lAIhzq23EV+Zy1z8snFN2kSvzKPLBkqkuVQXG/fN QkGQ== X-Gm-Message-State: AOAM533qrWU6bmgG7W8P/15xZ0D2WK1gLzJEXSx+VjQafhkx6QkwUHBW Z72rVpkdZGS2KvmfFvg9V0asvQ== X-Received: by 2002:a17:90b:3007:: with SMTP id hg7mr1302762pjb.66.1628838751495; Fri, 13 Aug 2021 00:12:31 -0700 (PDT) Received: from localhost.localdomain ([2400:2411:502:a100:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id u21sm987078pfh.163.2021.08.13.00.12.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Aug 2021 00:12:30 -0700 (PDT) From: Masahisa Kojima To: Heinrich Schuchardt , Alexander Graf , Ilias Apalodimas , Simon Glass , Masahisa Kojima , Dhananjay Phadke , AKASHI Takahiro , u-boot@lists.denx.de Subject: [PATCH v4 5/5] efi_loader: add comment for efi_tcg2.h Date: Fri, 13 Aug 2021 16:12:43 +0900 Message-Id: <20210813071243.18885-6-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210813071243.18885-1-masahisa.kojima@linaro.org> References: <20210813071243.18885-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 --- (no change since v3) 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()