diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bios-tables-test.c | 81 | ||||
-rw-r--r-- | tests/data/acpi/virt/APIC.memhp | bin | 0 -> 168 bytes | |||
-rw-r--r-- | tests/data/acpi/virt/APIC.numamem | bin | 0 -> 168 bytes | |||
-rw-r--r-- | tests/data/acpi/virt/DSDT | bin | 18476 -> 18470 bytes | |||
-rw-r--r-- | tests/data/acpi/virt/DSDT.memhp | bin | 0 -> 19807 bytes | |||
-rw-r--r-- | tests/data/acpi/virt/DSDT.numamem | bin | 0 -> 18470 bytes | |||
-rw-r--r-- | tests/data/acpi/virt/FACP.memhp | bin | 0 -> 268 bytes | |||
-rw-r--r-- | tests/data/acpi/virt/FACP.numamem | bin | 0 -> 268 bytes | |||
-rw-r--r-- | tests/data/acpi/virt/GTDT.memhp | bin | 0 -> 96 bytes | |||
-rw-r--r-- | tests/data/acpi/virt/GTDT.numamem | bin | 0 -> 96 bytes | |||
-rw-r--r-- | tests/data/acpi/virt/MCFG.memhp | bin | 0 -> 60 bytes | |||
-rw-r--r-- | tests/data/acpi/virt/MCFG.numamem | bin | 0 -> 60 bytes | |||
-rw-r--r-- | tests/data/acpi/virt/SLIT.memhp | bin | 0 -> 48 bytes | |||
-rw-r--r-- | tests/data/acpi/virt/SPCR.memhp | bin | 0 -> 80 bytes | |||
-rw-r--r-- | tests/data/acpi/virt/SPCR.numamem | bin | 0 -> 80 bytes | |||
-rw-r--r-- | tests/data/acpi/virt/SRAT.memhp | bin | 0 -> 186 bytes | |||
-rw-r--r-- | tests/data/acpi/virt/SRAT.numamem | bin | 0 -> 106 bytes |
17 files changed, 80 insertions, 1 deletions
diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c index 9b3d8b0..0b33fb2 100644 --- a/tests/bios-tables-test.c +++ b/tests/bios-tables-test.c @@ -10,6 +10,33 @@ * See the COPYING file in the top-level directory. */ +/* + * How to add or update the tests: + * Contributor: + * 1. add empty files for new tables, if any, under tests/data/acpi + * 2. list any changed files in tests/bios-tables-test-allowed-diff.h + * 3. commit the above *before* making changes that affect the tables + * Maintainer: + * After 1-3 above tests will pass but ignore differences with the expected files. + * You will also notice that tests/bios-tables-test-allowed-diff.h lists + * a bunch of files. This is your hint that you need to do the below: + * 4. Run + * make check V=1 + * this will produce a bunch of warnings about differences + * beween actual and expected ACPI tables. If you have IASL installed, + * they will also be disassembled so you can look at the disassembled + * output. If not - disassemble them yourself in any way you like. + * Look at the differences - make sure they make sense and match what the + * changes you are merging are supposed to do. + * + * 5. From build directory, run: + * $(SRC_PATH)/tests/data/acpi/rebuild-expected-aml.sh + * 6. Now commit any changes. + * 7. Before doing a pull request, make sure tests/bios-tables-test-allowed-diff.h + * is empty - this will ensure following changes to ACPI tables will + * be noticed. + */ + #include "qemu/osdep.h" #include <glib/gstdio.h> #include "qemu-common.h" @@ -334,7 +361,10 @@ try_again: g_assert(ret); g_assert_no_error(error); g_assert(exp_sdt.aml); - g_assert(exp_sdt.aml_len); + if (!exp_sdt.aml_len) { + fprintf(stderr, "Warning! zero length expected file '%s'\n", + aml_file); + } g_array_append_val(exp_tables, exp_sdt); } @@ -870,6 +900,53 @@ static void test_acpi_piix4_tcg_dimm_pxm(void) test_acpi_tcg_dimm_pxm(MACHINE_PC); } +static void test_acpi_virt_tcg_memhp(void) +{ + test_data data = { + .machine = "virt", + .accel = "tcg", + .uefi_fl1 = "pc-bios/edk2-aarch64-code.fd", + .uefi_fl2 = "pc-bios/edk2-arm-vars.fd", + .cd = "tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2", + .ram_start = 0x40000000ULL, + .scan_len = 256ULL * 1024 * 1024, + }; + + data.variant = ".memhp"; + test_acpi_one(" -cpu cortex-a57" + " -m 256M,slots=3,maxmem=1G" + " -object memory-backend-ram,id=ram0,size=128M" + " -object memory-backend-ram,id=ram1,size=128M" + " -numa node,memdev=ram0 -numa node,memdev=ram1" + " -numa dist,src=0,dst=1,val=21", + &data); + + free_test_data(&data); + +} + +static void test_acpi_virt_tcg_numamem(void) +{ + test_data data = { + .machine = "virt", + .accel = "tcg", + .uefi_fl1 = "pc-bios/edk2-aarch64-code.fd", + .uefi_fl2 = "pc-bios/edk2-arm-vars.fd", + .cd = "tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2", + .ram_start = 0x40000000ULL, + .scan_len = 128ULL * 1024 * 1024, + }; + + data.variant = ".numamem"; + test_acpi_one(" -cpu cortex-a57" + " -object memory-backend-ram,id=ram0,size=128M" + " -numa node,memdev=ram0", + &data); + + free_test_data(&data); + +} + static void test_acpi_virt_tcg(void) { test_data data = { @@ -916,6 +993,8 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/q35/dimmpxm", test_acpi_q35_tcg_dimm_pxm); } else if (strcmp(arch, "aarch64") == 0) { qtest_add_func("acpi/virt", test_acpi_virt_tcg); + qtest_add_func("acpi/virt/numamem", test_acpi_virt_tcg_numamem); + qtest_add_func("acpi/virt/memhp", test_acpi_virt_tcg_memhp); } ret = g_test_run(); boot_sector_cleanup(disk); diff --git a/tests/data/acpi/virt/APIC.memhp b/tests/data/acpi/virt/APIC.memhp Binary files differnew file mode 100644 index 0000000..797dfde --- /dev/null +++ b/tests/data/acpi/virt/APIC.memhp diff --git a/tests/data/acpi/virt/APIC.numamem b/tests/data/acpi/virt/APIC.numamem Binary files differnew file mode 100644 index 0000000..797dfde --- /dev/null +++ b/tests/data/acpi/virt/APIC.numamem diff --git a/tests/data/acpi/virt/DSDT b/tests/data/acpi/virt/DSDT Binary files differindex 20e85c7..bce76e3 100644 --- a/tests/data/acpi/virt/DSDT +++ b/tests/data/acpi/virt/DSDT diff --git a/tests/data/acpi/virt/DSDT.memhp b/tests/data/acpi/virt/DSDT.memhp Binary files differnew file mode 100644 index 0000000..b4b153f --- /dev/null +++ b/tests/data/acpi/virt/DSDT.memhp diff --git a/tests/data/acpi/virt/DSDT.numamem b/tests/data/acpi/virt/DSDT.numamem Binary files differnew file mode 100644 index 0000000..bce76e3 --- /dev/null +++ b/tests/data/acpi/virt/DSDT.numamem diff --git a/tests/data/acpi/virt/FACP.memhp b/tests/data/acpi/virt/FACP.memhp Binary files differnew file mode 100644 index 0000000..27de99f --- /dev/null +++ b/tests/data/acpi/virt/FACP.memhp diff --git a/tests/data/acpi/virt/FACP.numamem b/tests/data/acpi/virt/FACP.numamem Binary files differnew file mode 100644 index 0000000..27de99f --- /dev/null +++ b/tests/data/acpi/virt/FACP.numamem diff --git a/tests/data/acpi/virt/GTDT.memhp b/tests/data/acpi/virt/GTDT.memhp Binary files differnew file mode 100644 index 0000000..10107a6 --- /dev/null +++ b/tests/data/acpi/virt/GTDT.memhp diff --git a/tests/data/acpi/virt/GTDT.numamem b/tests/data/acpi/virt/GTDT.numamem Binary files differnew file mode 100644 index 0000000..10107a6 --- /dev/null +++ b/tests/data/acpi/virt/GTDT.numamem diff --git a/tests/data/acpi/virt/MCFG.memhp b/tests/data/acpi/virt/MCFG.memhp Binary files differnew file mode 100644 index 0000000..e8987e1 --- /dev/null +++ b/tests/data/acpi/virt/MCFG.memhp diff --git a/tests/data/acpi/virt/MCFG.numamem b/tests/data/acpi/virt/MCFG.numamem Binary files differnew file mode 100644 index 0000000..e8987e1 --- /dev/null +++ b/tests/data/acpi/virt/MCFG.numamem diff --git a/tests/data/acpi/virt/SLIT.memhp b/tests/data/acpi/virt/SLIT.memhp Binary files differnew file mode 100644 index 0000000..74ec3b4 --- /dev/null +++ b/tests/data/acpi/virt/SLIT.memhp diff --git a/tests/data/acpi/virt/SPCR.memhp b/tests/data/acpi/virt/SPCR.memhp Binary files differnew file mode 100644 index 0000000..377271a --- /dev/null +++ b/tests/data/acpi/virt/SPCR.memhp diff --git a/tests/data/acpi/virt/SPCR.numamem b/tests/data/acpi/virt/SPCR.numamem Binary files differnew file mode 100644 index 0000000..377271a --- /dev/null +++ b/tests/data/acpi/virt/SPCR.numamem diff --git a/tests/data/acpi/virt/SRAT.memhp b/tests/data/acpi/virt/SRAT.memhp Binary files differnew file mode 100644 index 0000000..1b57db2 --- /dev/null +++ b/tests/data/acpi/virt/SRAT.memhp diff --git a/tests/data/acpi/virt/SRAT.numamem b/tests/data/acpi/virt/SRAT.numamem Binary files differnew file mode 100644 index 0000000..9526e5a --- /dev/null +++ b/tests/data/acpi/virt/SRAT.numamem |