[SeaBIOS] [PATCH 03/10] tpm: Simplify hardware probe and detection checks

Kevin O'Connor kevin at koconnor.net
Thu Dec 31 01:06:58 CET 2015


On Wed, Dec 30, 2015 at 06:57:23PM -0500, Stefan Berger wrote:
> On 12/29/2015 07:17 PM, Kevin O'Connor wrote:
> >Perform the hardware probe once during setup instead of checking if
> >the probe has been completed on each measurement event.
> >
> >Don't probe for hardware during BIOS interface detection.  Just check
> >if the hardware is in a working state.
> >
> >Unify has_working_tpm() with similar tpm_is_working().
> >
> >Signed-off-by: Kevin O'Connor <kevin at koconnor.net>
> [...]
> >@@ -158,10 +123,10 @@ transmit(u8 locty, struct tpm_req_header *req,
> >           void *respbuffer, u32 *respbufferlen,
> >           enum tpmDurationType to_t)
> >  {
> >-    if (tpm_state.tpm_driver_to_use == TPM_INVALID_DRIVER)
> >+    if (TPMHW_driver_to_use == TPM_INVALID_DRIVER)
> >          return TCG_FATAL_COM_ERROR;
> >
> >-    struct tpm_driver *td = &tpm_drivers[tpm_state.tpm_driver_to_use];
> >+    struct tpm_driver *td = &tpm_drivers[TPMHW_driver_to_use];
> >
> >      u32 irc = td->activate(locty);
> >      if (irc != 0) {
> >@@ -329,6 +294,14 @@ tpm_log_event(struct pcpes *pcpes, const void *event)
> >   * Helper functions
> >   ****************************************************************/
> >
> >+static u8 TPM_working;
> 
> Should this not also have VARLOW to not be ROM'ed?

The only code that runs after normal variables are made read-only is
the 16bit BIOS interface.  After a later patch ("Don't call
tpm_set_failure() from tpm_log_extend_event()") none of the 16bit BIOS
interface functions call tpm_set_failure and thus none attempt to
modify TPM_working.  Unless I've missed something.

That later patch probably should be ahead of this patch.

-Kevin



More information about the SeaBIOS mailing list