550d33d
From 66f3928b40991d8467a3da086688f73d061886c8 Mon Sep 17 00:00:00 2001
550d33d
From: Gavin Shan <gshan@redhat.com>
550d33d
Date: Wed, 11 May 2022 18:01:35 +0800
550d33d
Subject: [PATCH 02/16] qtest/numa-test: Specify CPU topology in
550d33d
 aarch64_numa_cpu()
550d33d
MIME-Version: 1.0
550d33d
Content-Type: text/plain; charset=UTF-8
550d33d
Content-Transfer-Encoding: 8bit
550d33d
550d33d
RH-Author: Gavin Shan <gshan@redhat.com>
550d33d
RH-MergeRequest: 86: hw/arm/virt: Fix the default CPU topology
550d33d
RH-Commit: [2/6] b851e7ad59e057825392ddf75e9040cc102a0385 (gwshan/qemu-rhel-9)
550d33d
RH-Bugzilla: 2041823
550d33d
RH-Acked-by: Eric Auger <eric.auger@redhat.com>
550d33d
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
550d33d
RH-Acked-by: Andrew Jones <drjones@redhat.com>
550d33d
550d33d
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2041823
550d33d
550d33d
The CPU topology isn't enabled on arm/virt machine yet, but we're
550d33d
going to do it in next patch. After the CPU topology is enabled by
550d33d
next patch, "thread-id=1" becomes invalid because the CPU core is
550d33d
preferred on arm/virt machine. It means these two CPUs have 0/1
550d33d
as their core IDs, but their thread IDs are all 0. It will trigger
550d33d
test failure as the following message indicates:
550d33d
550d33d
[14/21 qemu:qtest+qtest-aarch64 / qtest-aarch64/numa-test ERROR
550d33d
1.48s killed by signal 6 SIGABRT
550d33d
>>> G_TEST_DBUS_DAEMON=/home/gavin/sandbox/qemu.main/tests/dbus-vmstate-daemon.sh \
550d33d
QTEST_QEMU_STORAGE_DAEMON_BINARY=./storage-daemon/qemu-storage-daemon \
550d33d
QTEST_QEMU_BINARY=./qemu-system-aarch64 \
550d33d
QTEST_QEMU_IMG=./qemu-img MALLOC_PERTURB_=83 \
550d33d
/home/gavin/sandbox/qemu.main/build/tests/qtest/numa-test --tap -k
550d33d
――――――――――――――――――――――――――――――――――――――――――――――
550d33d
stderr:
550d33d
qemu-system-aarch64: -numa cpu,node-id=0,thread-id=1: no match found
550d33d
550d33d
This fixes the issue by providing comprehensive SMP configurations
550d33d
in aarch64_numa_cpu(). The SMP configurations aren't used before
550d33d
the CPU topology is enabled in next patch.
550d33d
550d33d
Signed-off-by: Gavin Shan <gshan@redhat.com>
550d33d
Reviewed-by: Yanan Wang <wangyanan55@huawei.com>
550d33d
Message-id: 20220503140304.855514-3-gshan@redhat.com
550d33d
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
550d33d
(cherry picked from commit ac7199a2523ce2ccf8e685087a5d177eeca89b09)
550d33d
Signed-off-by: Gavin Shan <gshan@redhat.com>
550d33d
---
550d33d
 tests/qtest/numa-test.c | 3 ++-
550d33d
 1 file changed, 2 insertions(+), 1 deletion(-)
550d33d
550d33d
diff --git a/tests/qtest/numa-test.c b/tests/qtest/numa-test.c
550d33d
index 90bf68a5b3..aeda8c774c 100644
550d33d
--- a/tests/qtest/numa-test.c
550d33d
+++ b/tests/qtest/numa-test.c
550d33d
@@ -223,7 +223,8 @@ static void aarch64_numa_cpu(const void *data)
550d33d
     QTestState *qts;
550d33d
     g_autofree char *cli = NULL;
550d33d
 
550d33d
-    cli = make_cli(data, "-machine smp.cpus=2 "
550d33d
+    cli = make_cli(data, "-machine "
550d33d
+        "smp.cpus=2,smp.sockets=1,smp.clusters=1,smp.cores=1,smp.threads=2 "
550d33d
         "-numa node,nodeid=0,memdev=ram -numa node,nodeid=1 "
550d33d
         "-numa cpu,node-id=1,thread-id=0 "
550d33d
         "-numa cpu,node-id=0,thread-id=1");
550d33d
-- 
550d33d
2.31.1
550d33d