diff --git a/acpi-Convert-build_tpm2-to-build_append-API.patch b/acpi-Convert-build_tpm2-to-build_append-API.patch new file mode 100644 index 0000000000000000000000000000000000000000..682dab7f2a0d808dd70e6b320404ab14cc4be1c9 --- /dev/null +++ b/acpi-Convert-build_tpm2-to-build_append-API.patch @@ -0,0 +1,76 @@ +From 768934922aec6de705d535a6fe59a3acfae94e3e Mon Sep 17 00:00:00 2001 +From: Eric Auger +Date: Mon, 1 Jun 2020 11:57:34 +0200 +Subject: [PATCH 04/14] acpi: Convert build_tpm2() to build_append* API + +In preparation of its move to the generic acpi code, +let's convert build_tpm2() to use build_append API. This +latter now is prefered in place of direct ACPI struct field +settings with manual endianness conversion. + +Signed-off-by: Eric Auger +Message-Id: <20200601095737.32671-2-eric.auger@redhat.com> +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +Signed-off-by: jiangfangjie +--- + hw/i386/acpi-build.c | 28 +++++++++++++++++++--------- + 1 file changed, 19 insertions(+), 9 deletions(-) + +diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c +index 652f7c7d..224dfd3b 100644 +--- a/hw/i386/acpi-build.c ++++ b/hw/i386/acpi-build.c +@@ -2279,30 +2279,40 @@ build_tpm_tcpa(GArray *table_data, BIOSLinker *linker, GArray *tcpalog) + static void + build_tpm2(GArray *table_data, BIOSLinker *linker, GArray *tcpalog) + { +- Acpi20TPM2 *tpm2_ptr = acpi_data_push(table_data, sizeof *tpm2_ptr); ++ Acpi20TPM2 *tpm2_ptr = acpi_data_push(table_data, sizeof(AcpiTableHeader)); + unsigned log_addr_size = sizeof(tpm2_ptr->log_area_start_address); + unsigned log_addr_offset = + (char *)&tpm2_ptr->log_area_start_address - table_data->data; ++ uint8_t start_method_params[12] = {}; + +- tpm2_ptr->platform_class = cpu_to_le16(TPM2_ACPI_CLASS_CLIENT); ++ /* platform class */ ++ build_append_int_noprefix(table_data, TPM2_ACPI_CLASS_CLIENT, 2); ++ /* reserved */ ++ build_append_int_noprefix(table_data, 0, 2); + if (TPM_IS_TIS_ISA(tpm_find())) { +- tpm2_ptr->control_area_address = cpu_to_le64(0); +- tpm2_ptr->start_method = cpu_to_le32(TPM2_START_METHOD_MMIO); ++ /* address of control area */ ++ build_append_int_noprefix(table_data, 0, 8); ++ /* start method */ ++ build_append_int_noprefix(table_data, TPM2_START_METHOD_MMIO, 4); + } else if (TPM_IS_CRB(tpm_find())) { +- tpm2_ptr->control_area_address = cpu_to_le64(TPM_CRB_ADDR_CTRL); +- tpm2_ptr->start_method = cpu_to_le32(TPM2_START_METHOD_CRB); ++ build_append_int_noprefix(table_data, TPM_CRB_ADDR_CTRL, 8); ++ build_append_int_noprefix(table_data, TPM2_START_METHOD_CRB, 4); + } else { + g_warn_if_reached(); + } + +- tpm2_ptr->log_area_minimum_length = +- cpu_to_le32(TPM_LOG_AREA_MINIMUM_SIZE); ++ /* platform specific parameters */ ++ g_array_append_vals(table_data, &start_method_params, 12); + +- acpi_data_push(tcpalog, le32_to_cpu(tpm2_ptr->log_area_minimum_length)); ++ /* log area minimum length */ ++ build_append_int_noprefix(table_data, TPM_LOG_AREA_MINIMUM_SIZE, 4); ++ ++ acpi_data_push(tcpalog, TPM_LOG_AREA_MINIMUM_SIZE); + bios_linker_loader_alloc(linker, ACPI_BUILD_TPMLOG_FILE, tcpalog, 1, + false); + + /* log area start address to be filled by Guest linker */ ++ build_append_int_noprefix(table_data, 0, 8); + bios_linker_loader_add_pointer(linker, ACPI_BUILD_TABLE_FILE, + log_addr_offset, log_addr_size, + ACPI_BUILD_TPMLOG_FILE, 0); +-- +2.23.0 + diff --git a/acpi-Move-build_tpm2-in-the-generic-part.patch b/acpi-Move-build_tpm2-in-the-generic-part.patch new file mode 100644 index 0000000000000000000000000000000000000000..56313453670723ab96dd0f70d4eb833c8a9648d7 --- /dev/null +++ b/acpi-Move-build_tpm2-in-the-generic-part.patch @@ -0,0 +1,151 @@ +From 499a02c0cddf68317e7fcccd1207f23ae857e7c1 Mon Sep 17 00:00:00 2001 +From: jiangfangjie +Date: Thu, 27 Aug 2020 14:52:44 +0800 +Subject: [PATCH 05/14] acpi: Move build_tpm2() in the generic part + +We plan to build the TPM2 table on ARM too. In order to reuse the +generation code, let's move build_tpm2() to aml-build.c. + +No change in the implementation. + +Signed-off-by: Eric Auger +Message-Id: <20200601095737.32671-3-eric.auger@redhat.com> +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +Signed-off-by: jiangfangjie +--- + hw/acpi/aml-build.c | 46 +++++++++++++++++++++++++++++++++++++ + hw/i386/acpi-build.c | 44 ----------------------------------- + include/hw/acpi/aml-build.h | 2 ++ + 3 files changed, 48 insertions(+), 44 deletions(-) + +diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c +index 8a3b51c8..09ab4332 100644 +--- a/hw/acpi/aml-build.c ++++ b/hw/acpi/aml-build.c +@@ -26,6 +26,7 @@ + #include "qemu/bitops.h" + #include "sysemu/numa.h" + #include "sysemu/cpus.h" ++#include "hw/acpi/tpm.h" + + static GArray *build_alloc_array(void) + { +@@ -2095,3 +2096,48 @@ build_hdr: + build_header(linker, tbl, (void *)(tbl->data + fadt_start), + "FACP", tbl->len - fadt_start, f->rev, oem_id, oem_table_id); + } ++ ++void build_tpm2(GArray *table_data, BIOSLinker *linker, GArray *tcpalog) ++{ ++ Acpi20TPM2 *tpm2_ptr = acpi_data_push(table_data, sizeof(AcpiTableHeader)); ++ unsigned log_addr_size = sizeof(tpm2_ptr->log_area_start_address); ++ unsigned log_addr_offset = ++ (char *)&tpm2_ptr->log_area_start_address - table_data->data; ++ uint8_t start_method_params[12] = {}; ++ ++ /* platform class */ ++ build_append_int_noprefix(table_data, TPM2_ACPI_CLASS_CLIENT, 2); ++ /* reserved */ ++ build_append_int_noprefix(table_data, 0, 2); ++ if (TPM_IS_TIS_ISA(tpm_find())) { ++ /* address of control area */ ++ build_append_int_noprefix(table_data, 0, 8); ++ /* start method */ ++ build_append_int_noprefix(table_data, TPM2_START_METHOD_MMIO, 4); ++ } else if (TPM_IS_CRB(tpm_find())) { ++ build_append_int_noprefix(table_data, TPM_CRB_ADDR_CTRL, 8); ++ build_append_int_noprefix(table_data, TPM2_START_METHOD_CRB, 4); ++ } else { ++ g_warn_if_reached(); ++ } ++ ++ /* platform specific parameters */ ++ g_array_append_vals(table_data, &start_method_params, 12); ++ ++ /* log area minimum length */ ++ build_append_int_noprefix(table_data, TPM_LOG_AREA_MINIMUM_SIZE, 4); ++ ++ acpi_data_push(tcpalog, TPM_LOG_AREA_MINIMUM_SIZE); ++ bios_linker_loader_alloc(linker, ACPI_BUILD_TPMLOG_FILE, tcpalog, 1, ++ false); ++ ++ /* log area start address to be filled by Guest linker */ ++ build_append_int_noprefix(table_data, 0, 8); ++ bios_linker_loader_add_pointer(linker, ACPI_BUILD_TABLE_FILE, ++ log_addr_offset, log_addr_size, ++ ACPI_BUILD_TPMLOG_FILE, 0); ++ build_header(linker, table_data, ++ (void *)tpm2_ptr, "TPM2", sizeof(*tpm2_ptr), 4, NULL, NULL); ++} ++ ++ +diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c +index 224dfd3b..9a3c739b 100644 +--- a/hw/i386/acpi-build.c ++++ b/hw/i386/acpi-build.c +@@ -2276,50 +2276,6 @@ build_tpm_tcpa(GArray *table_data, BIOSLinker *linker, GArray *tcpalog) + (void *)tcpa, "TCPA", sizeof(*tcpa), 2, NULL, NULL); + } + +-static void +-build_tpm2(GArray *table_data, BIOSLinker *linker, GArray *tcpalog) +-{ +- Acpi20TPM2 *tpm2_ptr = acpi_data_push(table_data, sizeof(AcpiTableHeader)); +- unsigned log_addr_size = sizeof(tpm2_ptr->log_area_start_address); +- unsigned log_addr_offset = +- (char *)&tpm2_ptr->log_area_start_address - table_data->data; +- uint8_t start_method_params[12] = {}; +- +- /* platform class */ +- build_append_int_noprefix(table_data, TPM2_ACPI_CLASS_CLIENT, 2); +- /* reserved */ +- build_append_int_noprefix(table_data, 0, 2); +- if (TPM_IS_TIS_ISA(tpm_find())) { +- /* address of control area */ +- build_append_int_noprefix(table_data, 0, 8); +- /* start method */ +- build_append_int_noprefix(table_data, TPM2_START_METHOD_MMIO, 4); +- } else if (TPM_IS_CRB(tpm_find())) { +- build_append_int_noprefix(table_data, TPM_CRB_ADDR_CTRL, 8); +- build_append_int_noprefix(table_data, TPM2_START_METHOD_CRB, 4); +- } else { +- g_warn_if_reached(); +- } +- +- /* platform specific parameters */ +- g_array_append_vals(table_data, &start_method_params, 12); +- +- /* log area minimum length */ +- build_append_int_noprefix(table_data, TPM_LOG_AREA_MINIMUM_SIZE, 4); +- +- acpi_data_push(tcpalog, TPM_LOG_AREA_MINIMUM_SIZE); +- bios_linker_loader_alloc(linker, ACPI_BUILD_TPMLOG_FILE, tcpalog, 1, +- false); +- +- /* log area start address to be filled by Guest linker */ +- build_append_int_noprefix(table_data, 0, 8); +- bios_linker_loader_add_pointer(linker, ACPI_BUILD_TABLE_FILE, +- log_addr_offset, log_addr_size, +- ACPI_BUILD_TPMLOG_FILE, 0); +- build_header(linker, table_data, +- (void *)tpm2_ptr, "TPM2", sizeof(*tpm2_ptr), 4, NULL, NULL); +-} +- + #define HOLE_640K_START (640 * KiB) + #define HOLE_640K_END (1 * MiB) + +diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h +index 0be3453a..86d09832 100644 +--- a/include/hw/acpi/aml-build.h ++++ b/include/hw/acpi/aml-build.h +@@ -469,4 +469,6 @@ void build_slit(GArray *table_data, BIOSLinker *linker); + + void build_fadt(GArray *tbl, BIOSLinker *linker, const AcpiFadtData *f, + const char *oem_id, const char *oem_table_id); ++ ++void build_tpm2(GArray *table_data, BIOSLinker *linker, GArray *tcpalog); + #endif +-- +2.23.0 + diff --git a/acpi-Some-build_tpm2-code-reshape.patch b/acpi-Some-build_tpm2-code-reshape.patch new file mode 100644 index 0000000000000000000000000000000000000000..e5efa3e688b357ee3a45c22c474ed7c40e193fd7 --- /dev/null +++ b/acpi-Some-build_tpm2-code-reshape.patch @@ -0,0 +1,164 @@ +From 9acf704328fe570844d5fc158614da82f70f8b4e Mon Sep 17 00:00:00 2001 +From: jiangfangjie +Date: Sat, 29 Aug 2020 12:09:26 +0800 +Subject: [PATCH 13/14] acpi: Some build_tpm2() code reshape + +Remove any reference to Acpi20TPM2 and adopt an implementation +similar to build_ghes_v2(). + +Signed-off-by: Eric Auger +Suggested-by: Igor Mammedov +Reviewed-by: Stefan Berger +Tested-by: Stefan Berger +Reviewed-by: Igor Mammedov + +Message-Id: <20200622140620.17229-2-eric.auger@redhat.com> +Tested-by: Ard Biesheuvel +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +Signed-off-by: jiangfangjie +--- + hw/acpi/aml-build.c | 51 +++++++++++++++++++++++-------------- + include/hw/acpi/acpi-defs.h | 18 ------------- + tests/bios-tables-test.c | 4 +++ + 3 files changed, 36 insertions(+), 37 deletions(-) + +diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c +index cedfbf64..0c89736a 100644 +--- a/hw/acpi/aml-build.c ++++ b/hw/acpi/aml-build.c +@@ -2097,48 +2097,61 @@ build_hdr: + "FACP", tbl->len - fadt_start, f->rev, oem_id, oem_table_id); + } + ++/* ++ * build_tpm2 - Build the TPM2 table as specified in ++ * table 7: TCG Hardware Interface Description Table Format for TPM 2.0 ++ * of TCG ACPI Specification, Family “1.2” and “2.0”, Version 1.2, Rev 8 ++ */ + void build_tpm2(GArray *table_data, BIOSLinker *linker, GArray *tcpalog) + { +- Acpi20TPM2 *tpm2_ptr = acpi_data_push(table_data, sizeof(AcpiTableHeader)); +- unsigned log_addr_size = sizeof(tpm2_ptr->log_area_start_address); +- unsigned log_addr_offset = +- (char *)&tpm2_ptr->log_area_start_address - table_data->data; + uint8_t start_method_params[12] = {}; ++ unsigned log_addr_offset, tpm2_start; ++ uint64_t control_area_start_address; + TPMIf *tpmif = tpm_find(); ++ uint32_t start_method; ++ void *tpm2_ptr; ++ ++ tpm2_start = table_data->len; ++ tpm2_ptr = acpi_data_push(table_data, sizeof(AcpiTableHeader)); + +- /* platform class */ ++ /* Platform Class */ + build_append_int_noprefix(table_data, TPM2_ACPI_CLASS_CLIENT, 2); +- /* reserved */ ++ /* Reserved */ + build_append_int_noprefix(table_data, 0, 2); + if (TPM_IS_TIS_ISA(tpmif) || TPM_IS_TIS_SYSBUS(tpmif)) { +- /* address of control area */ +- build_append_int_noprefix(table_data, 0, 8); +- /* start method */ +- build_append_int_noprefix(table_data, TPM2_START_METHOD_MMIO, 4); ++ control_area_start_address = 0; ++ start_method = TPM2_START_METHOD_MMIO; + } else if (TPM_IS_CRB(tpmif)) { +- build_append_int_noprefix(table_data, TPM_CRB_ADDR_CTRL, 8); +- build_append_int_noprefix(table_data, TPM2_START_METHOD_CRB, 4); ++ control_area_start_address = TPM_CRB_ADDR_CTRL; ++ start_method = TPM2_START_METHOD_CRB; + } else { +- g_warn_if_reached(); ++ g_assert_not_reached(); + } ++ /* Address of Control Area */ ++ build_append_int_noprefix(table_data, control_area_start_address, 8); ++ /* Start Method */ ++ build_append_int_noprefix(table_data, start_method, 4); + +- /* platform specific parameters */ +- g_array_append_vals(table_data, &start_method_params, 12); ++ /* Platform Specific Parameters */ ++ g_array_append_vals(table_data, &start_method_params, ++ ARRAY_SIZE(start_method_params)); + +- /* log area minimum length */ ++ /* Log Area Minimum Length */ + build_append_int_noprefix(table_data, TPM_LOG_AREA_MINIMUM_SIZE, 4); + + acpi_data_push(tcpalog, TPM_LOG_AREA_MINIMUM_SIZE); + bios_linker_loader_alloc(linker, ACPI_BUILD_TPMLOG_FILE, tcpalog, 1, + false); + +- /* log area start address to be filled by Guest linker */ ++ log_addr_offset = table_data->len; ++ ++ /* Log Area Start Address to be filled by Guest linker */ + build_append_int_noprefix(table_data, 0, 8); + bios_linker_loader_add_pointer(linker, ACPI_BUILD_TABLE_FILE, +- log_addr_offset, log_addr_size, ++ log_addr_offset, 8, + ACPI_BUILD_TPMLOG_FILE, 0); + build_header(linker, table_data, +- (void *)tpm2_ptr, "TPM2", sizeof(*tpm2_ptr), 4, NULL, NULL); ++ tpm2_ptr, "TPM2", table_data->len - tpm2_start, 4, NULL, NULL); + } + + +diff --git a/include/hw/acpi/acpi-defs.h b/include/hw/acpi/acpi-defs.h +index 6bfa7f91..8fb17fc9 100644 +--- a/include/hw/acpi/acpi-defs.h ++++ b/include/hw/acpi/acpi-defs.h +@@ -464,24 +464,6 @@ struct Acpi20Tcpa { + } QEMU_PACKED; + typedef struct Acpi20Tcpa Acpi20Tcpa; + +-/* +- * TPM2 +- * +- * Following Version 1.2, Revision 8 of specs: +- * https://trustedcomputinggroup.org/tcg-acpi-specification/ +- */ +-struct Acpi20TPM2 { +- ACPI_TABLE_HEADER_DEF +- uint16_t platform_class; +- uint16_t reserved; +- uint64_t control_area_address; +- uint32_t start_method; +- uint8_t start_method_params[12]; +- uint32_t log_area_minimum_length; +- uint64_t log_area_start_address; +-} QEMU_PACKED; +-typedef struct Acpi20TPM2 Acpi20TPM2; +- + /* DMAR - DMA Remapping table r2.2 */ + struct AcpiTableDmar { + ACPI_TABLE_HEADER_DEF +diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c +index a23b1420..87d50463 100644 +--- a/tests/bios-tables-test.c ++++ b/tests/bios-tables-test.c +@@ -869,6 +869,7 @@ uint64_t tpm_tis_base_addr; + static void test_acpi_tcg_tpm(const char *machine, const char *tpm_if, + uint64_t base) + { ++#ifdef CONFIG_TPM + gchar *tmp_dir_name = g_strdup_printf("qemu-test_acpi_%s_tcg_%s.XXXXXX", + machine, tpm_if); + char *tmp_path = g_dir_make_tmp(tmp_dir_name, NULL); +@@ -911,6 +912,9 @@ static void test_acpi_tcg_tpm(const char *machine, const char *tpm_if, + g_free(tmp_path); + g_free(tmp_dir_name); + free_test_data(&data); ++#else ++ g_test_skip("TPM disabled"); ++#endif + } + + static void test_acpi_q35_tcg_tpm_tis(void) +-- +2.23.0 + diff --git a/acpi-tpm-Do-not-build-TCPA-table-for-TPM-2.patch b/acpi-tpm-Do-not-build-TCPA-table-for-TPM-2.patch new file mode 100644 index 0000000000000000000000000000000000000000..1c2320f74dca381968a35173921f6aac843bfc39 --- /dev/null +++ b/acpi-tpm-Do-not-build-TCPA-table-for-TPM-2.patch @@ -0,0 +1,57 @@ +From c25ea1294cf74f220dcb92f280b6d5a339969c5e Mon Sep 17 00:00:00 2001 +From: jiangfangjie +Date: Thu, 27 Aug 2020 11:59:32 +0800 +Subject: [PATCH 03/14] acpi: tpm: Do not build TCPA table for TPM 2 + MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 + Content-Transfer-Encoding: 8bit +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +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 +Reviewed-by: Marc-André Lureau +Reviewed-by: Eric Auger +Reviewed-by: Igor Mammedov +Signed-off-by: Michael S. Tsirkin +Reviewed-by: Michael S. Tsirkin +Signed-off-by: jiangfangjie +--- + 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 093f7d93..652f7c7d 100644 +--- a/hw/i386/acpi-build.c ++++ b/hw/i386/acpi-build.c +@@ -2298,6 +2298,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, +@@ -2686,10 +2690,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.23.0 + diff --git a/arm-acpi-Add-the-TPM2.0-device-under-the-DSDT.patch b/arm-acpi-Add-the-TPM2.0-device-under-the-DSDT.patch new file mode 100644 index 0000000000000000000000000000000000000000..48f5960d0d8745cac875cf2ead151aafb40d7ea5 --- /dev/null +++ b/arm-acpi-Add-the-TPM2.0-device-under-the-DSDT.patch @@ -0,0 +1,85 @@ +From 0ef53f50b6b1ff1212605358cf58d6d1a9cffc48 Mon Sep 17 00:00:00 2001 +From: jiangfangjie +Date: Sat, 29 Aug 2020 14:29:30 +0800 +Subject: [PATCH 14/14] arm/acpi: Add the TPM2.0 device under the DSDT + +In case it is dynamically instantiated, add the TPM 2.0 device object +under the DSDT table in the ACPI namespace. Its HID is MSFT0101 +while its current resource settings (CRS) property is initialized +with the guest physical address and MMIO size of the device. + +Signed-off-by: Eric Auger +Reviewed-by: Stefan Berger +Reviewed-by: Igor Mammedov + +Message-Id: <20200622140620.17229-3-eric.auger@redhat.com> +Tested-by: Ard Biesheuvel +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +Signed-off-by: jiangfangjie +--- + hw/arm/virt-acpi-build.c | 34 ++++++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c +index 669abcb3..cb0bd3b5 100644 +--- a/hw/arm/virt-acpi-build.c ++++ b/hw/arm/virt-acpi-build.c +@@ -48,6 +48,7 @@ + #include "sysemu/numa.h" + #include "sysemu/tpm.h" + #include "hw/acpi/tpm.h" ++#include "hw/platform-bus.h" + #include "kvm_arm.h" + #include "hw/acpi/acpi-defs.h" + +@@ -455,6 +456,38 @@ static void acpi_dsdt_add_power_button(Aml *scope) + aml_append(scope, dev); + } + ++static void acpi_dsdt_add_tpm(Aml *scope, VirtMachineState *vms) ++{ ++ PlatformBusDevice *pbus = PLATFORM_BUS_DEVICE(vms->platform_bus_dev); ++ hwaddr pbus_base = vms->memmap[VIRT_PLATFORM_BUS].base; ++ SysBusDevice *sbdev = SYS_BUS_DEVICE(tpm_find()); ++ MemoryRegion *sbdev_mr; ++ hwaddr tpm_base; ++ ++ if (!sbdev) { ++ return; ++ } ++ ++ tpm_base = platform_bus_get_mmio_addr(pbus, sbdev, 0); ++ assert(tpm_base != -1); ++ ++ tpm_base += pbus_base; ++ ++ sbdev_mr = sysbus_mmio_get_region(sbdev, 0); ++ ++ Aml *dev = aml_device("TPM0"); ++ aml_append(dev, aml_name_decl("_HID", aml_string("MSFT0101"))); ++ aml_append(dev, aml_name_decl("_UID", aml_int(0))); ++ ++ Aml *crs = aml_resource_template(); ++ aml_append(crs, ++ aml_memory32_fixed(tpm_base, ++ (uint32_t)memory_region_size(sbdev_mr), ++ AML_READ_WRITE)); ++ aml_append(dev, aml_name_decl("_CRS", crs)); ++ aml_append(scope, dev); ++} ++ + static void + build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) + { +@@ -887,6 +920,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) + } + + acpi_dsdt_add_power_button(scope); ++ acpi_dsdt_add_tpm(scope, vms); + + aml_append(dsdt, scope); + +-- +2.23.0 + diff --git a/arm-acpi-TPM2-ACPI-table-support.patch b/arm-acpi-TPM2-ACPI-table-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..c3abf208277b3ec7448640c900e0c5b0a9f7b92a --- /dev/null +++ b/arm-acpi-TPM2-ACPI-table-support.patch @@ -0,0 +1,86 @@ +From 2caff8e9b2dbdf70d486d525614bc4545e2ab19d Mon Sep 17 00:00:00 2001 +From: jiangfangjie +Date: Sat, 29 Aug 2020 10:38:44 +0800 +Subject: [PATCH 07/14] arm/acpi: TPM2 ACPI table support + +Add a TPM2 ACPI table if a TPM2.0 sysbus device has been +dynamically instantiated. + +Signed-off-by: Eric Auger + +Message-Id: <20200601095737.32671-4-eric.auger@redhat.com> +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +Signed-off-by: jiangfangjie +--- + hw/acpi/aml-build.c | 5 +++-- + hw/arm/virt-acpi-build.c | 7 +++++++ + include/sysemu/tpm.h | 2 ++ + 3 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c +index 09ab4332..cedfbf64 100644 +--- a/hw/acpi/aml-build.c ++++ b/hw/acpi/aml-build.c +@@ -2104,17 +2104,18 @@ void build_tpm2(GArray *table_data, BIOSLinker *linker, GArray *tcpalog) + unsigned log_addr_offset = + (char *)&tpm2_ptr->log_area_start_address - table_data->data; + uint8_t start_method_params[12] = {}; ++ TPMIf *tpmif = tpm_find(); + + /* platform class */ + build_append_int_noprefix(table_data, TPM2_ACPI_CLASS_CLIENT, 2); + /* reserved */ + build_append_int_noprefix(table_data, 0, 2); +- if (TPM_IS_TIS_ISA(tpm_find())) { ++ if (TPM_IS_TIS_ISA(tpmif) || TPM_IS_TIS_SYSBUS(tpmif)) { + /* address of control area */ + build_append_int_noprefix(table_data, 0, 8); + /* start method */ + build_append_int_noprefix(table_data, TPM2_START_METHOD_MMIO, 4); +- } else if (TPM_IS_CRB(tpm_find())) { ++ } else if (TPM_IS_CRB(tpmif)) { + build_append_int_noprefix(table_data, TPM_CRB_ADDR_CTRL, 8); + build_append_int_noprefix(table_data, TPM2_START_METHOD_CRB, 4); + } else { +diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c +index 588e7f26..669abcb3 100644 +--- a/hw/arm/virt-acpi-build.c ++++ b/hw/arm/virt-acpi-build.c +@@ -46,6 +46,8 @@ + #include "hw/pci/pci.h" + #include "hw/arm/virt.h" + #include "sysemu/numa.h" ++#include "sysemu/tpm.h" ++#include "hw/acpi/tpm.h" + #include "kvm_arm.h" + #include "hw/acpi/acpi-defs.h" + +@@ -972,6 +974,11 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables) + build_iort(tables_blob, tables->linker, vms); + } + ++ if (tpm_get_version(tpm_find()) == TPM_VERSION_2_0) { ++ acpi_add_table(table_offsets, tables_blob); ++ build_tpm2(tables_blob, tables->linker, tables->tcpalog); ++ } ++ + /* XSDT is pointed to by RSDP */ + xsdt = tables_blob->len; + build_xsdt(tables_blob, tables->linker, table_offsets, NULL, NULL); +diff --git a/include/sysemu/tpm.h b/include/sysemu/tpm.h +index f37851b1..03fb2594 100644 +--- a/include/sysemu/tpm.h ++++ b/include/sysemu/tpm.h +@@ -50,6 +50,8 @@ typedef struct TPMIfClass { + + #define TPM_IS_TIS_ISA(chr) \ + object_dynamic_cast(OBJECT(chr), TYPE_TPM_TIS_ISA) ++#define TPM_IS_TIS_SYSBUS(chr) \ ++ object_dynamic_cast(OBJECT(chr), TYPE_TPM_TIS_SYSBUS) + #define TPM_IS_CRB(chr) \ + object_dynamic_cast(OBJECT(chr), TYPE_TPM_CRB) + #define TPM_IS_SPAPR(chr) \ +-- +2.23.0 + diff --git a/bios-tables-test-Add-Q35-TPM-TIS-test.patch b/bios-tables-test-Add-Q35-TPM-TIS-test.patch new file mode 100644 index 0000000000000000000000000000000000000000..3f509c21aff9c618a57c1c95fb8ffe0fa6e1bde5 --- /dev/null +++ b/bios-tables-test-Add-Q35-TPM-TIS-test.patch @@ -0,0 +1,106 @@ +From 0a33ff4783fd557f3ad518992a18cef7e7dfd017 Mon Sep 17 00:00:00 2001 +From: jiangfangjie +Date: Sat, 29 Aug 2020 10:52:28 +0800 +Subject: [PATCH 11/14] bios-tables-test: Add Q35/TPM-TIS test + +Test tables specific to the TPM-TIS instantiation. +The TPM2 is added in the framework. Also the DSDT +is updated with the TPM. The new function should be +be usable for CRB as well, later one. + +Signed-off-by: Eric Auger + +Message-Id: <20200609125409.24179-5-eric.auger@redhat.com> +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +Signed-off-by: jiangfangjie +--- + tests/bios-tables-test.c | 58 ++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 58 insertions(+) + +diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c +index d47ee9be..a23b1420 100644 +--- a/tests/bios-tables-test.c ++++ b/tests/bios-tables-test.c +@@ -44,6 +44,9 @@ + #include "qemu/bitmap.h" + #include "acpi-utils.h" + #include "boot-sector.h" ++#include "tpm-emu.h" ++#include "hw/acpi/tpm.h" ++ + + #define MACHINE_PC "pc" + #define MACHINE_Q35 "q35" +@@ -861,6 +864,60 @@ static void test_acpi_piix4_tcg_numamem(void) + free_test_data(&data); + } + ++uint64_t tpm_tis_base_addr; ++ ++static void test_acpi_tcg_tpm(const char *machine, const char *tpm_if, ++ uint64_t base) ++{ ++ gchar *tmp_dir_name = g_strdup_printf("qemu-test_acpi_%s_tcg_%s.XXXXXX", ++ machine, tpm_if); ++ char *tmp_path = g_dir_make_tmp(tmp_dir_name, NULL); ++ TestState test; ++ test_data data; ++ GThread *thread; ++ char *args, *variant = g_strdup_printf(".%s", tpm_if); ++ ++ tpm_tis_base_addr = base; ++ ++ module_call_init(MODULE_INIT_QOM); ++ ++ test.addr = g_new0(SocketAddress, 1); ++ test.addr->type = SOCKET_ADDRESS_TYPE_UNIX; ++ test.addr->u.q_unix.path = g_build_filename(tmp_path, "sock", NULL); ++ g_mutex_init(&test.data_mutex); ++ g_cond_init(&test.data_cond); ++ test.data_cond_signal = false; ++ ++ thread = g_thread_new(NULL, tpm_emu_ctrl_thread, &test); ++ tpm_emu_test_wait_cond(&test); ++ ++ memset(&data, 0, sizeof(data)); ++ data.machine = machine; ++ data.variant = variant; ++ ++ args = g_strdup_printf( ++ " -chardev socket,id=chr,path=%s" ++ " -tpmdev emulator,id=dev,chardev=chr" ++ " -device tpm-%s,tpmdev=dev", ++ test.addr->u.q_unix.path, tpm_if); ++ ++ test_acpi_one(args, &data); ++ ++ g_thread_join(thread); ++ g_unlink(test.addr->u.q_unix.path); ++ qapi_free_SocketAddress(test.addr); ++ g_rmdir(tmp_path); ++ g_free(variant); ++ g_free(tmp_path); ++ g_free(tmp_dir_name); ++ free_test_data(&data); ++} ++ ++static void test_acpi_q35_tcg_tpm_tis(void) ++{ ++ test_acpi_tcg_tpm("q35", "tis", 0xFED40000); ++} ++ + static void test_acpi_tcg_dimm_pxm(const char *machine) + { + test_data data; +@@ -977,6 +1034,7 @@ int main(int argc, char *argv[]) + return ret; + } + ++ qtest_add_func("acpi/q35/tpm-tis", test_acpi_q35_tcg_tpm_tis); + qtest_add_func("acpi/piix4", test_acpi_piix4_tcg); + qtest_add_func("acpi/piix4/bridge", test_acpi_piix4_tcg_bridge); + qtest_add_func("acpi/q35", test_acpi_q35_tcg); +-- +2.23.0 + diff --git a/bios-tables-test-Generate-reference-tables-for.patch b/bios-tables-test-Generate-reference-tables-for.patch new file mode 100644 index 0000000000000000000000000000000000000000..6a32396c5858939c5d347cad16f0a88dbf7bb298 --- /dev/null +++ b/bios-tables-test-Generate-reference-tables-for.patch @@ -0,0 +1,34 @@ +From 3f84451f0bcc458ec48b27446d67b2b206212f0a Mon Sep 17 00:00:00 2001 +From: jiangfangjie +Date: Sat, 29 Aug 2020 10:55:41 +0800 +Subject: [PATCH 12/14] bios-tables-test: Generate reference tables for + Q35/TPM-TIS + +TPM2, DSDT tables were generated using +tests/data/acpi/rebuild-expected-aml.sh + +Signed-off-by: Eric Auger +Reviewed-by: Stefan Berger +Message-Id: <20200609125409.24179-6-eric.auger@redhat.com> + +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +--- + tests/bios-tables-test-allowed-diff.h | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/tests/bios-tables-test-allowed-diff.h b/tests/bios-tables-test-allowed-diff.h +index a410c8a0..3776dd2f 100644 +--- a/tests/bios-tables-test-allowed-diff.h ++++ b/tests/bios-tables-test-allowed-diff.h +@@ -1,6 +1,4 @@ + /* List of comma-separated changed AML files to ignore */ +-"tests/data/acpi/q35/DSDT.tis", +-"tests/data/acpi/q35/TPM2.tis", + "tests/data/acpi/virt/DSDT", + "tests/data/acpi/virt/APIC.memhp", + "tests/data/acpi/virt/APIC.numamem", +-- +2.23.0 + diff --git a/hw-arm-virt-Remove-the-compat-forcing-tpm-tis-device.patch b/hw-arm-virt-Remove-the-compat-forcing-tpm-tis-device.patch new file mode 100644 index 0000000000000000000000000000000000000000..c6997d7d0ec6d46010ccd1086f78bc419a9c51f0 --- /dev/null +++ b/hw-arm-virt-Remove-the-compat-forcing-tpm-tis-device.patch @@ -0,0 +1,38 @@ +From b13d31ca17cc22c79b2dc29abd030802e4cc36f4 Mon Sep 17 00:00:00 2001 +From: Eric Auger +Date: Mon, 27 Apr 2020 16:31:45 +0200 +Subject: [PATCH 18/30] hw/arm/virt: Remove the compat forcing tpm-tis-device + PPI to off + +Now that the tpm-tis-device device PPI property is off by default, +we can remove the compat used for the same goal. + +Signed-off-by: Eric Auger +Reviewed-by: Cornelia Huck +Reviewed-by: Stefan Berger +Reviewed-by: Peter Maydell +Signed-off-by: Stefan Berger +Message-id: 20200427143145.16251-3-eric.auger@redhat.com +--- + hw/arm/virt.c | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/hw/arm/virt.c b/hw/arm/virt.c +index 171e6908ec..dd024d0780 100644 +--- a/hw/arm/virt.c ++++ b/hw/arm/virt.c +@@ -2354,11 +2354,6 @@ type_init(machvirt_machine_init); + + static void virt_machine_4_1_options(MachineClass *mc) + { +- static GlobalProperty compat[] = { +- { TYPE_TPM_TIS_SYSBUS, "ppi", "false" }, +- }; +- +- compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); + } + DEFINE_VIRT_MACHINE_AS_LATEST(4, 1) + +-- +2.23.0 + diff --git a/qemu.spec b/qemu.spec index 4cc8931fde215812906782b26c52c8d915d8e997..c546ba1846ba2897887dd561a91bee0e59a7c078 100644 --- a/qemu.spec +++ b/qemu.spec @@ -1,6 +1,6 @@ Name: qemu Version: 4.1.0 -Release: 22 +Release: 23 Epoch: 2 Summary: QEMU is a generic and open source machine emulator and virtualizer License: GPLv2 and BSD and MIT and CC-BY @@ -227,6 +227,19 @@ Patch0214: target-arm-Add-CPU-features-to-query-cpu-model-expan.patch Patch0215: target-arm-Update-ID-fields.patch Patch0216: target-arm-Add-more-CPU-features.patch Patch0217: hw-usb-core-fix-buffer-overflow.patch +Patch0218: tpm-tpm-tis-device-set-PPI-to-false-by-default.patch +Patch0219: hw-arm-virt-Remove-the-compat-forcing-tpm-tis-device.patch +Patch0220: acpi-tpm-Do-not-build-TCPA-table-for-TPM-2.patch +Patch0221: acpi-Convert-build_tpm2-to-build_append-API.patch +Patch0222: acpi-Move-build_tpm2-in-the-generic-part.patch +Patch0223: arm-acpi-TPM2-ACPI-table-support.patch +Patch0224: test-tpm-emu-include-sockets-and-channel-headers-in.patch +Patch0225: tests-acpi-Add-void-tables-for-Q35-TPM-TIS.patch +Patch0226: tests-tpm-emu-Remove-assert-on-TPM2_ST_NO_SESSIONS.patch +Patch0227: bios-tables-test-Add-Q35-TPM-TIS-test.patch +Patch0228: bios-tables-test-Generate-reference-tables-for.patch +Patch0229: acpi-Some-build_tpm2-code-reshape.patch +Patch0230: arm-acpi-Add-the-TPM2.0-device-under-the-DSDT.patch BuildRequires: flex BuildRequires: bison @@ -573,6 +586,9 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Fri Aug 28 2020 Huawei Technologies Co., Ltd +- target/arm: vtpm support acpi + * Fri Aug 21 2020 Huawei Technologies Co., Ltd - hw/usb/core.c: fix buffer overflow in do_token_setup function diff --git a/test-tpm-emu-include-sockets-and-channel-headers-in.patch b/test-tpm-emu-include-sockets-and-channel-headers-in.patch new file mode 100644 index 0000000000000000000000000000000000000000..9b6f5f951b4132600ea7c41d09e861eefc5770e7 --- /dev/null +++ b/test-tpm-emu-include-sockets-and-channel-headers-in.patch @@ -0,0 +1,34 @@ +From 8e67eed68f5f7db4a43bfd7556ed13d6b7da9b68 Mon Sep 17 00:00:00 2001 +From: jiangfangjie +Date: Sat, 29 Aug 2020 10:41:15 +0800 +Subject: [PATCH 08/14] test/tpm-emu: include sockets and channel headers in + tpm-emu header + +Include sockets and channel headers to that the header is +self-contained. + +Signed-off-by: Eric Auger +Reviewed-by: Stefan Berger +Message-Id: <20200609125409.24179-2-eric.auger@redhat.com> +Signed-off-by: jiangfangjie +--- + tests/tpm-emu.h | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/tests/tpm-emu.h b/tests/tpm-emu.h +index a4f1d642..73f3bed0 100644 +--- a/tests/tpm-emu.h ++++ b/tests/tpm-emu.h +@@ -16,6 +16,9 @@ + #define TPM_RC_FAILURE 0x101 + #define TPM2_ST_NO_SESSIONS 0x8001 + ++#include "qemu/sockets.h" ++#include "io/channel.h" ++ + struct tpm_hdr { + uint16_t tag; + uint32_t len; +-- +2.23.0 + diff --git a/tests-acpi-Add-void-tables-for-Q35-TPM-TIS.patch b/tests-acpi-Add-void-tables-for-Q35-TPM-TIS.patch new file mode 100644 index 0000000000000000000000000000000000000000..56678414342c81ac9eda66af9bb853df3a011db9 --- /dev/null +++ b/tests-acpi-Add-void-tables-for-Q35-TPM-TIS.patch @@ -0,0 +1,41 @@ +From 1e0a8b3652c81f38c5159dd035ee6381b22818aa Mon Sep 17 00:00:00 2001 +From: jiangfangjie +Date: Sat, 29 Aug 2020 10:45:39 +0800 +Subject: [PATCH 09/14] tests/acpi: Add void tables for Q35/TPM-TIS + bios-tables-test + +Add placeholders for TPM and DSDT reference tables for +Q35 TPM-TIS tests and ignore them for the time being. + +Signed-off-by: Eric Auger +Reviewed-by: Stefan Berger +Reviewed-by: Igor Mammedov +Signed-off-by: jiangfangjie +--- + tests/bios-tables-test-allowed-diff.h | 2 ++ + tests/data/acpi/q35/DSDT.tis | 0 + tests/data/acpi/q35/TPM2.tis | 0 + 3 files changed, 2 insertions(+) + create mode 100644 tests/data/acpi/q35/DSDT.tis + create mode 100644 tests/data/acpi/q35/TPM2.tis + +diff --git a/tests/bios-tables-test-allowed-diff.h b/tests/bios-tables-test-allowed-diff.h +index 3776dd2f..a410c8a0 100644 +--- a/tests/bios-tables-test-allowed-diff.h ++++ b/tests/bios-tables-test-allowed-diff.h +@@ -1,4 +1,6 @@ + /* List of comma-separated changed AML files to ignore */ ++"tests/data/acpi/q35/DSDT.tis", ++"tests/data/acpi/q35/TPM2.tis", + "tests/data/acpi/virt/DSDT", + "tests/data/acpi/virt/APIC.memhp", + "tests/data/acpi/virt/APIC.numamem", +diff --git a/tests/data/acpi/q35/DSDT.tis b/tests/data/acpi/q35/DSDT.tis +new file mode 100644 +index 00000000..e69de29b +diff --git a/tests/data/acpi/q35/TPM2.tis b/tests/data/acpi/q35/TPM2.tis +new file mode 100644 +index 00000000..e69de29b +-- +2.23.0 + diff --git a/tests-tpm-emu-Remove-assert-on-TPM2_ST_NO_SESSIONS.patch b/tests-tpm-emu-Remove-assert-on-TPM2_ST_NO_SESSIONS.patch new file mode 100644 index 0000000000000000000000000000000000000000..093a3d862a88a94c5be01db8f23574ee752c8b45 --- /dev/null +++ b/tests-tpm-emu-Remove-assert-on-TPM2_ST_NO_SESSIONS.patch @@ -0,0 +1,42 @@ +From dd2f139ad76910c7c33c3fbcb7c7f7762592a047 Mon Sep 17 00:00:00 2001 +From: jiangfangjie +Date: Sat, 29 Aug 2020 10:49:19 +0800 +Subject: [PATCH 10/14] tests: tpm-emu: Remove assert on TPM2_ST_NO_SESSIONS + +bios-tables-test executes SeaBIOS. Indeed FW is needed to +fetch tables from QEMU and put them into the guest RAM. Also +the FW patches cross table pointers. At some point, SeaBIOS +ends up calling the TPM2_CC_HierarchyControl command with +TPM2_ST_SESSIONS tag, most probably steming from +tpm_set_failure/tpm20_hierarchycontrol SeaBIOS call path. +This causes an assert() in the qtest tpm emulation code. + +As the goal here is not to boot SeaBIOS completely but just +let it grab the ACPI tables and consolidate them, let's just +remove the assert(). + +Signed-off-by: Eric Auger + +Message-Id: <20200609125409.24179-4-eric.auger@redhat.com> +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +Signed-off-by: jiangfangjie +--- + tests/tpm-emu.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/tests/tpm-emu.c b/tests/tpm-emu.c +index 125e6971..b88960c0 100644 +--- a/tests/tpm-emu.c ++++ b/tests/tpm-emu.c +@@ -49,7 +49,6 @@ static void *tpm_emu_tpm_thread(void *data) + s->tpm_msg->tag = be16_to_cpu(s->tpm_msg->tag); + s->tpm_msg->len = be32_to_cpu(s->tpm_msg->len); + g_assert_cmpint(s->tpm_msg->len, >=, minhlen); +- g_assert_cmpint(s->tpm_msg->tag, ==, TPM2_ST_NO_SESSIONS); + + s->tpm_msg = g_realloc(s->tpm_msg, s->tpm_msg->len); + qio_channel_read(ioc, (char *)&s->tpm_msg->code, +-- +2.23.0 + diff --git a/tpm-tpm-tis-device-set-PPI-to-false-by-default.patch b/tpm-tpm-tis-device-set-PPI-to-false-by-default.patch new file mode 100644 index 0000000000000000000000000000000000000000..8710a2f5f3214839c75c12b5856674b330783e09 --- /dev/null +++ b/tpm-tpm-tis-device-set-PPI-to-false-by-default.patch @@ -0,0 +1,36 @@ +From 291a63d7eebb1250cda40ff3adbbc5104b784335 Mon Sep 17 00:00:00 2001 +From: jiangfangjie +Date: Mon, 24 Aug 2020 16:16:35 +0800 +Subject: [PATCH 01/14] tpm: tpm-tis-device: set PPI to false by default + +The tpm-tis-device device does not support PPI. Let's +change the default value for the corresponding property +instead of tricking this latter in the mach-virt machine. + +Signed-off-by: Eric Auger +Reviewed-by: Cornelia Huck +Reviewed-by: Stefan Berger +Reviewed-by: Peter Maydell +Signed-off-by: Stefan Berger +Message-id: 20200427143145.16251-2-eric.auger@redhat.com +Signed-off-by: jiangfangjie +--- + hw/tpm/tpm_tis_sysbus.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/tpm/tpm_tis_sysbus.c b/hw/tpm/tpm_tis_sysbus.c +index 4deabc74..a4487f86 100644 +--- a/hw/tpm/tpm_tis_sysbus.c ++++ b/hw/tpm/tpm_tis_sysbus.c +@@ -91,7 +91,7 @@ static void tpm_tis_sysbus_reset(DeviceState *dev) + static Property tpm_tis_sysbus_properties[] = { + DEFINE_PROP_UINT32("irq", TPMStateSysBus, state.irq_num, TPM_TIS_IRQ), + DEFINE_PROP_TPMBE("tpmdev", TPMStateSysBus, state.be_driver), +- DEFINE_PROP_BOOL("ppi", TPMStateSysBus, state.ppi_enabled, true), ++ DEFINE_PROP_BOOL("ppi", TPMStateSysBus, state.ppi_enabled, false), + DEFINE_PROP_END_OF_LIST(), + }; + +-- +2.23.0 +