Re: [PATCH RFC v2 9/9] attestation: Add the TDX family implementation

From: Yeoreum Yun

Date: Mon Nov 23 2026 - 04:09:15 EST


Hi Jiri,

[...]

> +static void __iomem *tdx_attestation_log_map(size_t *length)
> +{
> + struct acpi_table_header *header;
> + struct acpi_table_ccel *ccel;
> + void __iomem *log = NULL;
> +
> + if (ACPI_FAILURE(acpi_get_table(ACPI_SIG_CCEL, 0, &header)))
> + return NULL;
> + ccel = container_of(header, struct acpi_table_ccel, header);
> + if (header->length >= sizeof(*ccel) && ccel->log_area_start_address &&
> + ccel->log_area_minimum_length &&
> + ccel->log_area_minimum_length <= UINT_MAX)
> + log = acpi_os_map_iomem(ccel->log_area_start_address,
> + ccel->log_area_minimum_length);
> + if (log)
> + *length = ccel->log_area_minimum_length;
> + acpi_put_table(header);
> + return log;
> +}
> +

I think we don't need to dump log area with the log_area_minimum_length
since the area would include none-event otherwise, pre-exist tool (i.e.
tpm2_eventlog) reports error for them like:

...
- EventNum: 21
PCRIndex: 2
EventType: EV_EFI_ACTION
DigestCount: 1
Digests:
- AlgorithmId: sha256
Digest: "b54f7542cbd872a81a9d9dea839b2b8d747c7ebd5ea6615c40f42f44a6dbeba0"
EventSize: 40
Event: |-
Exit Boot Services Returned with Success
ERROR: corrupted log, insufficient size for event header: 3
ERROR: failed to parse tpm2 eventlog
ERROR: Unable to run tpm2_eventlog


So, what about export *real size* of eventlog like
tpm2_calc_event_log_size()?


Otherwise, look good to me.

[...]


Thanks!

--
Sincerely,
Yeoreum Yun