Re: [PATCH RFC v2 9/9] attestation: Add the TDX family implementation
From: Jarkko Sakkinen
Date: Mon Nov 23 2026 - 07:38:55 EST
On Mon, Nov 23, 2026 at 09:09:02AM +0000, Yeoreum Yun wrote:
> 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()?
Nothing in the patch (neither commit message nor any comment in code)
says that TDX attestion registers share the same format as TPM2 even
log.
I was just trying to understand where does this derive from but since
there is no reference, I'm confused.
As per the function, perhaps tpm2_calc_event_log_size() should be
relocated to lib and have non-TPM name like firmware_event_log_size()
or something.
>
>
> Otherwise, look good to me.
>
> [...]
>
>
> Thanks!
>
> --
> Sincerely,
> Yeoreum Yun
Br, Jarkko