thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
4841a6
From 341715473c2a71f11a3888420a0caecf27ed4eb5 Mon Sep 17 00:00:00 2001
4841a6
From: Jon Maloy <jmaloy@redhat.com>
4841a6
Date: Wed, 30 Mar 2022 14:52:34 -0400
4841a6
Subject: [PATCH 11/18] tests: acpi: add SLIC table test
4841a6
4841a6
RH-Author: Jon Maloy <jmaloy@redhat.com>
4841a6
RH-MergeRequest: 141: acpi: fix QEMU crash when started with SLIC table
4841a6
RH-Commit: [3/10] baac9b82c16a50eb4640fd7146775c9d507c7b21 (jmaloy/qemu-kvm)
4841a6
RH-Bugzilla: 2062611
4841a6
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
4841a6
4841a6
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2062611
4841a6
Upstream: Merged
4841a6
4841a6
commit 11edfabee443b149468a82b5efc88c96d1d259ec
4841a6
Author: Igor Mammedov <imammedo@redhat.com>
4841a6
Date:   Mon Dec 27 14:31:19 2021 -0500
4841a6
4841a6
    tests: acpi: add SLIC table test
4841a6
4841a6
    When user uses '-acpitable' to add SLIC table, some ACPI
4841a6
    tables (FADT) will change its 'Oem ID'/'Oem Table ID' fields to
4841a6
    match that of SLIC. Test makes sure thati QEMU handles
4841a6
    those fields correctly when SLIC table is added with
4841a6
    '-acpitable' option.
4841a6
4841a6
    Conflicts: tests/qtest/bios-tables-test.c
4841a6
     due to missing 39d7554b2009 ("tests/acpi: add test case for VIOT")
4841a6
4841a6
    Signed-off-by: Igor Mammedov <imammedo@redhat.com>
4841a6
    Message-Id: <20211227193120.1084176-4-imammedo@redhat.com>
4841a6
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
4841a6
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
4841a6
60061b
(cherry picked from commit 11edfabee443b149468a82b5efc88c96d1d259ec)
4841a6
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
60061b
---
60061b
 tests/qtest/bios-tables-test.c | 15 +++++++++++++++
60061b
 1 file changed, 15 insertions(+)
60061b
60061b
diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
60061b
index 16d8304cde..e159b71136 100644
60061b
--- a/tests/qtest/bios-tables-test.c
60061b
+++ b/tests/qtest/bios-tables-test.c
60061b
@@ -1467,6 +1467,20 @@ static void test_acpi_virt_tcg(void)
60061b
     free_test_data(&data);
60061b
 }
60061b
 
60061b
+static void test_acpi_q35_slic(void)
60061b
+{
60061b
+    test_data data = {
60061b
+        .machine = MACHINE_Q35,
60061b
+        .variant = ".slic",
60061b
+    };
60061b
+
60061b
+    test_acpi_one("-acpitable sig=SLIC,oem_id='CRASH ',oem_table_id='ME',"
60061b
+                  "oem_rev=00002210,asl_compiler_id='qemu',"
60061b
+                  "asl_compiler_rev=00000000,data=/dev/null",
60061b
+                  &data);
60061b
+    free_test_data(&data);
60061b
+}
60061b
+
60061b
 static void test_oem_fields(test_data *data)
60061b
 {
60061b
     int i;
60061b
@@ -1641,6 +1655,7 @@ int main(int argc, char *argv[])
60061b
             qtest_add_func("acpi/q35/kvm/xapic", test_acpi_q35_kvm_xapic);
60061b
             qtest_add_func("acpi/q35/kvm/dmar", test_acpi_q35_kvm_dmar);
60061b
         }
60061b
+        qtest_add_func("acpi/q35/slic", test_acpi_q35_slic);
60061b
     } else if (strcmp(arch, "aarch64") == 0) {
60061b
         if (has_tcg) {
60061b
             qtest_add_func("acpi/virt", test_acpi_virt_tcg);
60061b
-- 
60061b
2.27.0
60061b