virtio, pci, pc: cleanups, features
[Qemu-devel] [PULL v3 10/17] bios-tables-test: add diff allowed list
In reply to Michael S. TsirkinExpected table change is then handled like this:
1. add table to diff allowed list
2. change generating code (can be combined with 1)
3. maintainer runs a script to update expected + blows away allowed diff list
--- tests/bios-tables-test-allowed-diff.h | 1 + tests/bios-tables-test.c | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 tests/bios-tables-test-allowed-diff.h
tests/bios-tables-test-allowed-diff.h new file +1 -0
@@ -0,0 +1 @@ +/* List of comma-separated changed AML files to ignore */
tests/bios-tables-test.c +18 -1
@@ -342,6 +342,22 @@ try_again:return exp_tables; } +static bool test_acpi_find_diff_allowed (AcpiSdtTable *sdt) +{ +const gchar *allowed_diff_file[] = { +#include "bios-tables-test-allowed-diff.h" +NULL + }; +const gchar **f; + +for (f = allowed_diff_file; *f; ++f) { +if (!g_strcmp0 (sdt->aml_file, *f)) { +return true; + } + } +return false; +} +/* test the list of tables in @data->tables against reference tables */ static void test_acpi_asl (test_data *data) {
@@ -396,7 +412,8 @@ static void test_acpi_asl(test_data *data) "see ASL difference."); } } - } + } +g_assert (test_acpi_find_diff_allowed (exp_sdt)); }g_string_free (asl, true);g_string_free (exp_asl, true);
Signature · 1 line
MST
The following changes since commit 8c1ecb590497b0349c550607db923972b37f6963:
Merge remote-tracking branch 'remotes/stsquad/tags/pull-testing-next-280519-2' into staging (2019-05-28 17:38:32 +0100)
are available in the Git repository at:
git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
for you to fetch changes up to 7f36f0930ffec11a551844c0452dbce33f80a525:
bios-tables-test: ignore identical binaries (2019-06-05 15:54:15 -0400)
----------------------------------------------------------------
virtio, pci, pc: cleanups, features
stricter rules for acpi tables: we now fail
on any difference that isn't whitelisted.
vhost-scsi migration.
some cleanups all over the place
----------------------------------------------------------------
David Gibson (3):
pcie: Simplify pci_adjust_config_limit()
pci: Make is_bridge a bool
pci: Fold pci_get_bus_devfn() into its sole caller
Igor Mammedov (3):
docs: smbios: remove family=x from type2 entry description
tests: add expected ACPI tables for arm/virt board
tests: acpi: add simple arm/virt testcase
Jie Wang (3):
vhost: remove the dead code
vhost: fix incorrect print type
vhost: fix memory leak in vhost_user_scsi_realize
Liran Alon (1):
vhost-scsi: Allow user to enable migration
Michael S. Tsirkin (3):
bios-tables-test: add diff allowed list
bios-tables-test: list all tables that differ
bios-tables-test: ignore identical binaries
Nir Weiner (2):
vhost-scsi: The vhost backend should be stopped when the VM is not running
vhost-scsi: Add VMState descriptor
Wei Yang (2):
hw/acpi: Consolidate build_mcfg to pci.c
acpi: pci: use build_append_foo() API to construct MCFG
default-configs/i386-softmmu.mak | 1 + include/hw/acpi/acpi-defs.h | 18 ------ include/hw/acpi/pci.h | 1 + include/hw/pci/pci.h | 3 +- include/hw/pci/pci_bus.h | 8 ++- include/hw/virtio/vhost-scsi-common.h | 1 + tests/bios-tables-test-allowed-diff.h | 1 + hw/acpi/pci.c | 61 +++++++++++++++++++ hw/arm/virt-acpi-build.c | 17 ------ hw/i386/acpi-build.c | 18 +----- hw/pci-bridge/dec.c | 4 +- hw/pci-bridge/i82801b11.c | 2 +- hw/pci-bridge/pci_bridge_dev.c | 2 +- hw/pci-bridge/pcie_pci_bridge.c | 2 +- hw/pci-bridge/pcie_root_port.c | 2 +- hw/pci-bridge/simba.c | 2 +- hw/pci-bridge/xio3130_downstream.c | 2 +- hw/pci-bridge/xio3130_upstream.c | 2 +- hw/pci/pci.c | 101 ++++++++++++++++---------------- hw/pci/pci_host.c | 13 +--- hw/ppc/spapr_pci.c | 34 ++++------- hw/scsi/vhost-scsi.c | 57 ++++++++++++++---- hw/scsi/vhost-user-scsi.c | 3 + hw/virtio/vhost.c | 3 +- tests/bios-tables-test.c | 53 ++++++++++++++++- hw/acpi/Kconfig | 4 ++ hw/acpi/Makefile.objs | 1 + hw/arm/Kconfig | 1 + qemu-options.hx | 2 +- tests/Makefile.include | 4 ++ tests/data/acpi/rebuild-expected-aml.sh | 2 +- tests/data/acpi/virt/APIC | Bin 0 -> 168 bytes tests/data/acpi/virt/DSDT | Bin 0 -> 18476 bytes tests/data/acpi/virt/FACP | Bin 0 -> 268 bytes tests/data/acpi/virt/GTDT | Bin 0 -> 96 bytes tests/data/acpi/virt/MCFG | Bin 0 -> 60 bytes tests/data/acpi/virt/SPCR | Bin 0 -> 80 bytes 37 files changed, 261 insertions(+), 164 deletions(-) create mode 100644 tests/bios-tables-test-allowed-diff.h create mode 100644 hw/acpi/pci.c create mode 100644 tests/data/acpi/virt/APIC create mode 100644 tests/data/acpi/virt/DSDT create mode 100644 tests/data/acpi/virt/FACP create mode 100644 tests/data/acpi/virt/GTDT create mode 100644 tests/data/acpi/virt/MCFG create mode 100644 tests/data/acpi/virt/SPCR
[Qemu-devel] [PULL v3 17/17] bios-tables-test: ignore identical binaries
when binary of the tables is identical, there is no need to run iasl to check that they are functionally equivalent.
--- tests/bios-tables-test.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
tests/bios-tables-test.c +14 -2
@@ -375,6 +375,20 @@ static void test_acpi_asl(test_data *data) sdt = &g_array_index (data->tables, AcpiSdtTable, i); exp_sdt = &g_array_index (exp_data.tables, AcpiSdtTable, i); +if (sdt->aml_len == exp_sdt->aml_len && + !memcmp (sdt->aml, exp_sdt->aml, sdt->aml_len)) { +/* Identical table binaries: no need to disassemble. */ +continue ; + } + +fprintf (stderr, +"acpi-test: Warning! %.4s binary file mismatch. " +"Actual [aml:%s], Expected [aml:%s].\n" , + exp_sdt->aml, sdt->aml_file, exp_sdt->aml_file); + + all_tables_match = all_tables_match && +test_acpi_find_diff_allowed (exp_sdt); + err =load_asl (data->tables, sdt); asl =normalize_asl (sdt->asl);
@@ -413,8 +427,6 @@ static void test_acpi_asl(test_data *data) } } } - all_tables_match = all_tables_match && -test_acpi_find_diff_allowed (exp_sdt); }g_string_free (asl, true);g_string_free (exp_asl, true);
Signature · 1 line
MST
[Qemu-devel] [PULL v3 14/17] bios-tables-test: list all tables that differ
In reply to Michael S. TsirkinFail after comparing all tables: this way
user gets the full list of tables that need
to be updated or whitelisted.
--- tests/bios-tables-test.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
tests/bios-tables-test.c +4 -2
@@ -364,7 +364,7 @@ static void test_acpi_asl(test_data *data)int i;AcpiSdtTable *sdt, *exp_sdt;test_data exp_data; -gboolean exp_err, err; +gboolean exp_err, err, all_tables_match = true;memset (&exp_data,0 ,sizeof (exp_data)); exp_data.tables =load_expected_aml (data);
@@ -413,11 +413,13 @@ static void test_acpi_asl(test_data *data) } } } -g_assert (test_acpi_find_diff_allowed (exp_sdt)); + all_tables_match = all_tables_match && +test_acpi_find_diff_allowed (exp_sdt); }g_string_free (asl, true);g_string_free (exp_asl, true); } +g_assert (all_tables_match);free_test_data (&exp_data); }
Signature · 1 line
MST
Peter Maydell
AppliedQuoted 16 lines · Michael S. Tsirkin
The following changes since commit
8c1ecb590497b0349c550607db923972b37f6963:Merge remote-tracking branch 'remotes/stsquad/tags/pull-testing-next-280519-2' into staging (2019-05-28 17:38:32 +0100)
are available in the Git repository at:
git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.gittags/for_upstreamfor you to fetch changes up to
7f36f0930ffec11a551844c0452dbce33f80a525:bios-tables-test: ignore identical binaries (2019-06-05 15:54:15 -0400)
----------------------------------------------------------------
virtio, pci, pc: cleanups, features
Quoted 9 lines
stricter rules for acpi tables: we now fail
on any difference that isn't whitelisted.vhost-scsi migration.
some cleanups all over the place
Signed-off-by Michael S. Tsirkin <[email protected]>
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/4.1
for any user-visible changes.
-- PMM