Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new entry for TPM info #16

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions source/references.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
.. [OPTEECore] `OP-TEE Core <https://optee.readthedocs.io/en/latest/architecture/core.html>`

.. [TFAFFAMB] `TF-A Secure Partition Manager: FF-A manifest binding to device tree <https://trustedfirmware-a.readthedocs.io/en/latest/components/ffa-manifest-binding.html>`

.. [TCG_EFI] `https://trustedcomputinggroup.org/resource/tcg-efi-protocol-specification`.
103 changes: 102 additions & 1 deletion source/transfer_list.rst
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,9 @@ The following entry types are currently defined:
- single HOB block entry: tag_id = 2 (:numref:`hob_block_entry`).
- HOB list entry: tag_id = 3 (:numref:`hob_list_entry`).
- ACPI table aggregate entry: tag_id = 4 (:numref:`acpi_aggr_entry`).
- Entries related to Trusted Firmware (:numref:`tf_entries`)
- TPM event log entry: tag_id = 5 (:numref:`tpm_evlog_entry`).
- TPM CRB base entry: tag_id = 6 (:numref:`tpm_crb_base_entry`).
- Entries related to Trusted Firmware (:numref:`tf_entries`).

.. _void_entry:

Expand Down Expand Up @@ -697,6 +699,105 @@ such that the last ACPI table in this entry ends at offset
- hdr_size
- One or more ACPI tables.


.. _tpm_evlog_entry:

TPM event log table entry layout (XFERLIST_EVLOG)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This entry type holds TPM-related information for a platform. The TPM event log
info is a region containing a TPM event log as defined by TCG EFI Protocol
Specification [TCG_EFI]_.

.. _tab_tpm_evlog:
.. list-table:: TPM event log type layout
:widths: 2 2 4 8

* - Field
- Size (bytes)
- Offset (bytes)
- Description

* - tag_id
- 0x3
- 0x0
- The tag_id field must be set to **5**.

* - hdr_size
- 0x1
- 0x3
- |hdr_size_desc|

* - data_size
- 0x4
- 0x4
- The size of the event log in bytes + sizeof(flags) i.e. 0x4.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: After re-reading this, it's ambiguous whether the "i.e. 0x4" applies to the sizeof(flags) or the overall data_size. Hopefully it's obvious to implementers.


* - flags
- 0x4
- hdr_size
- flags are intended to signal properties of this TE. Bit 0 is
need_to_replay flag. Some firmware components may compute measurements
to be extended into a TPM and add them to the TPM event log, but those
components are unable to access the TPM themselves. In this case, the
component should set the "need_to_replay" flag so that the next
component in the boot chain is aware that the PCRs have not been
extended. A component with access to the TPM would replay the event log
by reading each measurement recorded and extending it into the TPM. Once
the measurements are extended into the TPM, then the "need_to_replay"
flag must be cleared if the transfer list is passed to additional
firmware components. Default value is "0". Other bits should be set to
zero.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: As I said in an earlier review, it would be good to align with the TL header language: "Must be set to 0 or ignored".


* - event_log
- data_size - 0x4
- hdr_size + 0x4
- Holds a complete event log.


.. _tpm_crb_base_entry:

TPM CRB base address table entry layout (XFERLIST_TPM_CRB_BASE)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The CRB info defines the address of a region of memory that has been carved out
and reserved for use as a TPM Command Response Buffer interface.

.. _tab_tpm_crb_base:
.. list-table:: TPM CRB base type layout
:widths: 4 2 4 8

* - Field
- Size (bytes)
- Offset (bytes)
- Description

* - tag_id
- 0x3
- 0x0
- The tag_id field must be set to **6**.

* - hdr_size
- 0x1
- 0x3
- |hdr_size_desc|

* - data_size
- 0x4
- 0x4
- This value should be set to **0xc** i.e. sizeof(crb_base_address) + sizeof(crb_size).

* - crb_base_address
apalos marked this conversation as resolved.
Show resolved Hide resolved
- 0x8
- hdr_size
- The physical base address of a region of memory reserved for use as a
TPM's Command Response Buffer region.

* - crb_size
- 0x4
- hdr_size + 0x8
- Size of CRB.



.. _tf_entries:

Entries related to Trusted Firmware
Expand Down