[SeaBIOS] [PATCH 4/8] tpm: Don't use 16bit BIOS return codes in build_and_send_cmd()

2015-12-30 Thread Kevin O'Connor
Don't use the return codes from the 16bit BIOS spec in the internal function build_and_send_cmd(). Instead, return the TIS command status code of the command or -1 if there was a command transmission failure. This eliminates the need for a returnCode pointer parameter. Also, implement debugging

[SeaBIOS] [PATCH 2/8] tpm: No need to check the return status of measurements

2015-12-30 Thread Kevin O'Connor
The low-level measurement functions already handle error conditions, there is no need to check for the errors in the high level measurement functions. Signed-off-by: Kevin O'Connor --- src/tcgbios.c | 119 -- 1 file

[SeaBIOS] [PATCH 5/8] tpm: Don't use 16bit BIOS return codes in tpm_log_event()

2015-12-30 Thread Kevin O'Connor
Don't use the return codes from the 16bit BIOS spec in the internal tpm_log_event() and tpm_log_extend_event() functions. Only the 16bit BIOS interface code should need to handle the details of that spec. Signed-off-by: Kevin O'Connor --- src/tcgbios.c | 38

[SeaBIOS] [PATCH 1/8] tpm: Don't return a status from external bios measurement functions

2015-12-30 Thread Kevin O'Connor
The callers of the measurements don't care what happens, so no need to return a status. Signed-off-by: Kevin O'Connor --- src/tcgbios.c | 58 -- src/tcgbios.h | 8 2 files changed, 32 insertions(+), 34

[SeaBIOS] [PATCH 3/8] tpm: Don't call tpm_set_failure() from tpm_log_extend_event()

2015-12-30 Thread Kevin O'Connor
The 16bit BIOS interface shouldn't be able to shutdown the TPM. Move the check for tpm_is_working() and tpm_set_failure() to the only caller of tpm_log_extend_event() that may shutdown the TPM. Signed-off-by: Kevin O'Connor --- src/tcgbios.c | 21 + 1

[SeaBIOS] [PATCH 7/8] tpm: Don't use 16bit BIOS return codes in TPM menu functions

2015-12-30 Thread Kevin O'Connor
Don't use the return codes from the 16bit BIOS spec in the internal menu functions. Only the 16bit BIOS interface code should need to handle the details of that spec. For functions that need to return the TIS command status, return those codes directly instead of via a pointer parameter.

[SeaBIOS] [PATCH 8/8] tpm: Replace build_and_send_cmd with tpm_send_cmd and tpm_send_check_cmd

2015-12-30 Thread Kevin O'Connor
Rename build_and_send_cmd() to tpm_send_cmd(). Introduce tpm_send_check_cmd() which is a wrapper around tpm_send_cmd() that calls tpm_set_failure() on failure. This also moves the debugging dprintf() preceding all callers of tpm_set_failure() into tpm_set_failure(). This change eliminates the

[SeaBIOS] [PATCH 0/8] TPM return code simplifications

2015-12-30 Thread Kevin O'Connor
Hi Stefan, I cleaned up the additional patches I mentioned yesterday. Some time back, you posted a series of patches that removed the use of TCG 16bit BIOS structs from internal functions. Many of those functions were still using return codes from the spec though. I found using these return

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

2015-12-30 Thread Stefan Berger
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

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

2015-12-30 Thread Kevin O'Connor
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

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

2015-12-30 Thread Kevin O'Connor
On Wed, Dec 30, 2015 at 07:06:58PM -0500, Kevin O'Connor wrote: > On Wed, Dec 30, 2015 at 06:57:23PM -0500, Stefan Berger wrote: > > On 12/29/2015 07:17 PM, Kevin O'Connor wrote: > > >+static u8 TPM_working; > > > > Should this not also have VARLOW to not be ROM'ed? > > The only code that runs

Re: [SeaBIOS] [PATCH 2/8] tpm: No need to check the return status of measurements

2015-12-30 Thread Stefan Berger
On 12/30/2015 02:31 PM, Kevin O'Connor wrote: The low-level measurement functions already handle error conditions, there is no need to check for the errors in the high level measurement functions. Signed-off-by: Kevin O'Connor --- @@ -507,7 +478,12 @@ tpm_setup(void)

Re: [SeaBIOS] [PATCH 2/8] tpm: No need to check the return status of measurements

2015-12-30 Thread Kevin O'Connor
On Wed, Dec 30, 2015 at 07:09:54PM -0500, Stefan Berger wrote: > On 12/30/2015 02:31 PM, Kevin O'Connor wrote: > >The low-level measurement functions already handle error conditions, > >there is no need to check for the errors in the high level measurement > >functions. > > > >Signed-off-by: Kevin