From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 49A16C4450A for ; Sat, 18 Jul 2026 22:15:24 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wlDJb-00051u-1v; Sat, 18 Jul 2026 18:15:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wlDJP-0004N7-8v; Sat, 18 Jul 2026 18:15:13 -0400 Received: from pdx-out-013.esa.us-west-2.outbound.mail-perimeter.amazon.com ([34.218.115.239]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wlDJM-00077b-Hf; Sat, 18 Jul 2026 18:15:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1784412908; x=1815948908; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sMgON8zw7UXzsdFmPjwHuJJjo51/jz+OnnQ10iZLMjY=; b=GH+oZRxrMZpM04P/cRkz4+5WouNnhoCCE0PTAT48XCUHBiim/AR6akVB rzi8HJVgzkfCoACUUB1M4Af1tU71dS0k+ibvXZYLyrIfzGzAdYb+akCAP 0GGRo204HrfHjfZAV8nKwvb+F4zl+1CXFBprccttBCv37Fw3L+geVZgwh sP/uGXE/Cr5m1sYA2aV9g+l/52ESLkAAsSiqsVQ/GCJ6+MPa3LTDhzHYK 3cKeLTOYaEX3tLuUY4Zx0fNhhkh8xf0LbW2aluOFddSipBzujM3uEUi8z HDXxxk2EHbOcrsIdfdlmjblSKwazAg63ijI/LNbvK6UZ11oZyI+O3yiHN Q==; X-CSE-ConnectionGUID: qs62OKToTi6xw3W4Hm4/wA== X-CSE-MsgGUID: 8dnBRtBrSYOrTI0pyVqUzg== X-IronPort-AV: E=Sophos;i="6.25,171,1779148800"; d="scan'208";a="23720135" Received: from ip-10-5-0-115.us-west-2.compute.internal (HELO smtpout.naws.us-west-2.prod.farcaster.email.amazon.dev) ([10.5.0.115]) by internal-pdx-out-013.esa.us-west-2.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jul 2026 22:14:52 +0000 Received: from EX19MTAUWA001.ant.amazon.com [205.251.233.182:26996] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.40.177:2525] with esmtp (Farcaster) id 12114d36-f71a-4147-9b1f-b70bc73a65b2; Sat, 18 Jul 2026 22:14:52 +0000 (UTC) X-Farcaster-Flow-ID: 12114d36-f71a-4147-9b1f-b70bc73a65b2 Received: from EX19D001UWA001.ant.amazon.com (10.13.138.214) by EX19MTAUWA001.ant.amazon.com (10.250.64.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.43; Sat, 18 Jul 2026 22:14:52 +0000 Received: from ip-10-253-83-51.amazon.com (172.19.99.218) by EX19D001UWA001.ant.amazon.com (10.13.138.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.43; Sat, 18 Jul 2026 22:14:42 +0000 From: Alexander Graf To: CC: , , , , Song Gao <17746591750@163.com>, Aditya Gupta , Alexey Kardashevskiy , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Farhan Ali , Alistair Francis , "Alistair Francis" , Antony Pavlov , Markus Armbruster , Artyom Tarasenko , BALATON Zoltan , Felipe Balbi , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Christian Borntraeger , Brian Cain , Hendrik Brueckner , Chao Liu , "Huacai Chen" , =?UTF-8?q?Cl=C3=A9ment=20Chigot?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Helge Deller , Dorjoy Chowdhury , "Edgar E . Iglesias" , Alexandre Iooss , Eric Farman , Fabiano Rosas , Francisco Iglesias , "Gaurav Sharma" , Gautam Gala , "Harsh Prateek Bora" , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Jan Kiszka , Max Filippov , Joel Stanley , Jared Rossi , Tyrone Ting , Frederic Konrad , Laurent Vivier , "Manos Pitsidianakis" , Bibo Mao , Mark Cave-Ayland , Glenn Miles , Matthew Rosato , Michael Rolnik , "Michael S . Tsirkin" , Niek Linnenbank , Nicholas Piggin , Palmer Dabbelt , Halil Pasic , Paolo Bonzini , Peter Maydell , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Pierrick Bouvier" , Richard Henderson , Sai Pavan Boddu , Samuel Tardieu , Bernhard Beschow , Stafford Horne , Sergio Lopez , "Subbaraya Sundeep" , Thomas Huth , "Ran Wang" , Hao Wu Subject: [RFC PATCH v2 135/137] tests/qtest/qom-test: Add smp-max init-time ceiling test Date: Sat, 18 Jul 2026 21:36:50 +0000 Message-ID: <20260718213652.37673-136-graf@amazon.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20260718213652.37673-1-graf@amazon.com> References: <20260711223707.42139-1-graf@amazon.com> <20260718213652.37673-1-graf@amazon.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.19.99.218] X-ClientProxiedBy: EX19D043UWC003.ant.amazon.com (10.13.139.240) To EX19D001UWA001.ant.amazon.com (10.13.138.214) Received-SPF: pass client-ip=34.218.115.239; envelope-from=prvs=65292d44c=graf@amazon.de; helo=pdx-out-013.esa.us-west-2.outbound.mail-perimeter.amazon.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.01, SPF_HELO_NONE=0.001, T_SPF_PERMERROR=0.01, UNPARSEABLE_RELAY=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org Sender: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org Add a slow-mode subtest that boots aarch64/virt and ppc64/pseries at their maximum -smp count and asserts that qtest_init() returns within 15 seconds. This guards against quadratic-time init regressions when many child objects are created under a single parent, such as the "[*]" auto-index property scan that made pseries take ~10 s to launch before qemu_extend_irqs() switched to explicit indices. AI-used-for: code (refactoring) Signed-off-by: Alexander Graf --- tests/qtest/qom-test.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tests/qtest/qom-test.c b/tests/qtest/qom-test.c index cf4c6b5add..0bfb3233ac 100644 --- a/tests/qtest/qom-test.c +++ b/tests/qtest/qom-test.c @@ -238,8 +238,32 @@ static void test_qom_qtests(void) qtest_quit(qts); } +/* + * Guard against O(n^2) init-time regressions when many child objects are + * created under one parent (e.g. board-created CPUs). Launch the machine + * at its maximum SMP count and assert an upper bound on time-to-monitor. + * The bound is generous (15 s) so this only fires when init cost blows up + * quadratically, not on ordinary CI jitter. + */ +static void test_smp_max(gconstpointer data) +{ + const char *args = data; + gint64 t0, dt; + QTestState *qts; + + t0 = g_get_monotonic_time(); + qts = qtest_initf("%s", args); + dt = g_get_monotonic_time() - t0; + + g_test_message("smp-max init time: %" G_GINT64_FORMAT " ms", dt / 1000); + g_assert_cmpint(dt, <, 15 * G_USEC_PER_SEC); + + qtest_quit(qts); +} + int main(int argc, char **argv) { + const char *arch = qtest_get_arch(); char *v_env = getenv("V"); if (v_env) { @@ -251,5 +275,16 @@ int main(int argc, char **argv) qtest_cb_for_every_machine(add_machine_test_case, g_test_quick()); qtest_add_func("qom/qom-qtests", test_qom_qtests); + if (g_test_slow()) { + if (g_str_equal(arch, "aarch64")) { + qtest_add_data_func("qom/smp-max/virt", + "-M virt,gic-version=max -smp 512", + test_smp_max); + } else if (g_str_equal(arch, "ppc64")) { + qtest_add_data_func("qom/smp-max/pseries", + "-M pseries -smp 512", test_smp_max); + } + } + return g_test_run(); } -- 2.47.1