thebeanogamer / rpms / qemu-kvm

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