[PATCH v8 2/2] tpm: Add support for event log pointer found in TPM2 ACPI table

Jarkko Sakkinen jarkko.sakkinen at linux.intel.com
Thu Jul 2 20:44:11 UTC 2020


On Fri, Jun 26, 2020 at 11:39:48AM -0400, Stefan Berger wrote:
> From: Stefan Berger <stefanb at linux.ibm.com>
> 
> In case a TPM2 is attached, search for a TPM2 ACPI table when trying
> to get the event log from ACPI. If one is found, use it to get the
> start and length of the log area. This allows non-UEFI systems, such
> as SeaBIOS, to pass an event log when using a TPM2.
> 
> Signed-off-by: Stefan Berger <stefanb at linux.ibm.com>
> ---
>  drivers/char/tpm/eventlog/acpi.c | 63 +++++++++++++++++++++-----------
>  1 file changed, 42 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/char/tpm/eventlog/acpi.c b/drivers/char/tpm/eventlog/acpi.c
> index 63ada5e53f13..51312c460335 100644
> --- a/drivers/char/tpm/eventlog/acpi.c
> +++ b/drivers/char/tpm/eventlog/acpi.c
> @@ -49,9 +49,9 @@ int tpm_read_log_acpi(struct tpm_chip *chip)
>  	void __iomem *virt;
>  	u64 len, start;
>  	struct tpm_bios_log *log;
> -
> -	if (chip->flags & TPM_CHIP_FLAG_TPM2)
> -		return -ENODEV;
> +	struct acpi_table_tpm2 *tbl;
> +	struct acpi_tpm2_phy *t2phy;

This is a rather cryptic variable name. Should be either 'phy' or
'tpm2_phy' (I don't care that much which one). Did not spot this
earlier.

/Jarkko



More information about the Linux-security-module-archive mailing list