* [PATCH] acpi: tpm: Do not build TCPA table for TPM 2
@ 2020-05-29 19:28 Stefan Berger
2020-05-29 19:45 ` Marc-André Lureau
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Stefan Berger @ 2020-05-29 19:28 UTC (permalink / raw
To: qemu-devel, mst; +Cc: eric.auger, marcandre.lureau, Stefan Berger
From: Stefan Berger <stefanb@linux.ibm.com>
Do not build a TCPA table for TPM 2 anymore but create the log area when
building the TPM2 table. The TCPA table is only needed for TPM 1.2.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
---
hw/i386/acpi-build.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 2e15f6848e..b5669d6c65 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -2317,6 +2317,10 @@ build_tpm2(GArray *table_data, BIOSLinker *linker, GArray *tcpalog)
tpm2_ptr->log_area_minimum_length =
cpu_to_le32(TPM_LOG_AREA_MINIMUM_SIZE);
+ acpi_data_push(tcpalog, le32_to_cpu(tpm2_ptr->log_area_minimum_length));
+ bios_linker_loader_alloc(linker, ACPI_BUILD_TPMLOG_FILE, tcpalog, 1,
+ false);
+
/* log area start address to be filled by Guest linker */
bios_linker_loader_add_pointer(linker, ACPI_BUILD_TABLE_FILE,
log_addr_offset, log_addr_size,
@@ -2848,10 +2852,10 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)
build_hpet(tables_blob, tables->linker);
}
if (misc.tpm_version != TPM_VERSION_UNSPEC) {
- acpi_add_table(table_offsets, tables_blob);
- build_tpm_tcpa(tables_blob, tables->linker, tables->tcpalog);
-
- if (misc.tpm_version == TPM_VERSION_2_0) {
+ if (misc.tpm_version == TPM_VERSION_1_2) {
+ acpi_add_table(table_offsets, tables_blob);
+ build_tpm_tcpa(tables_blob, tables->linker, tables->tcpalog);
+ } else { /* TPM_VERSION_2_0 */
acpi_add_table(table_offsets, tables_blob);
build_tpm2(tables_blob, tables->linker, tables->tcpalog);
}
--
2.24.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] acpi: tpm: Do not build TCPA table for TPM 2
2020-05-29 19:28 [PATCH] acpi: tpm: Do not build TCPA table for TPM 2 Stefan Berger
@ 2020-05-29 19:45 ` Marc-André Lureau
2020-05-29 22:23 ` Stefan Berger
2020-06-04 10:45 ` Igor Mammedov
2 siblings, 0 replies; 5+ messages in thread
From: Marc-André Lureau @ 2020-05-29 19:45 UTC (permalink / raw
To: Stefan Berger; +Cc: Auger Eric, Stefan Berger, QEMU, Michael S. Tsirkin
[-- Attachment #1: Type: text/plain, Size: 2118 bytes --]
On Fri, May 29, 2020 at 9:28 PM Stefan Berger <stefanb@linux.vnet.ibm.com>
wrote:
> From: Stefan Berger <stefanb@linux.ibm.com>
>
> Do not build a TCPA table for TPM 2 anymore but create the log area when
> building the TPM2 table. The TCPA table is only needed for TPM 1.2.
>
> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
> hw/i386/acpi-build.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index 2e15f6848e..b5669d6c65 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -2317,6 +2317,10 @@ build_tpm2(GArray *table_data, BIOSLinker *linker,
> GArray *tcpalog)
> tpm2_ptr->log_area_minimum_length =
> cpu_to_le32(TPM_LOG_AREA_MINIMUM_SIZE);
>
> + acpi_data_push(tcpalog,
> le32_to_cpu(tpm2_ptr->log_area_minimum_length));
> + bios_linker_loader_alloc(linker, ACPI_BUILD_TPMLOG_FILE, tcpalog, 1,
> + false);
> +
> /* log area start address to be filled by Guest linker */
> bios_linker_loader_add_pointer(linker, ACPI_BUILD_TABLE_FILE,
> log_addr_offset, log_addr_size,
> @@ -2848,10 +2852,10 @@ void acpi_build(AcpiBuildTables *tables,
> MachineState *machine)
> build_hpet(tables_blob, tables->linker);
> }
> if (misc.tpm_version != TPM_VERSION_UNSPEC) {
> - acpi_add_table(table_offsets, tables_blob);
> - build_tpm_tcpa(tables_blob, tables->linker, tables->tcpalog);
> -
> - if (misc.tpm_version == TPM_VERSION_2_0) {
> + if (misc.tpm_version == TPM_VERSION_1_2) {
> + acpi_add_table(table_offsets, tables_blob);
> + build_tpm_tcpa(tables_blob, tables->linker, tables->tcpalog);
> + } else { /* TPM_VERSION_2_0 */
> acpi_add_table(table_offsets, tables_blob);
> build_tpm2(tables_blob, tables->linker, tables->tcpalog);
> }
> --
> 2.24.1
>
>
--
Marc-André Lureau
[-- Attachment #2: Type: text/html, Size: 3071 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] acpi: tpm: Do not build TCPA table for TPM 2
2020-05-29 19:28 [PATCH] acpi: tpm: Do not build TCPA table for TPM 2 Stefan Berger
2020-05-29 19:45 ` Marc-André Lureau
@ 2020-05-29 22:23 ` Stefan Berger
2020-05-30 6:58 ` Auger Eric
2020-06-04 10:45 ` Igor Mammedov
2 siblings, 1 reply; 5+ messages in thread
From: Stefan Berger @ 2020-05-29 22:23 UTC (permalink / raw
To: Stefan Berger, qemu-devel, mst; +Cc: eric.auger, marcandre.lureau
On 5/29/20 3:28 PM, Stefan Berger wrote:
> From: Stefan Berger <stefanb@linux.ibm.com>
>
> Do not build a TCPA table for TPM 2 anymore but create the log area when
> building the TPM2 table. The TCPA table is only needed for TPM 1.2.
Specs are here:
https://trustedcomputinggroup.org/wp-content/uploads/TCG_ACPIGeneralSpecification_v1.20_r8.pdf
TCPA is a TPM 1.2 table and TPM2 tables is sufficient for TPM 2.0.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] acpi: tpm: Do not build TCPA table for TPM 2
2020-05-29 22:23 ` Stefan Berger
@ 2020-05-30 6:58 ` Auger Eric
0 siblings, 0 replies; 5+ messages in thread
From: Auger Eric @ 2020-05-30 6:58 UTC (permalink / raw
To: Stefan Berger, Stefan Berger, qemu-devel, mst; +Cc: marcandre.lureau
Hi Stefan
On 5/30/20 12:23 AM, Stefan Berger wrote:
> On 5/29/20 3:28 PM, Stefan Berger wrote:
>> From: Stefan Berger <stefanb@linux.ibm.com>
>>
>> Do not build a TCPA table for TPM 2 anymore but create the log area when
>> building the TPM2 table. The TCPA table is only needed for TPM 1.2.
Now I understand the purpose of the tcpalog arg in build_tpm2() ;-)
Reviewed-by: Eric Auger <eric.auger@redhat.com>
I will send shortly 2 series, the one related to ARM/ACPI support and a
new one introducing ACPI table tests based on this new patch as both
conflict with this patch.
Thanks
Eric
>
> Specs are here:
> https://trustedcomputinggroup.org/wp-content/uploads/TCG_ACPIGeneralSpecification_v1.20_r8.pdf
>
>
> TCPA is a TPM 1.2 table and TPM2 tables is sufficient for TPM 2.0.
>
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] acpi: tpm: Do not build TCPA table for TPM 2
2020-05-29 19:28 [PATCH] acpi: tpm: Do not build TCPA table for TPM 2 Stefan Berger
2020-05-29 19:45 ` Marc-André Lureau
2020-05-29 22:23 ` Stefan Berger
@ 2020-06-04 10:45 ` Igor Mammedov
2 siblings, 0 replies; 5+ messages in thread
From: Igor Mammedov @ 2020-06-04 10:45 UTC (permalink / raw
To: Stefan Berger
Cc: eric.auger, Stefan Berger, marcandre.lureau, qemu-devel, mst
On Fri, 29 May 2020 15:28:40 -0400
Stefan Berger <stefanb@linux.vnet.ibm.com> wrote:
> From: Stefan Berger <stefanb@linux.ibm.com>
>
> Do not build a TCPA table for TPM 2 anymore but create the log area when
> building the TPM2 table. The TCPA table is only needed for TPM 1.2.
>
> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> ---
> hw/i386/acpi-build.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index 2e15f6848e..b5669d6c65 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -2317,6 +2317,10 @@ build_tpm2(GArray *table_data, BIOSLinker *linker, GArray *tcpalog)
> tpm2_ptr->log_area_minimum_length =
> cpu_to_le32(TPM_LOG_AREA_MINIMUM_SIZE);
>
> + acpi_data_push(tcpalog, le32_to_cpu(tpm2_ptr->log_area_minimum_length));
> + bios_linker_loader_alloc(linker, ACPI_BUILD_TPMLOG_FILE, tcpalog, 1,
> + false);
> +
> /* log area start address to be filled by Guest linker */
> bios_linker_loader_add_pointer(linker, ACPI_BUILD_TABLE_FILE,
> log_addr_offset, log_addr_size,
> @@ -2848,10 +2852,10 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)
> build_hpet(tables_blob, tables->linker);
> }
> if (misc.tpm_version != TPM_VERSION_UNSPEC) {
> - acpi_add_table(table_offsets, tables_blob);
> - build_tpm_tcpa(tables_blob, tables->linker, tables->tcpalog);
> -
> - if (misc.tpm_version == TPM_VERSION_2_0) {
> + if (misc.tpm_version == TPM_VERSION_1_2) {
> + acpi_add_table(table_offsets, tables_blob);
> + build_tpm_tcpa(tables_blob, tables->linker, tables->tcpalog);
> + } else { /* TPM_VERSION_2_0 */
> acpi_add_table(table_offsets, tables_blob);
> build_tpm2(tables_blob, tables->linker, tables->tcpalog);
> }
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-06-04 10:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-29 19:28 [PATCH] acpi: tpm: Do not build TCPA table for TPM 2 Stefan Berger
2020-05-29 19:45 ` Marc-André Lureau
2020-05-29 22:23 ` Stefan Berger
2020-05-30 6:58 ` Auger Eric
2020-06-04 10:45 ` Igor Mammedov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.