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

2015-12-29 Thread Kevin O'Connor
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().

[SeaBIOS] [PATCH 09/10] tpm: Eliminate response buffer parameter from build_and_send_cmd()

2015-12-29 Thread Kevin O'Connor
There are no longer any callers that use the response buffer. Signed-off-by: Kevin O'Connor --- src/tcgbios.c | 45 + 1 file changed, 17 insertions(+), 28 deletions(-) diff --git a/src/tcgbios.c b/src/tcgbios.c index

[SeaBIOS] [PATCH 07/10] tpm: Simplify tcpa probe

2015-12-29 Thread Kevin O'Connor
The TPM ACPI tables are only scanned once at startup and the code can rely on that. Merge find_tcpa_table() into find_tcpa_by_rsdp(), merge get_lasa_base_ptr() into reset_acpi_log(), and merge tpm_acpi_init() into tpm_setup(). The tpm_state structure is now only used for TCPA tracking.

[SeaBIOS] [PATCH 00/10] Some TPM simplifications

2015-12-29 Thread Kevin O'Connor
The following series involves some code reorganization in the TPM code that I found useful in understanding the code. Patches 3-5 simplify the hardware interface by only exporting three commands to the underlying TIS hardware (tpmhw_probe, tpmhw_transmit, tpmhw_set_timeouts). Patches 8-10

[SeaBIOS] [PATCH 06/10] tpm: Rework TPM interface shutdown support

2015-12-29 Thread Kevin O'Connor
The 16bit BIOS interface should only shutdown on request from that interface - errors from the tcp or acpi log setup should not shutdown the interface. (Errors from those functions will cause the TPM to be in a "not working" state which will cause all the 16bit interface functions to fail.)

[SeaBIOS] [PATCH 05/10] tpm: Move TPM hardware functions from tcgbios.c to hw/tpm_drivers.c

2015-12-29 Thread Kevin O'Connor
Move the hardware interface functions (tpmhw_probe, tpmhw_transmit, and tpmhw_set_timeouts) to tpm_drivers.c code, and only export those functions. This simplifies the hardware interface. Signed-off-by: Kevin O'Connor --- src/hw/tpm_drivers.c | 84

[SeaBIOS] [PATCH 10/10] tpm: Return returnCode from build_and_send_cmd() instead of via pointer param

2015-12-29 Thread Kevin O'Connor
The callers interested in the return status of build_and_send_cmd() are only interested in the command return code status (returnCode) and not the status of the message transmission (rc). Simplify the callers by returning returnCode directly instead of via a pointer parameter. For the unlikely

[SeaBIOS] [PATCH 01/10] tpm: Add banner separating the TCG bios interface code from TCG menu code

2015-12-29 Thread Kevin O'Connor
Signed-off-by: Kevin O'Connor --- src/tcgbios.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/tcgbios.c b/src/tcgbios.c index 7b93d87..4f78c42 100644 --- a/src/tcgbios.c +++ b/src/tcgbios.c @@ -1187,6 +1187,11 @@ tpm_interrupt_handler32(struct bregs *regs)

[SeaBIOS] [PATCH 04/10] tpm: Add wrapper function tpm_set_timeouts()

2015-12-29 Thread Kevin O'Connor
Signed-off-by: Kevin O'Connor --- src/tcgbios.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/tcgbios.c b/src/tcgbios.c index 9448984..b680c1d 100644 --- a/src/tcgbios.c +++ b/src/tcgbios.c @@ -155,6 +155,13 @@ transmit(u8 locty, struct

[SeaBIOS] [PATCH 02/10] tpm: Avoid macro expansion of tpm request / response structs

2015-12-29 Thread Kevin O'Connor
Avoid macros and use regular struct definitions for the request and response headers. This simplifies the header and reduces the need for casts in the code. Signed-off-by: Kevin O'Connor --- src/std/tcg.h | 40 +--- src/tcgbios.c | 11

Re: [SeaBIOS] [PATCH 08/10] tpm: Introduce tpm_get_capability() helper function

2015-12-29 Thread Stefan Berger
On 12/29/2015 07:17 PM, Kevin O'Connor wrote: Introduce helper function to call the TPM_ORD_GetCapability command. Update all get capability callers to use this helper. Signed-off-by: Kevin O'Connor --- src/std/tcg.h | 17 +++--- src/tcgbios.c | 176

Re: [SeaBIOS] [PATCH 10/10] tpm: Return returnCode from build_and_send_cmd() instead of via pointer param

2015-12-29 Thread Kevin O'Connor
On Tue, Dec 29, 2015 at 10:11:14PM -0500, Stefan Berger wrote: > On 12/29/2015 07:17 PM, Kevin O'Connor wrote: > >The callers interested in the return status of build_and_send_cmd() > >are only interested in the command return code status (returnCode) and > >not the status of the message

Re: [SeaBIOS] [PATCH 10/10] tpm: Return returnCode from build_and_send_cmd() instead of via pointer param

2015-12-29 Thread Stefan Berger
On 12/29/2015 07:17 PM, Kevin O'Connor wrote: The callers interested in the return status of build_and_send_cmd() are only interested in the command return code status (returnCode) and not the status of the message transmission (rc). Simplify the callers by returning returnCode directly instead

Re: [SeaBIOS] [PATCH 08/10] tpm: Introduce tpm_get_capability() helper function

2015-12-29 Thread Kevin O'Connor
On Tue, Dec 29, 2015 at 09:09:09PM -0500, Stefan Berger wrote: > On 12/29/2015 07:17 PM, Kevin O'Connor wrote: > >+static int > >+tpm_get_capability(u32 cap, u32 subcap, struct tpm_rsp_header *rsp, u32 > >rsize) > >+{ > >+struct tpm_req_getcap trgc = { > >+.hdr.tag =