From dc33c0293505db9c747a6e27487a808ab2b62a6f Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Wed, 18 Feb 2015 22:29:26 +0100 Subject: acpi-test: update expected files A bunch of code moved from dsdt to ssdt, plus we got trivial changes like 0->Zero which our test dosn't recognize as identity yet. Update expected files to suppress test warning. Signed-off-by: Michael S. Tsirkin --- tests/acpi-test-data/pc/DSDT | Bin 3621 -> 3415 bytes tests/acpi-test-data/pc/SSDT | Bin 2279 -> 2374 bytes tests/acpi-test-data/q35/DSDT | Bin 8211 -> 8005 bytes tests/acpi-test-data/q35/SSDT | Bin 560 -> 578 bytes 4 files changed, 0 insertions(+), 0 deletions(-) (limited to 'tests') diff --git a/tests/acpi-test-data/pc/DSDT b/tests/acpi-test-data/pc/DSDT index 010d746..ad12cb3 100644 Binary files a/tests/acpi-test-data/pc/DSDT and b/tests/acpi-test-data/pc/DSDT differ diff --git a/tests/acpi-test-data/pc/SSDT b/tests/acpi-test-data/pc/SSDT index 558e4c8..d010336 100644 Binary files a/tests/acpi-test-data/pc/SSDT and b/tests/acpi-test-data/pc/SSDT differ diff --git a/tests/acpi-test-data/q35/DSDT b/tests/acpi-test-data/q35/DSDT index 8ac32ef..de430e2 100644 Binary files a/tests/acpi-test-data/q35/DSDT and b/tests/acpi-test-data/q35/DSDT differ diff --git a/tests/acpi-test-data/q35/SSDT b/tests/acpi-test-data/q35/SSDT index 2cb3e08..f86643d 100644 Binary files a/tests/acpi-test-data/q35/SSDT and b/tests/acpi-test-data/q35/SSDT differ -- cgit v1.1 From 194c8615d7d819887180f196675ba987c4bf43bc Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Fri, 20 Feb 2015 18:22:13 +0000 Subject: tests: ACPI test blobs update due to PCI0._CRS changes PCI0._CRS was moved into SSDT and became the same for PIIX4/Q35 machines. Signed-off-by: Igor Mammedov Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/acpi-test-data/pc/DSDT | Bin 3415 -> 2970 bytes tests/acpi-test-data/pc/SSDT | Bin 2374 -> 2480 bytes tests/acpi-test-data/q35/DSDT | Bin 8005 -> 7608 bytes tests/acpi-test-data/q35/SSDT | Bin 578 -> 685 bytes 4 files changed, 0 insertions(+), 0 deletions(-) (limited to 'tests') diff --git a/tests/acpi-test-data/pc/DSDT b/tests/acpi-test-data/pc/DSDT index ad12cb3..1693c37 100644 Binary files a/tests/acpi-test-data/pc/DSDT and b/tests/acpi-test-data/pc/DSDT differ diff --git a/tests/acpi-test-data/pc/SSDT b/tests/acpi-test-data/pc/SSDT index d010336..dc5be24 100644 Binary files a/tests/acpi-test-data/pc/SSDT and b/tests/acpi-test-data/pc/SSDT differ diff --git a/tests/acpi-test-data/q35/DSDT b/tests/acpi-test-data/q35/DSDT index de430e2..e9ac11c 100644 Binary files a/tests/acpi-test-data/q35/DSDT and b/tests/acpi-test-data/q35/DSDT differ diff --git a/tests/acpi-test-data/q35/SSDT b/tests/acpi-test-data/q35/SSDT index f86643d..749f368 100644 Binary files a/tests/acpi-test-data/q35/SSDT and b/tests/acpi-test-data/q35/SSDT differ -- cgit v1.1 From 3a9c86df2169881978e697109ae9bb8a6ce41e92 Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Fri, 20 Feb 2015 18:22:14 +0000 Subject: tests: bios-tables-test: add support for testing bridges Adds alternative ACPI table blob selection for testing non default QEMU configurations. If blob file for test variant is not present, fallback to default blob. With this change implement testing with a coldplugged bridge. Signed-off-by: Igor Mammedov Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/bios-tables-test.c | 45 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c index 4d0fa84..735ac61 100644 --- a/tests/bios-tables-test.c +++ b/tests/bios-tables-test.c @@ -40,6 +40,7 @@ typedef struct { typedef struct { const char *machine; + const char *variant; uint32_t rsdp_addr; AcpiRsdpDescriptor rsdp_table; AcpiRsdtDescriptorRev1 rsdt_table; @@ -396,13 +397,14 @@ static void dump_aml_files(test_data *data, bool rebuild) int i; for (i = 0; i < data->tables->len; ++i) { + const char *ext = data->variant ? data->variant : ""; sdt = &g_array_index(data->tables, AcpiSdtTable, i); g_assert(sdt->aml); if (rebuild) { uint32_t signature = cpu_to_le32(sdt->header.signature); - aml_file = g_strdup_printf("%s/%s/%.4s", data_dir, data->machine, - (gchar *)&signature); + aml_file = g_strdup_printf("%s/%s/%.4s%s", data_dir, data->machine, + (gchar *)&signature, ext); fd = g_open(aml_file, O_WRONLY|O_TRUNC|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH); } else { @@ -509,7 +511,7 @@ static GArray *load_expected_aml(test_data *data) { int i; AcpiSdtTable *sdt; - gchar *aml_file; + gchar *aml_file = NULL; GError *error = NULL; gboolean ret; @@ -517,6 +519,7 @@ static GArray *load_expected_aml(test_data *data) for (i = 0; i < data->tables->len; ++i) { AcpiSdtTable exp_sdt; uint32_t signature; + const char *ext = data->variant ? data->variant : ""; sdt = &g_array_index(data->tables, AcpiSdtTable, i); @@ -524,8 +527,15 @@ static GArray *load_expected_aml(test_data *data) exp_sdt.header.signature = sdt->header.signature; signature = cpu_to_le32(sdt->header.signature); - aml_file = g_strdup_printf("%s/%s/%.4s", data_dir, data->machine, - (gchar *)&signature); + +try_again: + aml_file = g_strdup_printf("%s/%s/%.4s%s", data_dir, data->machine, + (gchar *)&signature, ext); + if (data->variant && !g_file_test(aml_file, G_FILE_TEST_EXISTS)) { + g_free(aml_file); + ext = ""; + goto try_again; + } exp_sdt.aml_file = aml_file; g_assert(g_file_test(aml_file, G_FILE_TEST_EXISTS)); ret = g_file_get_contents(aml_file, &exp_sdt.aml, @@ -778,6 +788,17 @@ static void test_acpi_piix4_tcg(void) free_test_data(&data); } +static void test_acpi_piix4_tcg_bridge(void) +{ + test_data data; + + memset(&data, 0, sizeof(data)); + data.machine = MACHINE_PC; + data.variant = ".bridge"; + test_acpi_one("-machine accel=tcg -device pci-bridge,chassis_nr=1", &data); + free_test_data(&data); +} + static void test_acpi_q35_tcg(void) { test_data data; @@ -788,6 +809,18 @@ static void test_acpi_q35_tcg(void) free_test_data(&data); } +static void test_acpi_q35_tcg_bridge(void) +{ + test_data data; + + memset(&data, 0, sizeof(data)); + data.machine = MACHINE_Q35; + data.variant = ".bridge"; + test_acpi_one("-machine q35,accel=tcg -device pci-bridge,chassis_nr=1", + &data); + free_test_data(&data); +} + int main(int argc, char *argv[]) { const char *arch = qtest_get_arch(); @@ -805,7 +838,9 @@ int main(int argc, char *argv[]) if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) { qtest_add_func("acpi/piix4/tcg", test_acpi_piix4_tcg); + qtest_add_func("acpi/piix4/tcg/bridge", test_acpi_piix4_tcg_bridge); qtest_add_func("acpi/q35/tcg", test_acpi_q35_tcg); + qtest_add_func("acpi/q35/tcg/bridge", test_acpi_q35_tcg_bridge); } ret = g_test_run(); unlink(disk); -- cgit v1.1 From 71096d6cc5b4341e9b7ee59f10594d5f36ce12b9 Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Fri, 20 Feb 2015 18:22:15 +0000 Subject: tests: add ACPI blobs for qemu with bridge cases Signed-off-by: Igor Mammedov Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/acpi-test-data/pc/SSDT.bridge | Bin 0 -> 4352 bytes tests/acpi-test-data/q35/SSDT.bridge | Bin 0 -> 702 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/acpi-test-data/pc/SSDT.bridge create mode 100644 tests/acpi-test-data/q35/SSDT.bridge (limited to 'tests') diff --git a/tests/acpi-test-data/pc/SSDT.bridge b/tests/acpi-test-data/pc/SSDT.bridge new file mode 100644 index 0000000..b807ac9 Binary files /dev/null and b/tests/acpi-test-data/pc/SSDT.bridge differ diff --git a/tests/acpi-test-data/q35/SSDT.bridge b/tests/acpi-test-data/q35/SSDT.bridge new file mode 100644 index 0000000..c552782f Binary files /dev/null and b/tests/acpi-test-data/q35/SSDT.bridge differ -- cgit v1.1 From 752bba815ec5b67e2aa6d7c86fd2be80e45c203b Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Fri, 20 Feb 2015 18:22:17 +0000 Subject: tests: ACPI: update pc/SSDT.bridge due to new alg of PCI tree creation Signed-off-by: Igor Mammedov Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/acpi-test-data/pc/SSDT.bridge | Bin 4352 -> 4351 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'tests') diff --git a/tests/acpi-test-data/pc/SSDT.bridge b/tests/acpi-test-data/pc/SSDT.bridge index b807ac9..ca7f63c 100644 Binary files a/tests/acpi-test-data/pc/SSDT.bridge and b/tests/acpi-test-data/pc/SSDT.bridge differ -- cgit v1.1 From e32dccddb0b1fa335bf251c155e907f9d47accfd Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Sun, 1 Mar 2015 19:39:36 +0100 Subject: acpi-test-data: update after pci rewrite more trivial changes as more code has been rewritten in C. we also got rid of extra Scope operators. Signed-off-by: Michael S. Tsirkin --- tests/acpi-test-data/pc/SSDT | Bin 2480 -> 2476 bytes tests/acpi-test-data/pc/SSDT.bridge | Bin 4351 -> 4335 bytes tests/acpi-test-data/q35/SSDT | Bin 685 -> 681 bytes tests/acpi-test-data/q35/SSDT.bridge | Bin 702 -> 698 bytes 4 files changed, 0 insertions(+), 0 deletions(-) (limited to 'tests') diff --git a/tests/acpi-test-data/pc/SSDT b/tests/acpi-test-data/pc/SSDT index dc5be24..87c3e9f 100644 Binary files a/tests/acpi-test-data/pc/SSDT and b/tests/acpi-test-data/pc/SSDT differ diff --git a/tests/acpi-test-data/pc/SSDT.bridge b/tests/acpi-test-data/pc/SSDT.bridge index ca7f63c..325899a 100644 Binary files a/tests/acpi-test-data/pc/SSDT.bridge and b/tests/acpi-test-data/pc/SSDT.bridge differ diff --git a/tests/acpi-test-data/q35/SSDT b/tests/acpi-test-data/q35/SSDT index 749f368..6a5c042 100644 Binary files a/tests/acpi-test-data/q35/SSDT and b/tests/acpi-test-data/q35/SSDT differ diff --git a/tests/acpi-test-data/q35/SSDT.bridge b/tests/acpi-test-data/q35/SSDT.bridge index c552782f..5fc83a0 100644 Binary files a/tests/acpi-test-data/q35/SSDT.bridge and b/tests/acpi-test-data/q35/SSDT.bridge differ -- cgit v1.1