qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Bibo Mao <maobibo@loongson.cn>,
	Igor Mammedov <imammedo@redhat.com>,
	Ani Sinha <anisinha@redhat.com>, Fabiano Rosas <farosas@suse.de>,
	Laurent Vivier <lvivier@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: [PULL 19/31] tests/qtest/bios-tables-test: Add basic testing for LoongArch
Date: Sun, 1 Jun 2025 11:25:32 -0400	[thread overview]
Message-ID: <16736bf01b79ef411dbab75289979e283153ea23.1748791463.git.mst@redhat.com> (raw)
In-Reply-To: <cover.1748791463.git.mst@redhat.com>

From: Bibo Mao <maobibo@loongson.cn>

Add basic ACPI table test case for LoongArch, including cpu topology,
numa memory, memory hotplug and oem-id test cases.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Message-Id: <20250520130158.767083-6-maobibo@loongson.cn>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 tests/qtest/bios-tables-test.c | 79 ++++++++++++++++++++++++++++++++++
 tests/qtest/meson.build        |  1 +
 2 files changed, 80 insertions(+)

diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index 0b2bdf9d0d..d057cd90db 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -2420,6 +2420,74 @@ static void test_acpi_aarch64_virt_oem_fields(void)
     g_free(args);
 }
 
+#define LOONGARCH64_INIT_TEST_DATA(data)                          \
+    test_data data = {                                            \
+        .machine = "virt",                                        \
+        .arch    = "loongarch64",                                 \
+        .tcg_only = true,                                         \
+        .uefi_fl1 = "pc-bios/edk2-loongarch64-code.fd",           \
+        .uefi_fl2 = "pc-bios/edk2-loongarch64-vars.fd",           \
+        .cd = "tests/data/uefi-boot-images/"                      \
+              "bios-tables-test.loongarch64.iso.qcow2",           \
+        .ram_start = 0,                                           \
+        .scan_len = 128ULL * MiB,                                 \
+    }
+
+static void test_acpi_loongarch64_virt(void)
+{
+    LOONGARCH64_INIT_TEST_DATA(data);
+
+    test_acpi_one("-cpu la464 ", &data);
+    free_test_data(&data);
+}
+
+static void test_acpi_loongarch64_virt_topology(void)
+{
+    LOONGARCH64_INIT_TEST_DATA(data);
+
+    data.variant = ".topology";
+    test_acpi_one("-cpu la464 -smp sockets=1,cores=4,threads=2", &data);
+    free_test_data(&data);
+}
+
+static void test_acpi_loongarch64_virt_numamem(void)
+{
+    LOONGARCH64_INIT_TEST_DATA(data);
+
+    data.variant = ".numamem";
+    test_acpi_one(" -cpu la464 -m 128"
+                  " -object memory-backend-ram,id=ram0,size=64M"
+                  " -object memory-backend-ram,id=ram1,size=64M"
+                  " -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_loongarch64_virt_memhp(void)
+{
+    LOONGARCH64_INIT_TEST_DATA(data);
+
+    data.variant = ".memhp";
+    test_acpi_one(" -cpu la464 -m 128,slots=2,maxmem=256M"
+                  " -object memory-backend-ram,id=ram0,size=128M",
+                  &data);
+    free_test_data(&data);
+}
+
+static void test_acpi_loongarch64_virt_oem_fields(void)
+{
+    LOONGARCH64_INIT_TEST_DATA(data);
+    char *args;
+
+    args = test_acpi_create_args(&data, "-cpu la464 "OEM_TEST_ARGS);
+    data.qts = qtest_init(args);
+    test_acpi_load_tables(&data);
+    test_oem_fields(&data);
+    qtest_quit(data.qts);
+    free_test_data(&data);
+    g_free(args);
+}
 
 int main(int argc, char *argv[])
 {
@@ -2593,6 +2661,17 @@ int main(int argc, char *argv[])
             qtest_add_func("acpi/virt/numamem",
                            test_acpi_riscv64_virt_tcg_numamem);
         }
+    } else if (strcmp(arch, "loongarch64") == 0) {
+        if (has_tcg) {
+            qtest_add_func("acpi/virt", test_acpi_loongarch64_virt);
+            qtest_add_func("acpi/virt/topology",
+                           test_acpi_loongarch64_virt_topology);
+            qtest_add_func("acpi/virt/numamem",
+                           test_acpi_loongarch64_virt_numamem);
+            qtest_add_func("acpi/virt/memhp", test_acpi_loongarch64_virt_memhp);
+            qtest_add_func("acpi/virt/oem-fields",
+                           test_acpi_loongarch64_virt_oem_fields);
+        }
     }
     ret = g_test_run();
     boot_sector_cleanup(disk);
diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
index 43e5a86699..395ccc0d4c 100644
--- a/tests/qtest/meson.build
+++ b/tests/qtest/meson.build
@@ -148,6 +148,7 @@ qtests_hppa = \
 
 qtests_loongarch64 = qtests_filter + \
   (config_all_devices.has_key('CONFIG_LOONGARCH_VIRT') ? ['numa-test'] : []) + \
+  (unpack_edk2_blobs ? ['bios-tables-test'] : []) + \
   ['boot-serial-test',
    'cpu-plug-test']
 
-- 
MST



  parent reply	other threads:[~2025-06-01 15:27 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-01 15:24 [PULL 00/31] virtio,pci,pc: features, fixes, tests Michael S. Tsirkin
2025-06-01 15:24 ` [PULL 01/31] virtio: check for validity of indirect descriptors Michael S. Tsirkin
2025-06-01 15:24 ` [PULL 02/31] hw/i386/amd_iommu: Fix device setup failure when PT is on Michael S. Tsirkin
2025-06-01 15:24 ` [PULL 03/31] hw/i386/amd_iommu: Fix xtsup when vcpus < 255 Michael S. Tsirkin
2025-06-01 15:24 ` [PULL 04/31] pcie: Add helper to declare PASID capability for a pcie device Michael S. Tsirkin
2025-06-01 15:24 ` [PULL 05/31] pcie: Helper functions to check if PASID is enabled Michael S. Tsirkin
2025-06-01 15:24 ` [PULL 06/31] pcie: Helper function to check if ATS " Michael S. Tsirkin
2025-06-01 15:25 ` [PULL 07/31] pcie: Add a helper to declare the PRI capability for a pcie device Michael S. Tsirkin
2025-06-01 15:25 ` [PULL 08/31] pcie: Helper functions to check to check if PRI is enabled Michael S. Tsirkin
2025-06-01 15:25 ` [PULL 09/31] pci: Cache the bus mastering status in the device Michael S. Tsirkin
2025-06-01 15:25 ` [PULL 10/31] pci: Add an API to get IOMMU's min page size and virtual address width Michael S. Tsirkin
2025-06-01 15:25 ` [PULL 11/31] memory: Store user data pointer in the IOMMU notifiers Michael S. Tsirkin
2025-06-01 15:25 ` [PULL 12/31] pci: Add a pci-level initialization function for " Michael S. Tsirkin
2025-06-01 15:25 ` [PULL 13/31] pci: Add a pci-level API for ATS Michael S. Tsirkin
2025-06-01 15:25 ` [PULL 14/31] pci: Add a PCI-level API for PRI Michael S. Tsirkin
2025-06-01 15:25 ` [PULL 15/31] uefi-test-tools:: Add LoongArch64 support Michael S. Tsirkin
2025-06-01 15:25 ` [PULL 16/31] tests/data/uefi-boot-images: Add ISO image for LoongArch system Michael S. Tsirkin
2025-06-01 15:25 ` [PULL 17/31] tests/qtest/bios-tables-test: Use MiB macro rather hardcode value Michael S. Tsirkin
2025-06-01 15:25 ` [PULL 18/31] tests/acpi: Add empty ACPI data files for LoongArch Michael S. Tsirkin
2025-06-01 15:25 ` Michael S. Tsirkin [this message]
2025-06-01 15:25 ` [PULL 20/31] rebuild-expected-aml.sh: Add support " Michael S. Tsirkin
2025-06-01 15:25 ` [PULL 21/31] tests/acpi: Fill acpi table data " Michael S. Tsirkin
2025-06-01 15:25 ` [PULL 22/31] tests/acpi: Remove stale allowed tables Michael S. Tsirkin
2025-06-01 15:25 ` [PULL 23/31] vhost: Don't set vring call if guest notifier is unused Michael S. Tsirkin
2025-06-01 15:25 ` [PULL 24/31] vdpa: check for iova tree initialized at net_client_start Michael S. Tsirkin
2025-06-01 15:25 ` [PULL 25/31] vdpa: reorder vhost_vdpa_set_backend_cap Michael S. Tsirkin
2025-06-01 15:25 ` [PULL 26/31] vdpa: set backend capabilities at vhost_vdpa_init Michael S. Tsirkin
2025-06-01 15:25 ` [PULL 27/31] vdpa: add listener_registered Michael S. Tsirkin
2025-06-01 15:25 ` [PULL 28/31] vdpa: reorder listener assignment Michael S. Tsirkin
2025-06-01 15:25 ` [PULL 29/31] vdpa: move iova_tree allocation to net_vhost_vdpa_init Michael S. Tsirkin
2025-06-01 15:26 ` [PULL 30/31] vdpa: move memory listener register to vhost_vdpa_init Michael S. Tsirkin
2025-06-01 15:26 ` [PULL 31/31] hw/i386/pc_piix: Fix RTC ISA IRQ wiring of isapc machine Michael S. Tsirkin
2025-06-02  8:39 ` [PULL 00/31] virtio,pci,pc: features, fixes, tests Michael S. Tsirkin
2025-06-02 16:39 ` Stefan Hajnoczi
2025-06-02 17:54   ` Michael S. Tsirkin
2025-06-02 18:25     ` Stefan Hajnoczi
2025-06-02 18:31       ` Michael S. Tsirkin
2025-06-02 21:58         ` Michael S. Tsirkin
2025-06-02 22:27           ` Stefan Hajnoczi
2025-06-03  1:09           ` Bibo Mao
2025-06-02 20:43 ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16736bf01b79ef411dbab75289979e283153ea23.1748791463.git.mst@redhat.com \
    --to=mst@redhat.com \
    --cc=anisinha@redhat.com \
    --cc=farosas@suse.de \
    --cc=imammedo@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=maobibo@loongson.cn \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).