[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 09/49] tests: acpi: make sure FADT is fetched only
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL v2 09/49] tests: acpi: make sure FADT is fetched only once |
Date: |
Tue, 15 Jan 2019 15:04:30 -0500 |
From: Igor Mammedov <address@hidden>
Whole FADT is fetched as part of RSDT referenced tables in
fetch_rsdt_referenced_tables() albeit a bit later than when FADT
is partially parsed in fadt_fetch_facs_and_dsdt_ptrs().
However there is no reason for calling fetch_rsdt_referenced_tables()
so late, just move it right after we fetched RSDT and before
fadt_fetch_facs_and_dsdt_ptrs(). That way we can reuse whole FADT
fetched by fetch_rsdt_referenced_tables() and avoid duplicate
custom fields fetching in fadt_fetch_facs_and_dsdt_ptrs().
While at it rename fadt_fetch_facs_and_dsdt_ptrs() to
test_acpi_fadt_table(). The follow up patch will merge
fadt_fetch_facs_and_dsdt_ptrs() into test_acpi_rsdt_table(),
so that we would end up calling only test_acpi_FOO_table()
for consistency for tables that require special processing.
Signed-off-by: Igor Mammedov <address@hidden>
Acked-by: Thomas Huth <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
tests/bios-tables-test.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
index 3f20bbd24e..b2a40bbda3 100644
--- a/tests/bios-tables-test.c
+++ b/tests/bios-tables-test.c
@@ -141,18 +141,15 @@ static void test_acpi_rsdt_table(test_data *data)
data->rsdt_tables_nr = tables_nr;
}
-static void fadt_fetch_facs_and_dsdt_ptrs(test_data *data)
+static void test_acpi_fadt_table(test_data *data)
{
- uint32_t addr;
- AcpiTableHeader hdr;
+ /* FADT table is 1st */
+ AcpiSdtTable *fadt = &g_array_index(data->tables, typeof(*fadt), 0);
- /* FADT table comes first */
- addr = le32_to_cpu(data->rsdt_tables_addr[0]);
- ACPI_READ_TABLE_HEADER(data->qts, &hdr, addr);
- ACPI_ASSERT_CMP(hdr.signature, "FACP");
+ ACPI_ASSERT_CMP(fadt->header->signature, "FACP");
- ACPI_READ_FIELD(data->qts, data->facs_addr, addr);
- ACPI_READ_FIELD(data->qts, data->dsdt_addr, addr);
+ memcpy(&data->facs_addr, fadt->aml + 36 /* FIRMWARE_CTRL */, 4);
+ memcpy(&data->dsdt_addr, fadt->aml + 40 /* DSDT */, 4);
}
static void sanitize_fadt_ptrs(test_data *data)
@@ -628,10 +625,10 @@ static void test_acpi_one(const char *params, test_data
*data)
test_acpi_rsdp_address(data);
test_acpi_rsdp_table(data);
test_acpi_rsdt_table(data);
- fadt_fetch_facs_and_dsdt_ptrs(data);
+ fetch_rsdt_referenced_tables(data);
+ test_acpi_fadt_table(data);
test_acpi_facs_table(data);
test_acpi_dsdt_table(data);
- fetch_rsdt_referenced_tables(data);
sanitize_fadt_ptrs(data);
--
MST
- [Qemu-devel] [PULL v2 00/49] pci, pc, virtio: fixes, features, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 02/49] msix: make pba size math more uniform, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 01/49] pci/pcie: stop plug/unplug if the slot is locked, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 03/49] hw/misc/ivshmem: Remove deprecated "ivshmem" legacy device, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 07/49] util: check the return value of fcntl in qemu_set_{block, nonblock}, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 14/49] tests: acpi: squash sanitize_fadt_ptrs() into test_acpi_fadt_table(), Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 06/49] vhost-user: fix ioeventfd_enabled, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 05/49] tests: vhost-user-test: initialize 'fd' in chr_read, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 13/49] tests: smbios: fetch whole table in one step instead of reading it step by step, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 08/49] tests: acpi: use AcpiSdtTable::aml in consistent way, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 09/49] tests: acpi: make sure FADT is fetched only once,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL v2 15/49] tests: acpi: use AcpiSdtTable::aml instead of AcpiSdtTable::header::signature, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 12/49] tests: acpi: reuse fetch_table() in vmgenid-test, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 11/49] tests: acpi: reuse fetch_table() for fetching FACS and DSDT, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 10/49] tests: acpi: simplify rsdt handling, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 04/49] qemu: avoid memory leak while remove disk, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 16/49] virtio-net: support RSC v4/v6 tcp traffic for Windows HCK, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 17/49] virtio-net: changed VIRTIO_NET_F_RSC_EXT to be 61, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 18/49] virtio: split vhost vsock bits from virtio-pci, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 31/49] virtio: split virtio gpu bits from virtio-pci.h, Michael S. Tsirkin, 2019/01/15
- [Qemu-devel] [PULL v2 26/49] virtio: split vhost scsi bits from virtio-pci, Michael S. Tsirkin, 2019/01/15