Message ID | 20200330151536.871700-3-stefanb@linux.vnet.ibm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | tpm2: Make TPM2 logs accessible for non-UEFI firmware | expand |
On Mon, Mar 30, 2020 at 11:15:35AM -0400, Stefan Berger wrote: > From: Stefan Berger <stefanb@linux.ibm.com> > > Rearrange the ACPI table based log code to allow for easier extension > for the TPM2 case. > > Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> I think this change does not do anything useful. /Jarkko
On 3/30/20 3:32 PM, Jarkko Sakkinen wrote: > On Mon, Mar 30, 2020 at 11:15:35AM -0400, Stefan Berger wrote: >> From: Stefan Berger <stefanb@linux.ibm.com> >> >> Rearrange the ACPI table based log code to allow for easier extension >> for the TPM2 case. >> >> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> > I think this change does not do anything useful. I know. So it's easy to see what's happening and harmless. But I'll squash it. > > /Jarkko
On Mon, Mar 30, 2020 at 05:12:24PM -0400, Stefan Berger wrote: > On 3/30/20 3:32 PM, Jarkko Sakkinen wrote: > > On Mon, Mar 30, 2020 at 11:15:35AM -0400, Stefan Berger wrote: > > > From: Stefan Berger <stefanb@linux.ibm.com> > > > > > > Rearrange the ACPI table based log code to allow for easier extension > > > for the TPM2 case. > > > > > > Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> > > I think this change does not do anything useful. > > I know. So it's easy to see what's happening and harmless. But I'll squash > it. Yeah, well files aren't getting moved or anything and overally the change is still somewhat scoped. /Jarkko
diff --git a/drivers/char/tpm/eventlog/acpi.c b/drivers/char/tpm/eventlog/acpi.c index 63ada5e53f13..1ef2267c9378 100644 --- a/drivers/char/tpm/eventlog/acpi.c +++ b/drivers/char/tpm/eventlog/acpi.c @@ -50,9 +50,6 @@ int tpm_read_log_acpi(struct tpm_chip *chip) u64 len, start; struct tpm_bios_log *log; - if (chip->flags & TPM_CHIP_FLAG_TPM2) - return -ENODEV; - log = &chip->log; /* Unfortuntely ACPI does not associate the event log with a specific @@ -61,23 +58,27 @@ int tpm_read_log_acpi(struct tpm_chip *chip) if (!chip->acpi_dev_handle) return -ENODEV; - /* Find TCPA entry in RSDT (ACPI_LOGICAL_ADDRESSING) */ - status = acpi_get_table(ACPI_SIG_TCPA, 1, - (struct acpi_table_header **)&buff); - - if (ACPI_FAILURE(status)) + if (chip->flags & TPM_CHIP_FLAG_TPM2) { return -ENODEV; - - switch(buff->platform_class) { - case BIOS_SERVER: - len = buff->server.log_max_len; - start = buff->server.log_start_addr; - break; - case BIOS_CLIENT: - default: - len = buff->client.log_max_len; - start = buff->client.log_start_addr; - break; + } else { + /* Find TCPA entry in RSDT (ACPI_LOGICAL_ADDRESSING) */ + status = acpi_get_table(ACPI_SIG_TCPA, 1, + (struct acpi_table_header **)&buff); + + if (ACPI_FAILURE(status)) + return -ENODEV; + + switch (buff->platform_class) { + case BIOS_SERVER: + len = buff->server.log_max_len; + start = buff->server.log_start_addr; + break; + case BIOS_CLIENT: + default: + len = buff->client.log_max_len; + start = buff->client.log_start_addr; + break; + } } if (!len) { dev_warn(&chip->dev, "%s: TCPA log area empty\n", __func__);