495e37
From f897bc3aca1bb98b1907cfd76ba52cfa541b9b5c Mon Sep 17 00:00:00 2001
495e37
From: Igor Mammedov <imammedo@redhat.com>
495e37
Date: Mon, 27 Dec 2021 14:31:19 -0500
495e37
Subject: [PATCH 07/14] tests: acpi: add SLIC table test
495e37
495e37
RH-Author: Igor Mammedov <imammedo@redhat.com>
495e37
RH-MergeRequest: 130: acpi: fix QEMU crash when started with SLIC table
495e37
RH-Commit: [3/10] b72e6f11e4d86bf39fa440df3902d9259d16d5db
495e37
RH-Bugzilla: 2043531
495e37
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
495e37
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
495e37
RH-Acked-by: MST <None>
495e37
495e37
When user uses '-acpitable' to add SLIC table, some ACPI
495e37
tables (FADT) will change its 'Oem ID'/'Oem Table ID' fields to
495e37
match that of SLIC. Test makes sure thati QEMU handles
495e37
those fields correctly when SLIC table is added with
495e37
'-acpitable' option.
495e37
495e37
Conflicts:
495e37
	tests/qtest/bios-tables-test.c
495e37
        due to missing 39d7554b2009 ("tests/acpi: add test case for VIOT")
495e37
495e37
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
495e37
Message-Id: <20211227193120.1084176-4-imammedo@redhat.com>
495e37
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
495e37
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
495e37
(cherry picked from commit 11edfabee443b149468a82b5efc88c96d1d259ec)
495e37
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
495e37
---
495e37
 tests/qtest/bios-tables-test.c | 15 +++++++++++++++
495e37
 1 file changed, 15 insertions(+)
495e37
495e37
diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
495e37
index 62745181a8..088609c196 100644
495e37
--- a/tests/qtest/bios-tables-test.c
495e37
+++ b/tests/qtest/bios-tables-test.c
495e37
@@ -1465,6 +1465,20 @@ static void test_acpi_virt_tcg(void)
495e37
     free_test_data(&data);
495e37
 }
495e37
 
495e37
+static void test_acpi_q35_slic(void)
495e37
+{
495e37
+    test_data data = {
495e37
+        .machine = MACHINE_Q35,
495e37
+        .variant = ".slic",
495e37
+    };
495e37
+
495e37
+    test_acpi_one("-acpitable sig=SLIC,oem_id='CRASH ',oem_table_id='ME',"
495e37
+                  "oem_rev=00002210,asl_compiler_id='qemu',"
495e37
+                  "asl_compiler_rev=00000000,data=/dev/null",
495e37
+                  &data);
495e37
+    free_test_data(&data);
495e37
+}
495e37
+
495e37
 static void test_oem_fields(test_data *data)
495e37
 {
495e37
     int i;
495e37
@@ -1639,6 +1653,7 @@ int main(int argc, char *argv[])
495e37
             qtest_add_func("acpi/q35/kvm/xapic", test_acpi_q35_kvm_xapic);
495e37
             qtest_add_func("acpi/q35/kvm/dmar", test_acpi_q35_kvm_dmar);
495e37
         }
495e37
+        qtest_add_func("acpi/q35/slic", test_acpi_q35_slic);
495e37
     } else if (strcmp(arch, "aarch64") == 0) {
495e37
         if (has_tcg) {
495e37
             qtest_add_func("acpi/virt", test_acpi_virt_tcg);
495e37
-- 
495e37
2.31.1
495e37