[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 20/25] tpm: apci: cleanup TCPA table initialization
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 20/25] tpm: apci: cleanup TCPA table initialization |
Date: |
Sun, 5 Jun 2016 16:21:55 +0300 |
From: Igor Mammedov <address@hidden>
At the time build_tpm_tcpa() is called the tcpalog size is
always 0, so log_area_start_address which is actually offset
from the start of ACPI_BUILD_TPMLOG_FILE is always 0.
Also as 'TCPA' is allocated 0 filled, there is no point
in calculating always 0 log_area_start_address and set
tcpa->log_area_start_address to it since the field should
always point to start of ACPI_BUILD_TPMLOG_FILE.
Make code easier to read dropping not needed offset
calculations.
While at that move tcpalog allocation closer to the code
that defines its size.
Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/i386/acpi-build.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 5aa70c1..1e8364a 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -2258,11 +2258,10 @@ static void
build_tpm_tcpa(GArray *table_data, BIOSLinker *linker, GArray *tcpalog)
{
Acpi20Tcpa *tcpa = acpi_data_push(table_data, sizeof *tcpa);
- uint64_t log_area_start_address = acpi_data_len(tcpalog);
tcpa->platform_class = cpu_to_le16(TPM_TCPA_ACPI_CLASS_CLIENT);
tcpa->log_area_minimum_length = cpu_to_le32(TPM_LOG_AREA_MINIMUM_SIZE);
- tcpa->log_area_start_address = cpu_to_le64(log_area_start_address);
+ acpi_data_push(tcpalog, le32_to_cpu(tcpa->log_area_minimum_length));
bios_linker_loader_alloc(linker, ACPI_BUILD_TPMLOG_FILE, tcpalog, 1,
false /* high memory */);
@@ -2275,8 +2274,6 @@ build_tpm_tcpa(GArray *table_data, BIOSLinker *linker,
GArray *tcpalog)
build_header(linker, table_data,
(void *)tcpa, "TCPA", sizeof(*tcpa), 2, NULL, NULL);
-
- acpi_data_push(tcpalog, TPM_LOG_AREA_MINIMUM_SIZE);
}
static void
--
MST
- [Qemu-devel] [PULL 06/25] pc: acpi: consolidate \GPE._E02 with the rest of CPU hotplug AML, (continued)
- [Qemu-devel] [PULL 06/25] pc: acpi: consolidate \GPE._E02 with the rest of CPU hotplug AML, Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 10/25] pc: acpi: simplify build_legacy_cpu_hotplug_aml() signature, Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 08/25] pc: acpi: mark current CPU hotplug functions as legacy, Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 09/25] pc: acpi: consolidate legacy CPU hotplug in one file, Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 11/25] pc: acpi: cpuhp-legacy: switch ProcessorID to possible_cpus idx, Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 12/25] tests: acpi: update tables with consolidated legacy cpu-hotplug AML, Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 13/25] ipmi: rework the fwinfo to be fetched from the interface, Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 14/25] pc: Postpone SMBIOS table installation to post machine init, Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 15/25] acpi: extend ACPI interface to provide send_event hook, Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 16/25] pc: use AcpiDeviceIfClass.send_event to issue GPE events, Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 20/25] tpm: apci: cleanup TCPA table initialization,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 19/25] acpi: cleanup bios_linker_loader_cleanup(), Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 17/25] acpi: convert linker from GArray to BIOSLinker structure, Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 23/25] pc-dimm: get memory region from ->get_memory_region(), Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 18/25] acpi: simplify bios_linker API by removing redundant 'table' argument, Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 24/25] pc-dimm: introduce realize callback, Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 22/25] acpi: make bios_linker_loader_add_checksum() API offset based, Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 21/25] acpi: make bios_linker_loader_add_pointer() API offset based, Michael S. Tsirkin, 2016/06/05
- [Qemu-devel] [PULL 25/25] virtio: move bi-endian target support to a single location, Michael S. Tsirkin, 2016/06/05