[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 22/24] ACPI ERST: bios-tables-test testcase
From: |
Michael S. Tsirkin |
Subject: |
[PULL v2 22/24] ACPI ERST: bios-tables-test testcase |
Date: |
Sun, 6 Feb 2022 04:38:45 -0500 |
From: Eric DeVolder <eric.devolder@oracle.com>
This change implements the test suite checks for the ERST table.
Signed-off-by: Eric DeVolder <eric.devolder@oracle.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
Message-Id: <1643402289-22216-10-git-send-email-eric.devolder@oracle.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
tests/qtest/bios-tables-test.c | 54 ++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)
diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index ad536fd7b1..c4a2d1e166 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -1447,6 +1447,57 @@ static void test_acpi_piix4_tcg_acpi_hmat(void)
test_acpi_tcg_acpi_hmat(MACHINE_PC);
}
+static void test_acpi_erst(const char *machine)
+{
+ gchar *tmp_path = g_dir_make_tmp("qemu-test-erst.XXXXXX", NULL);
+ gchar *params;
+ test_data data;
+
+ memset(&data, 0, sizeof(data));
+ data.machine = machine;
+ data.variant = ".acpierst";
+ params = g_strdup_printf(
+ " -object memory-backend-file,id=erstnvram,"
+ "mem-path=%s,size=0x10000,share=on"
+ " -device acpi-erst,memdev=erstnvram", tmp_path);
+ test_acpi_one(params, &data);
+ free_test_data(&data);
+ g_free(params);
+ g_assert(g_rmdir(tmp_path) == 0);
+ g_free(tmp_path);
+}
+
+static void test_acpi_piix4_acpi_erst(void)
+{
+ test_acpi_erst(MACHINE_PC);
+}
+
+static void test_acpi_q35_acpi_erst(void)
+{
+ test_acpi_erst(MACHINE_Q35);
+}
+
+static void test_acpi_microvm_acpi_erst(void)
+{
+ gchar *tmp_path = g_dir_make_tmp("qemu-test-erst.XXXXXX", NULL);
+ gchar *params;
+ test_data data;
+
+ test_acpi_microvm_prepare(&data);
+ data.variant = ".pcie";
+ data.tcg_only = true; /* need constant host-phys-bits */
+ params = g_strdup_printf(" -machine microvm,"
+ "acpi=on,ioapic2=off,rtc=off,pcie=on"
+ " -object memory-backend-file,id=erstnvram,"
+ "mem-path=%s,size=0x10000,share=on"
+ " -device acpi-erst,memdev=erstnvram", tmp_path);
+ test_acpi_one(params, &data);
+ g_free(params);
+ g_assert(g_rmdir(tmp_path) == 0);
+ g_free(tmp_path);
+ free_test_data(&data);
+}
+
static void test_acpi_virt_tcg(void)
{
test_data data = {
@@ -1672,6 +1723,8 @@ int main(int argc, char *argv[])
qtest_add_func("acpi/q35/dimmpxm", test_acpi_q35_tcg_dimm_pxm);
qtest_add_func("acpi/piix4/acpihmat", test_acpi_piix4_tcg_acpi_hmat);
qtest_add_func("acpi/q35/acpihmat", test_acpi_q35_tcg_acpi_hmat);
+ qtest_add_func("acpi/piix4/acpierst", test_acpi_piix4_acpi_erst);
+ qtest_add_func("acpi/q35/acpierst", test_acpi_q35_acpi_erst);
qtest_add_func("acpi/microvm", test_acpi_microvm_tcg);
qtest_add_func("acpi/microvm/usb", test_acpi_microvm_usb_tcg);
qtest_add_func("acpi/microvm/rtc", test_acpi_microvm_rtc_tcg);
@@ -1681,6 +1734,7 @@ int main(int argc, char *argv[])
qtest_add_func("acpi/q35/ivrs", test_acpi_q35_tcg_ivrs);
if (strcmp(arch, "x86_64") == 0) {
qtest_add_func("acpi/microvm/pcie",
test_acpi_microvm_pcie_tcg);
+ qtest_add_func("acpi/microvm/acpierst",
test_acpi_microvm_acpi_erst);
}
}
if (has_kvm) {
--
MST
- [PULL v2 01/24] cpuid: use unsigned for max cpuid, (continued)
- [PULL v2 01/24] cpuid: use unsigned for max cpuid, Michael S. Tsirkin, 2022/02/06
- [PULL v2 12/24] libvhost-user: prevent over-running max RAM slots, Michael S. Tsirkin, 2022/02/06
- [PULL v2 14/24] libvhost-user: Map shared RAM with MAP_NORESERVE to support virtio-mem with hugetlb, Michael S. Tsirkin, 2022/02/06
- [PULL v2 15/24] ACPI ERST: bios-tables-test.c steps 1 and 2, Michael S. Tsirkin, 2022/02/06
- [PULL v2 16/24] ACPI ERST: PCI device_id for ERST, Michael S. Tsirkin, 2022/02/06
- [PULL v2 17/24] ACPI ERST: header file for ERST, Michael S. Tsirkin, 2022/02/06
- [PULL v2 19/24] ACPI ERST: build the ACPI ERST table, Michael S. Tsirkin, 2022/02/06
- [PULL v2 18/24] ACPI ERST: support for ACPI ERST feature, Michael S. Tsirkin, 2022/02/06
- [PULL v2 20/24] ACPI ERST: create ACPI ERST table for pc/x86 machines, Michael S. Tsirkin, 2022/02/06
- [PULL v2 21/24] ACPI ERST: qtest for ERST, Michael S. Tsirkin, 2022/02/06
- [PULL v2 22/24] ACPI ERST: bios-tables-test testcase,
Michael S. Tsirkin <=
- [PULL v2 24/24] util/oslib-posix: Fix missing unlock in the error path of os_mem_prealloc(), Michael S. Tsirkin, 2022/02/06
- [PULL v2 23/24] ACPI ERST: step 6 of bios-tables-test.c, Michael S. Tsirkin, 2022/02/06
- [PULL v2 11/24] libvhost-user: fix VHOST_USER_REM_MEM_REG not closing the fd, Michael S. Tsirkin, 2022/02/06
- Re: [PULL v2 00/24] virtio,pc: features, cleanups, fixes, Peter Maydell, 2022/02/06