[SeaBIOS] [PATCH 4/8] tpm: Use pcpes->event[] to pass data to tpm_extend_acpi_log()

Kevin O'Connor kevin at koconnor.net
Mon Nov 23 02:52:45 CET 2015


On Sun, Nov 22, 2015 at 08:31:43PM -0500, Stefan Berger wrote:
> On 11/22/2015 08:02 PM, Kevin O'Connor wrote:
> >Instead of passing in the event data to tpm_extend_acpi_log() via
> >parameters, use the event[] field in the pcpes.  Update those callers
> >that don't populate the pcpes->event to do so prior to calling
> >tpm_extend_acpi_log().
[...]
> You are undoing a previous change now. I had tried to prevent having this
> event buffer (on the stack) but allow higher layers to pass arbitrary-length
> event buffers around that get copied into the log at the very end. This was
> to avoid having to append them here.

Okay, that was dumb on my part.  I only looked deeper into the code
after your cleanup series from the 17th, and it looks like I undid a
bunch of changes you just made.

I agree that we don't want the internal code to be dependent on the
external bios interface.  The pcpes is ultimately what goes into the
ACPI table though, and so it doesn't seem so bad to use its layout
when figuring out what to add to the ACPI table.  What's the rational
for sending both a pcpes and the content of the pcpes to the lower
functions?  (The tpm_add_measurement_to_log() code is only ever called
by internal functions that only use a small amount of data, so there
is no fear of it overflowing - at least in the current code.)

It looks like I also undid the change to build_and_send_cmd() - it
would be nice to have transmit() just take a single buffer instead of
having to use the iovec[] stuff.

-Kevin



More information about the SeaBIOS mailing list