From patchwork Tue Jan 28 13:54:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13952576 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 lists.gnu.org (lists.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 8C61BC0218D for ; Tue, 28 Jan 2025 13:55:22 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcm3L-0004XO-S6; Tue, 28 Jan 2025 08:54:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tcm36-0004Sg-Tw for qemu-devel@nongnu.org; Tue, 28 Jan 2025 08:54:41 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tcm35-0006Yn-A3 for qemu-devel@nongnu.org; Tue, 28 Jan 2025 08:54:40 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-436345cc17bso40353585e9.0 for ; Tue, 28 Jan 2025 05:54:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738072476; x=1738677276; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xFX3tCyD8J8AsK027Or5bRe/fC+DXtJLFTNEYqXZkJ0=; b=KzKpqIB1fQ7eS0wvaQ5VJeIJBGjxaOmmXyMClK+RF/9ckMQ6+rE7Km4rR044ramPNV nhLZPoLpk+Dy/4HPTykpdyabeVL93qmVxpbNnOAcd2mbC+2yI8pVhUN6TJVr+SCXCYdp 4SeL50RgUFJNIAGmwjbdV6J93Uj1R0OvruLRX20XecQEOE0yy5iE280FYr6SItvPeSID b2QZUjwKuLAduAD533iE+godwxiwaO+IXEV6zX06GG+tAOkpnMhf90PRbHeOBP7OGX40 BVzHiv3HCCjse76yZMIbhls8XAgz3ZoHtzrWda+IXRan8A1TjMvZWiijXd6PiAx1mOe1 cQcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738072476; x=1738677276; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xFX3tCyD8J8AsK027Or5bRe/fC+DXtJLFTNEYqXZkJ0=; b=iV9hWeIZfqSYZfKq9MLp1UAzeXH7sE+O9XTRoX859yRH77uZGZQ1+4WW0JIRz3cSSw mvxYA5iR12w96VRZx9mf34rGWYeKENO4Wq4zHYNqzIINmmojJ8jRFlIUIntcfj04QayV qrqnH4Vf8P0+s/oOTNe0fYDV1PFLN+v0xuOFsMTF3olBQSRDFxRZpv36jDegBhl8tcBT u6FhQZEJCB25JF1XG0KwRfTWWzU5ct4JRES+Gqdjo/NTRUr0JzP/RT/26G+I2VqUq9tz 7Xlxag19bZ0ctHZawd6LEGAiiXSl9rakiF5tuhdqMQep8xp8YYIQF2pTBv78Vvp7VAMB A4AA== X-Gm-Message-State: AOJu0Yz35AB+W36g2FPK5CQOXzotD+febkN5juDE7UGZeQpJYMgE/DvP 0K3prAFMja5l+D+1b5F11RR7nyomvPuDDhydBX86GEonyAsGi4x52Gybl4ygR1y3k11MgPp3IZ+ TVNg= X-Gm-Gg: ASbGncuK1591MMN8tB+fuKYOSKEgkg5/bqtMmwA7ltMFsznuTZgLpagJy2LM4xlKMVt ojKOl7L6XpOsRDM+sBN+1xv4WCr1OHc9aKqSVT0tjRRcyNf9g0cJtdiIdFl+KCvb9Bk1Hdd6pFY PCTBV1yo+gnRTBajmkS3YV/1ubzvklJA5u2E70uJdNs2DCE28i23iTZzaSGHWnViuuixPQeCP03 yjgkngZ3C3/slQzB6rjReeQS0moPyVrrZbm6k8hkZfsNqwm6rFgm3a3k7XNZuJGMdAejEhDQnf+ K4WEztWerLUGxY8PqOu+eDBAqOdez+L6/dsyNyWIbhLuIWAb81hQl1b2CYz4ESmq5w== X-Google-Smtp-Source: AGHT+IFACyEWOGSeWrN0Jbyt1XTZ0wcCq1PQoT8zk7QDW032i2AACfFKvtrPgaE6qgWr0/IwqfDm3Q== X-Received: by 2002:a05:600c:4f48:b0:42c:b16e:7a22 with SMTP id 5b1f17b1804b1-438913cb740mr458739165e9.12.1738072476039; Tue, 28 Jan 2025 05:54:36 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd5730a6sm167998125e9.35.2025.01.28.05.54.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 28 Jan 2025 05:54:35 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Paolo Bonzini , Laurent Vivier , Thomas Huth , Hyman Huang , Phil Dennis-Jordan , Peter Xu , Akihiko Odaki , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 1/7] migration/dirtyrate: Do not unlock cpu_list lock twice Date: Tue, 28 Jan 2025 14:54:23 +0100 Message-ID: <20250128135429.8500-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250128135429.8500-1-philmd@linaro.org> References: <20250128135429.8500-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@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-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org &qemu_cpu_list_lock is locked within the WITH_QEMU_LOCK_GUARD() context, then unlocked. No need to manually unlock it. Fixes: 370ed600296 ("cpu: expose qemu_cpu_list_lock for lock-guard use") Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Fabiano Rosas Reviewed-by: Richard Henderson --- migration/dirtyrate.c | 1 - 1 file changed, 1 deletion(-) diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c index 7c955894e47..4b94dd7c500 100644 --- a/migration/dirtyrate.c +++ b/migration/dirtyrate.c @@ -174,7 +174,6 @@ retry: if (gen_id != cpu_list_generation_id_get()) { g_free(records); g_free(stat->rates); - cpu_list_unlock(); goto retry; } vcpu_dirty_stat_collect(records, false); From patchwork Tue Jan 28 13:54:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13952578 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 lists.gnu.org (lists.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 83EAEC0218D for ; Tue, 28 Jan 2025 13:55:36 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcm3N-0004Xi-IJ; Tue, 28 Jan 2025 08:55:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tcm3A-0004VD-7A for qemu-devel@nongnu.org; Tue, 28 Jan 2025 08:54:45 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tcm38-0006ZY-Iu for qemu-devel@nongnu.org; Tue, 28 Jan 2025 08:54:43 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-385de59c1a0so3220240f8f.2 for ; Tue, 28 Jan 2025 05:54:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738072481; x=1738677281; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9OqktqB1rxHpsEBpE3GI7u9cs3EXThVaOGL6hvU5oq0=; b=QdTFiorpnz4xoVyrlqvbL0rCTvbLC3NbggRrQwpnwt9+7ebnRwUBWJigMmP/CHvUVV 2usHeWa1EGHOOMTqTJsO2xVc9e9J/lhZ20QVKmxm4jQ5c8LaYO0Pl/PYI+QmeIXFzT2x CKJ/8znJb6wWG++Fy+bQVK2I9fWqwB6nmJwns8DDu91FssSSgolGYy7U3QjEYnDEcm0C Yp6bE1UYwTe01bLtJ2fLBuou95gOeY/q84kKoeBzuva6pGjANMOIadUrdgpecQ+uzXKy y+7pMuZqVd5YRWG8nloJ/gWJMTlyz9TqCGM525IyOWjjuTA54V6IquynPGLIFBR/fipE yI8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738072481; x=1738677281; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9OqktqB1rxHpsEBpE3GI7u9cs3EXThVaOGL6hvU5oq0=; b=YtH625zOe61r9UpkerGYqZJPK3/yIvPIjIkZH0I6rs6irofjQ2D+nXe6zQOhE6u+yv vbD5HB79VtbZkaz11c32kw07vQXxtu8hiNbh/mMjUEYh4fR8/hc/ks0PU9S9Muodt5ig hHtJhReyYq3h7cHRdz39Kmv/zCpbMF2JolizY9sVoWKftDsXn1bUoAjqT1R8YZJ8QyLk 4KjBx9RIMUtYheDQvcSNti37zKimC3W5d1ckjqLjBI5m/A7a4+qLIoNwn4LeYjdvB0tf Ny2pPb+M4V039C89UE+PDwFHGuMlQTliK+ZOkJdFELQCZjrysn38Ewh57e6gK07WUAHi 3Kyw== X-Gm-Message-State: AOJu0YwYOmeP7Fd8SZqDyDTJaSJ0nBtcMJIEDaYYsuagknTZzptmnTn4 n93kXdIgn6ufTH+V6JepO0HowqywOcTWWUIyKSu4d6xR62+YTDXmsDv3hLI8aXxmTt81St10rPS Gqco= X-Gm-Gg: ASbGncsb4koew173mNDk2OvvRzHmBS8DmjNoeOaBR7gn6nmKSmix7fy6ZoEbvMDJH2O 3xaxnxwJEbcya6dl9dKe9FTrQfUqRMMpP19125TyQxH+lOWQMS4iawjnTKqs/ZR/9O/0sGzpsGp yPJtwwhdCUrESSDO8XwdhJom+NcRhCAGMU6YMYQXDDXm6E0kKyDAL2dgihZ9WhOexSP9OK0PiMS 8Y7nuACb9iFNB0OcqdZzpAZxNSRCbpi6/9q5JKeDMjHKgl6npaX1yw8sgy2GArcKVFcXdI0zRuu Q2yW1tC5/OAkxpd0DMvrjPizWs9vQ0ol5zcl5Gs196x8EkibnBFaAuFp09O/nJIdIg== X-Google-Smtp-Source: AGHT+IFPyEpMlGMTXs6HfcBqLlnki84bRZf617fpYYAcbcHARWj7MLspbW+kvULKg0jfVY1MiFvUVw== X-Received: by 2002:a05:6000:1acd:b0:38a:88be:bcb5 with SMTP id ffacd0b85a97d-38bf56555f4mr37657628f8f.5.1738072480797; Tue, 28 Jan 2025 05:54:40 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c3ec83e20sm7499727f8f.23.2025.01.28.05.54.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 28 Jan 2025 05:54:40 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Paolo Bonzini , Laurent Vivier , Thomas Huth , Hyman Huang , Phil Dennis-Jordan , Peter Xu , Akihiko Odaki , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/7] tests/qtest/migration: Make 'has_dirty_ring' generic Date: Tue, 28 Jan 2025 14:54:24 +0100 Message-ID: <20250128135429.8500-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250128135429.8500-1-philmd@linaro.org> References: <20250128135429.8500-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@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-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Keep accelerator knowledge limited within MigrationTestEnv, expose a generic %has_dirty_ring value, only checking for KVM when initializing it in migration_get_env(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Fabiano Rosas --- tests/qtest/migration/framework.c | 2 +- tests/qtest/migration/precopy-tests.c | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/qtest/migration/framework.c b/tests/qtest/migration/framework.c index 4550cda129c..a3bd92a9519 100644 --- a/tests/qtest/migration/framework.c +++ b/tests/qtest/migration/framework.c @@ -946,7 +946,7 @@ MigrationTestEnv *migration_get_env(void) return env; } - env->has_dirty_ring = kvm_dirty_ring_supported(); + env->has_dirty_ring = env->has_kvm && kvm_dirty_ring_supported(); env->has_uffd = ufd_version_check(&env->uffd_feature_thread_id); env->arch = qtest_get_arch(); env->is_x86 = !strcmp(env->arch, "i386") || !strcmp(env->arch, "x86_64"); diff --git a/tests/qtest/migration/precopy-tests.c b/tests/qtest/migration/precopy-tests.c index 23599b29ee2..8dcd0ad2660 100644 --- a/tests/qtest/migration/precopy-tests.c +++ b/tests/qtest/migration/precopy-tests.c @@ -983,8 +983,7 @@ void migration_test_add_precopy(MigrationTestEnv *env) if (g_test_slow()) { migration_test_add("/migration/auto_converge", test_auto_converge); - if (g_str_equal(env->arch, "x86_64") && - env->has_kvm && env->has_dirty_ring) { + if (g_str_equal(env->arch, "x86_64") && env->has_dirty_ring) { migration_test_add("/dirty_limit", test_dirty_limit); } @@ -999,8 +998,7 @@ void migration_test_add_precopy(MigrationTestEnv *env) test_multifd_tcp_no_zero_page); migration_test_add("/migration/multifd/tcp/plain/cancel", test_multifd_tcp_cancel); - if (g_str_equal(env->arch, "x86_64") - && env->has_kvm && env->has_dirty_ring) { + if (g_str_equal(env->arch, "x86_64") && env->has_dirty_ring) { migration_test_add("/migration/dirty_ring", test_precopy_unix_dirty_ring); From patchwork Tue Jan 28 13:54:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13952575 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 lists.gnu.org (lists.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 D6E89C0218A for ; Tue, 28 Jan 2025 13:55:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcm3Z-0004a9-C3; Tue, 28 Jan 2025 08:55:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tcm3F-0004WO-Ke for qemu-devel@nongnu.org; Tue, 28 Jan 2025 08:54:51 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tcm3E-0006aW-2m for qemu-devel@nongnu.org; Tue, 28 Jan 2025 08:54:49 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-43634b570c1so40017535e9.0 for ; Tue, 28 Jan 2025 05:54:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738072486; x=1738677286; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0i342P8VSr9afA5LND7tALkWhr4DBdVvCjT09Me9Agg=; b=PeIXKkOv/DI7xdIOEg1AeLXDUInspFnBiL0+1hVgMGWhPfypaavq8oLz0BY0TTnpGg 8Cb0XfpIKjTILIV79vn8g0Yj7krtKCrR/apskwdUsH5P+5xy3aF8Dj1PdYF2mins9RwI uSpt01iDeLpKvxPM+sij0BhO5AVdUCkTAHJGZLpd2aUqoMLzQzM7SzXkVmYKRFPApKKr /zUrjQ0VjHE5izYNk2B+CD1fN7su4UBqcfEilspEfs2bd5hwLV5ODXjBNhS1yeaaAZgs jNuOtyxdAY+TJyQ013h9bQVvDSFWdqgdVtOJaACG7m1alFLtzNRFzJW494Hm7rbnKujy kODQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738072486; x=1738677286; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0i342P8VSr9afA5LND7tALkWhr4DBdVvCjT09Me9Agg=; b=TptS064fgIsa7hRlYlSsnIPNgIGfZxwbCj5iU/B5GJG7wjQoFNf2RqPskL76rcatrW fKa/ulm3IMsza3K464ygCxtsrpdKZASJ6bfhtTtMNNFoxksspZRyaflH15w1l3BUIner 2jiUra3vvN7zgx6xRgC569einNPaC09WoCDEP6g2GNEEQ6ABWjHXcpJQpqnW2KZFN9St bZapQD/OnrA+2ahZDnoZmzN84kYr8tsyx6ftWC6aD2UH5eTvDJGBMZ98gMEQS4M78CDK 9IOTJ/e42Kiq0ypP0HEUeJvlF7HBcLls+afrHBH7lDhuuF1khcqZrC0CooQBK6Yc+zWO ikcw== X-Gm-Message-State: AOJu0YyCEOtCR/iBnfiOZXc6Vhv1hrWcdx8Q0DayRMgRSMHeVVb4BwQg +Te5Lp5qd8PiTQkvi0Jg5wb6zOZR0KWnX1bzSFP2C+owMv748rYaGhgmXZ1vyaRPkCVAM+tsig6 mBpI= X-Gm-Gg: ASbGncvOqgfbLHD7YLme5Q1KFqH81WuRnjqYQxAZufWNDVDgT/G4faIIG05+qLascKa wcQoD44OIFE/fNgkyGtn5Z3Yi+rGKVGd23ti8/56fY+KXJUnm+zeXSV62Lvfr4Pf2dRj728r9YX AfCcvdwwDIT7XyN9TXapim9of/Fg5NwsZ4DWuozAu8hG60Lxe3otx7mJX2SCRlusET4w/T5Ii2u ITZilxIgjC29IQRYjkNoYE6t2qTJJ+vhbxsOlm1NYNynJ6e3LnAFXjO4YbsL3hDaCQW/nUOohtS f5MLVT++aWqA5KKdl1qDahiwsg070sUSiqrIY9FwlARNvE+217V+5D5o6Gx/2Nw3MQ== X-Google-Smtp-Source: AGHT+IFszYMNCA760X/36juug+cQmcxc9DtQ3nSuMbWEchxTwOYnx8pEHvT0Le588CdPOzffkysKLQ== X-Received: by 2002:a05:600c:1f82:b0:436:fbe0:cebe with SMTP id 5b1f17b1804b1-43891452f6emr461566115e9.30.1738072485683; Tue, 28 Jan 2025 05:54:45 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438d75de282sm11809185e9.2.2025.01.28.05.54.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 28 Jan 2025 05:54:45 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Paolo Bonzini , Laurent Vivier , Thomas Huth , Hyman Huang , Phil Dennis-Jordan , Peter Xu , Akihiko Odaki , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 3/7] tests/qtest/migration: Initialize MigrationTestEnv::arch early Date: Tue, 28 Jan 2025 14:54:25 +0100 Message-ID: <20250128135429.8500-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250128135429.8500-1-philmd@linaro.org> References: <20250128135429.8500-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@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-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Some tests expect MigrationTestEnv::arch to be set. Initialize it early enough to avoid SIGSEGV, for example like the following g_str_equal() call in migration/precopy-tests.c: 954 void migration_test_add_precopy(MigrationTestEnv *env) 955 { ... 1001 if (g_str_equal(env->arch, "x86_64") && env->has_dirty_ring) { 1002 1003 migration_test_add("/migration/dirty_ring", 1004 test_precopy_unix_dirty_ring); Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Fabiano Rosas Reviewed-by: Richard Henderson --- tests/qtest/migration/framework.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qtest/migration/framework.c b/tests/qtest/migration/framework.c index a3bd92a9519..38a0a1a5264 100644 --- a/tests/qtest/migration/framework.c +++ b/tests/qtest/migration/framework.c @@ -938,6 +938,8 @@ MigrationTestEnv *migration_get_env(void) exit(1); } + env->arch = qtest_get_arch(); + env->has_kvm = qtest_has_accel("kvm"); env->has_tcg = qtest_has_accel("tcg"); @@ -948,7 +950,6 @@ MigrationTestEnv *migration_get_env(void) env->has_dirty_ring = env->has_kvm && kvm_dirty_ring_supported(); env->has_uffd = ufd_version_check(&env->uffd_feature_thread_id); - env->arch = qtest_get_arch(); env->is_x86 = !strcmp(env->arch, "i386") || !strcmp(env->arch, "x86_64"); env->tmpfs = g_dir_make_tmp("migration-test-XXXXXX", &err); From patchwork Tue Jan 28 13:54:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13952577 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 lists.gnu.org (lists.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 EC0CCC0218A for ; Tue, 28 Jan 2025 13:55:27 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcm3b-0004i5-T5; Tue, 28 Jan 2025 08:55:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tcm3N-0004a4-Vg for qemu-devel@nongnu.org; Tue, 28 Jan 2025 08:55:03 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tcm3J-0006bB-F3 for qemu-devel@nongnu.org; Tue, 28 Jan 2025 08:54:55 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-436a03197b2so38154805e9.2 for ; Tue, 28 Jan 2025 05:54:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738072491; x=1738677291; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Js4tcXY+4Im8Bd7IwohrqklQy95jFm8lPyjSB87jskE=; b=f6CYeyWGo5k2AY2zrIcK4hr9B5p4LWdHxiUsS4ERRIScORrQFPOdYKrCsypK739oOR NekkF+IcC2cfPTlo2WGUd5dKcxoQ73TnrsUlJ4Vrc0q6e+6l0J6oV1n86i2HMn434QSP j/IB+WpcUnrjzdmmjfA1u2hWYmBSfBmcSgUJ98sfgDAcfwAydQaBUKAsI1CtFe+X9XG+ 63umuBXtNUwoRrghSVv0b3yj/wVtyEIoe6PKWQjGYOlaERzGf3TZ30Uji+I5JiMiecZg nkJjC+WrF7/dC8PRurFw/Y9hsS7D+tS/ZVaxtSLJlpgmRcWOE2Ox8WSFNAmDsbKLcDfn wLwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738072491; x=1738677291; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Js4tcXY+4Im8Bd7IwohrqklQy95jFm8lPyjSB87jskE=; b=mOX5JcoFyKrv0jPGzHgmnADxfr89CteAFE4y/vH+6jqRJOk7sbGwM6xkc7k+IsVUu7 vemh592Wg8BFcrRhJvzOksv77TI00wMunQq3MoP6AwwbUv2UAjr8zZ+lTfUBwunk5y+T RLCvMCd2sDfyzrSOyUZ4nbQmc0lQx8jM+ps+SQZua8ArYZzvFYFTtv4DHshMHKZs0FlT qLgaWzxZH2DzKVHmRKiWzY4RNWbt/zzksh80afjnf7m2JXuaLWjBnzEhNKNpXSxYGZvc 2j8PLesVgyF86EZqBSuk6UAvC8UV4JdRG4g6LiHGzMr0xWmvHA4k4fz2/kHzfPSvWGli 8V8g== X-Gm-Message-State: AOJu0YzgLywAXc8ygC9WVE7mtKyhvViqyYWblex0g7SKNWWtJhlMF7Gc K3LDlFWau5FkOM69OmhE3PYAfhr59CfOjM26W6iDY7FeX2VdeQ2dA5mCeEtB7yezB0ysLiMMIm1 CzNE= X-Gm-Gg: ASbGncsE/ClF8Xifr3BTqo9h7bg1aMaPYSv6KD0QgrlGa48U0FYCDASBf5S6jf4bPNY sG4VNgXmqM9s1B9KgAgm86njYITC2ue+g/+zj/TzO+DExT13/FM9sQIcd+AntAzyOUiJ5lxqgfN cUHfKb7G2FH2n+1dUZ8TOUTPSY1XCwuWg2iVBOMfbzyyZAA3gFtSbw5aF9mlHcHIp1Iaphhe3Cy RYJzaFlY8bHQGB4mDb2KvJ+Cz/KTo1GTvc61V27uiNtF0CVgGj/URTiuem8JLsJ9ZH5AYZ1cIK+ PsGd4awNuKW82IB9ymXh0IQxAkKnb1DDTKUCbEVp/hjW9wMAoh0bEWXZsQZYOvPOew== X-Google-Smtp-Source: AGHT+IGSNtpfXCfe8dFXbxfxieTzWgmRhuWBqqoUaz0qfcTjqs3qWvQKGQNy9lJrfBfPrZaRLI1U5A== X-Received: by 2002:a05:6000:cc3:b0:385:f47a:e9d1 with SMTP id ffacd0b85a97d-38bf56852bdmr28927870f8f.17.1738072490848; Tue, 28 Jan 2025 05:54:50 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1bb057sm14374562f8f.62.2025.01.28.05.54.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 28 Jan 2025 05:54:50 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Paolo Bonzini , Laurent Vivier , Thomas Huth , Hyman Huang , Phil Dennis-Jordan , Peter Xu , Akihiko Odaki , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 4/7] tests/qtest/migration: Pass accelerator arguments as machine option Date: Tue, 28 Jan 2025 14:54:26 +0100 Message-ID: <20250128135429.8500-5-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250128135429.8500-1-philmd@linaro.org> References: <20250128135429.8500-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@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-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org The '-accel' CLI option is handler as sugar property as '-machine,accel='. Replace the migration tests command line, only using the best accelerator available (first hardware, then software). Signed-off-by: Philippe Mathieu-Daudé --- tests/qtest/migration/framework.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/tests/qtest/migration/framework.c b/tests/qtest/migration/framework.c index 38a0a1a5264..e567296b014 100644 --- a/tests/qtest/migration/framework.c +++ b/tests/qtest/migration/framework.c @@ -214,8 +214,9 @@ int migrate_start(QTestState **from, QTestState **to, const char *uri, const gchar *ignore_stderr; g_autofree char *shmem_opts = NULL; g_autofree char *shmem_path = NULL; - const char *kvm_opts = NULL; - const char *arch = qtest_get_arch(); + const char *accel_args = NULL; + const MigrationTestEnv *env = migration_get_env(); + const char *arch = env->arch; const char *memory_size; const char *machine_alias, *machine_opts = ""; g_autofree char *machine = NULL; @@ -296,8 +297,15 @@ int migrate_start(QTestState **from, QTestState **to, const char *uri, memory_size, shmem_path); } - if (args->use_dirty_ring) { - kvm_opts = ",dirty-ring-size=4096"; + if (env->has_kvm) { + if (args->use_dirty_ring) { + accel_args = "kvm,dirty-ring-size=4096"; + } else { + accel_args = "kvm"; + } + } else { + assert(env->has_tcg); + accel_args = "tcg"; } if (!qtest_has_machine(machine_alias)) { @@ -311,14 +319,12 @@ int migrate_start(QTestState **from, QTestState **to, const char *uri, g_test_message("Using machine type: %s", machine); - cmd_source = g_strdup_printf("-accel kvm%s -accel tcg " - "-machine %s,%s " + cmd_source = g_strdup_printf("-machine %s,%s,accel=%s " "-name source,debug-threads=on " "-m %s " "-serial file:%s/src_serial " "%s %s %s %s", - kvm_opts ? kvm_opts : "", - machine, machine_opts, + machine, machine_opts, accel_args, memory_size, tmpfs, arch_opts ? arch_opts : "", shmem_opts ? shmem_opts : "", @@ -332,15 +338,13 @@ int migrate_start(QTestState **from, QTestState **to, const char *uri, &src_state); } - cmd_target = g_strdup_printf("-accel kvm%s -accel tcg " - "-machine %s,%s " + cmd_target = g_strdup_printf("-machine %s,%s,accel=%s " "-name target,debug-threads=on " "-m %s " "-serial file:%s/dest_serial " "-incoming %s " "%s %s %s %s", - kvm_opts ? kvm_opts : "", - machine, machine_opts, + machine, machine_opts, accel_args, memory_size, tmpfs, uri, arch_opts ? arch_opts : "", shmem_opts ? shmem_opts : "", From patchwork Tue Jan 28 13:54:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13952580 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 lists.gnu.org (lists.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 D417AC0218A for ; Tue, 28 Jan 2025 13:56:34 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcm3d-0004nb-IW; Tue, 28 Jan 2025 08:55:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tcm3Q-0004aj-1j for qemu-devel@nongnu.org; Tue, 28 Jan 2025 08:55:06 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tcm3N-0006bx-JP for qemu-devel@nongnu.org; Tue, 28 Jan 2025 08:54:58 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-436281c8a38so39833745e9.3 for ; Tue, 28 Jan 2025 05:54:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738072495; x=1738677295; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sHTZdSk34mjGYxV+5W6LTI1L6AwP2TGsJTRkRZPId30=; b=I6+cN42Ic3NNltT4lzPMeS2CHPf+hkvEmiSho1CRoBjz+jrWPAYgf7laPJD5mUrJvD 86SxBB/MruLeKGOUhtb0Nhk3ArVEGTfpOIay/sV0H69loTkHB977OvvAOVVzuFvS+ZQI 9UbG7/pXG4nyVpeSPmh/5LqFvLrbL4Ndek18Fco7pWP3dJJZIcoztOhaAE00b3lYzXhj MhB7XhjAEhRs+Ec1ovp2wK1KYXsE7eK5qNWlgBX1N41wtINrFHJss0+Uz4hRGb6CPx3k co+dU3uQB7Og2gNGPo3pGxIq3gMb938Md7zUS+w7E3Jaye5qOZOryfVIE4kION/vq2sX 2UiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738072495; x=1738677295; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sHTZdSk34mjGYxV+5W6LTI1L6AwP2TGsJTRkRZPId30=; b=qPKzqUIK86ZVtDWT4SgOt712NU8/WCtXxO7wGt/OS6WYrnYJUVoWHgQ+s/V93VCL46 YVelrh+6kRcCcYTquH1OxZrdHnzizNZpzCU1dwWuIb4OWRkSLndpzcxFIBLJJ2W3At99 Wt6Ik8o1CbMaUpEG3j8JXqoQJTKQjs7aSiGzJY1GhSdmkvnzG3ASe1pEM59lCe5Idu0o 6tLhv4tI3UuW0XC7Zmm8/xOxhdei7ARzXWpXA4N+UscwAv46X0vwZvuTw8l/AOyXHWSq WShjl200vBk9rohvUVoBy98Xtz8C6zawxlHEshdInF2qPG7M7UjkS8a9dZrULqFiM/t+ ZesA== X-Gm-Message-State: AOJu0YzasxNsAf4BmpYeyLv0NjUkdPdxj8jymwgsBvN3BjbFCMDimLpw O5fhAw/KACORDtwICGmEa/l0qbEGemtAAAJ69/+ujR6rF/JUEpg4vgz8HnhIrrsQbVHl4SVVXBE sgBw= X-Gm-Gg: ASbGncvp6kkAzeSkcfmDWPnA5NORkdZmy+dKgf0VTWNEN4Sg7F6c1H22D4PCxwjZwVk mYNJXR6jh5nEgzUjCGLRZPLwsMnlsyn2ZnMn5V12cKIRy20B90ZYrps7oJAB5IRjvMurt1emZ70 UmM5Z1BG5/XJ8eTh3b/MOR7a+0p3q9UhvGtAEYnY62ZTzt54Q0UDGP2uffjOPLgFPII9byIzlGI k/kW3LQI6crMIyqBap/PT99ym2b0nOxtTvzoua0PSdPgYXEdWOkaYfS5hPu1QpKaoHlw+pma0ju xzOc6wECXljsoQktUGZ/rGE7XilszQKfOo9twE53b9pvFRUgqXjQ50uqMH7gqtzf0Q== X-Google-Smtp-Source: AGHT+IH3P5VJSQPnBVjwzAbJn3gJJoSOcer8OOCQeUNJnIqXYJ5IJypeqppxpzTeV9A3I3UxD+ZHOw== X-Received: by 2002:a05:600c:1987:b0:436:faf1:9da with SMTP id 5b1f17b1804b1-438913c68ebmr397739205e9.2.1738072495662; Tue, 28 Jan 2025 05:54:55 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd507dc9sm172973355e9.19.2025.01.28.05.54.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 28 Jan 2025 05:54:55 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Paolo Bonzini , Laurent Vivier , Thomas Huth , Hyman Huang , Phil Dennis-Jordan , Peter Xu , Akihiko Odaki , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 5/7] tests/qtest/migration: Add MigrationTestEnv::has_hvf field Date: Tue, 28 Jan 2025 14:54:27 +0100 Message-ID: <20250128135429.8500-6-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250128135429.8500-1-philmd@linaro.org> References: <20250128135429.8500-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@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-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Allow tests to tune their parameters when running on HVF. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Fabiano Rosas Reviewed-by: Richard Henderson --- tests/qtest/migration/framework.h | 1 + tests/qtest/migration/framework.c | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/qtest/migration/framework.h b/tests/qtest/migration/framework.h index 7991ee56b6f..76bd4dc1a95 100644 --- a/tests/qtest/migration/framework.h +++ b/tests/qtest/migration/framework.h @@ -19,6 +19,7 @@ typedef struct MigrationTestEnv { bool has_kvm; + bool has_hvf; bool has_tcg; bool has_uffd; bool uffd_feature_thread_id; diff --git a/tests/qtest/migration/framework.c b/tests/qtest/migration/framework.c index e567296b014..5629b8ba4e3 100644 --- a/tests/qtest/migration/framework.c +++ b/tests/qtest/migration/framework.c @@ -945,6 +945,7 @@ MigrationTestEnv *migration_get_env(void) env->arch = qtest_get_arch(); env->has_kvm = qtest_has_accel("kvm"); + env->has_hvf = qtest_has_accel("hvf"); env->has_tcg = qtest_has_accel("tcg"); if (!env->has_tcg && !env->has_kvm) { From patchwork Tue Jan 28 13:54:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13952581 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 lists.gnu.org (lists.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 1B75AC0218A for ; Tue, 28 Jan 2025 13:56:43 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcm3d-0004mJ-9C; Tue, 28 Jan 2025 08:55:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tcm3X-0004eT-JA for qemu-devel@nongnu.org; Tue, 28 Jan 2025 08:55:09 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tcm3T-0006di-HD for qemu-devel@nongnu.org; Tue, 28 Jan 2025 08:55:06 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-385e06af753so3090609f8f.2 for ; Tue, 28 Jan 2025 05:55:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738072500; x=1738677300; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NfNuHQWNeJu5X2wCDgIQnnHrGGyk47oR/kdhbtMYcjw=; b=AEVHp+e57Gd41rHDlvEsxaCHvRpz8C8nKq/vP8rT8vuiXgYysVcVqCP3zgnncC+baq 2KcsT/2yAiQg9ZfIP52SaE44rrCWK8N+wX/ggl5nYp+4K0joJ1K0JyDwB8ug838MeNj2 Ft8rwEpp5IH/y6N9krOJhZNBBc+t5Wx0zTBaqGxKLOLaVyKgwi6mw7gZOTeM4fPkVct7 4x8xZ8pECXzF41McTTEXjNCZHX7oONuvgmqCcedgifJ805PKk8usHhwGsaFAWIV3tFkU YPYJ1rcnraGUOT3lNpsAnMJCxmv9L4TiqqkkrQZI8aGYYL2DWkeggGGmVkz/TJi6EzNn S1bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738072500; x=1738677300; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NfNuHQWNeJu5X2wCDgIQnnHrGGyk47oR/kdhbtMYcjw=; b=oE79qVJU37NHqyGk0FpQogPEfdCfXU2nQzdi4W5tDdJrnAEn27l5tVJoP0BjYfck+8 6Al0Q7FzwRcrOeIZAXBFNNitdSakQHSNQ8yo6FafBRYwZJrpoXAyIYoN4V2OpkZPQMSL 8Rg0Is8TFYVA5f9EESJzTAj5qMGsOHvgpL2Ue6XJvLIjx/FD5doOcfdcyamjqesWVnIY 02yb+qhBaDDrut+rvKZO/3TjYLWMQBA8PWcxgIQSWZhpKVnlUaIk/UH7XET+3u1URjOD 2VED6B3nAUwvqnksvNKz8KUTkn0Ooz1b5+oGfyrVh4TfrhFY15K6iBL7PKvoxJon2cs6 +E3Q== X-Gm-Message-State: AOJu0Yw3WvZKU5LdHCwn8pGSkuFEm2A+pWoBpRfnQVZIfmrNYmDPWSiz ScGgFhpoQ+ziC3l/C8Fu83rOxV8WqKn91Qv1+N76ltuLCiQ5gHyDB1lmpbJ4mXqPsqAFIlxzhR8 vyl4= X-Gm-Gg: ASbGncuoeIzrF3a9oWjeUUcWMXhs9EbX5niWptnTH48rgPPW+N3Re26hTiJo5Mb4StS 2ynx8JzRndMT4OcS1sk3s8ydCqU96t0d+TUWEr54/mNl8NIvJPRcKEyDq8odCw+Qx9y81Rzs3p5 rWxaY1lycIIHtRCuvDLuxkXk61GVN2j3NPeQKDs1n29Y9qvMm0CObH2WZKCRyZ601bHintsjkA8 Pr87QzMWBSwHNmuMFnzr5Z7CGei3x2j8xJd3RhZ28rRJxqSsvuhXuLy+SdTxoTJllyMRIlOuMWP P9LZr1Sb0Y0HCxXvQxCdHScpO64BGotsCHsmX+lukhkVgHRMJT4cDX7CU9EMBquSlg== X-Google-Smtp-Source: AGHT+IF6FaWdiPaqacNKbyj/s2k3FO3tLGIOMg0xoKeEAz10Xzv4C6qQkS0Cwu9Wf1A7n99AR/Eycw== X-Received: by 2002:adf:eb10:0:b0:385:fc00:f5d4 with SMTP id ffacd0b85a97d-38bf566ce7dmr31162296f8f.29.1738072500350; Tue, 28 Jan 2025 05:55:00 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1bad16sm14540405f8f.68.2025.01.28.05.54.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 28 Jan 2025 05:54:59 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Paolo Bonzini , Laurent Vivier , Thomas Huth , Hyman Huang , Phil Dennis-Jordan , Peter Xu , Akihiko Odaki , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 6/7] tests/qtest/migration: Run aarch64/HVF tests using GICv2 Date: Tue, 28 Jan 2025 14:54:28 +0100 Message-ID: <20250128135429.8500-7-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250128135429.8500-1-philmd@linaro.org> References: <20250128135429.8500-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@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-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org GICv3 isn't supported on aarch64/HVF, but GICv2 is. Signed-off-by: Philippe Mathieu-Daudé --- RFC: Test eventually timeouts :( tests/qtest/migration/framework.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/qtest/migration/framework.c b/tests/qtest/migration/framework.c index 5629b8ba4e3..30808de14e0 100644 --- a/tests/qtest/migration/framework.c +++ b/tests/qtest/migration/framework.c @@ -266,7 +266,7 @@ int migrate_start(QTestState **from, QTestState **to, const char *uri, } else if (strcmp(arch, "aarch64") == 0) { memory_size = "150M"; machine_alias = "virt"; - machine_opts = "gic-version=3"; + machine_opts = env->has_hvf ? "gic-version=2" : "gic-version=3"; arch_opts = g_strdup_printf("-cpu max -kernel %s", bootpath); start_address = ARM_TEST_MEM_START; end_address = ARM_TEST_MEM_END; @@ -303,6 +303,8 @@ int migrate_start(QTestState **from, QTestState **to, const char *uri, } else { accel_args = "kvm"; } + } else if (env->has_hvf) { + accel_args = "hvf"; } else { assert(env->has_tcg); accel_args = "tcg"; From patchwork Tue Jan 28 13:54:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13952579 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 lists.gnu.org (lists.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 97588C0218D for ; Tue, 28 Jan 2025 13:55:48 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcm3g-0004pp-VN; Tue, 28 Jan 2025 08:55:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tcm3b-0004hQ-3t for qemu-devel@nongnu.org; Tue, 28 Jan 2025 08:55:11 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tcm3X-0006pf-Fk for qemu-devel@nongnu.org; Tue, 28 Jan 2025 08:55:09 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-436202dd7f6so65060095e9.0 for ; Tue, 28 Jan 2025 05:55:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738072505; x=1738677305; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ggA0ewTkbOxosT43tBc3qZcSHcVtGttVuRMmEBH4Avg=; b=WNL80UOtDKMK4bCUSLNrd/AYAhOenlo5JlXmmnioR8E+j6/jUUnFVnVYrSk9csppiZ aj/EBYYv1Zws59vqO8QVFIPbByB66J154KogXoYg9vhMlPFku1afiR9qDiAzuhGboqC0 J2MphyOusLUGVd1WmznuydhRT/djd8JHe14tmAr4LzJ03aC/A/wpsc/7bv2huJ5uiJ6o VaFVKTu7hJwaclyxmRQczIlxycau3o66gRzHfPjIV0OQgy3REFW2L3c5F3Mi+Ewh529l rk9fNyFAwugTdSZ+0j6QUIwwTVow/uLJnftVjlUNn0H5Zm2kfqfAn8cryKaiSumhzeCv q75w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738072505; x=1738677305; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ggA0ewTkbOxosT43tBc3qZcSHcVtGttVuRMmEBH4Avg=; b=udJEv8QM5TR9YHtDlJI4ChCLp0aavf6G9/7kTd1siCXQ19VimhKH1PPA9g8szDDgbK 9VAc0Ql0+3keUA0FO3C0HgJh/w+KQUgWsdNwwpdYNDzv0JwH/0SBAOj1ZVKJfj4QR7xa te5U6/CxN6WDDwXhZpDkWv/Och9blnOnouj/QCV5/ZuFGX2znF6cbleZGGlthohDQkcw QI3uXh/gh4u7t5njmkVIU8Ur/bsLEuDiPgbsafIQHcKKqmLI8gxU/X30razZwfS6dE2v PPNY1MmP1n6UPIW+hfYEylqJixUnXY3O4m+QxzJw3KVzg/RKfxK7mPGGd1NdFHSUN08u S3Dg== X-Gm-Message-State: AOJu0YxW9zFem1SdvMrDkRAQjFePhfDMSYmhkKNXlmXfAGsUHAjpCSyE Al524M8+YcJkR3eUSozMOykMjgVrxKb2Mhps1yHRIecXRvwzZeAjuE925SobNxT0hAMqF7ZZip+ EhiE= X-Gm-Gg: ASbGncvyIfjybDA/CUsFNAS9KngjDWU8idV0YcV1fbAEEnlsQwi0XjLJqsmhVued76+ qnlsk2/KjFEYsEwwpLwJzkQAhQFENql+d/amPFnTcGi0fjC2gwdNN0Ua91DafCh8VtrjykusXuh da8N1HUNmMku8bI3mrRWzFxmBxeskIsFYVrLkjbwk6zcQTWFI88T3pjzaGOGfSFjfEB3poKiaS5 /9DO0vibEmnvujHOwaCny6E9ZXMbdFIIhvWm14d0JPM0XRLta2I56+H9ZvGdqF6dDrKsSoO+enS 2UF/pRQ5IaYK9HcOdMFHRUgvYeAZ1J3tbKjfKvTFKVCvwWyZpp1YExra+GjA20jzmg== X-Google-Smtp-Source: AGHT+IFAivnCEuWa+s9CJzyy+us9FOYQbCNDZooO1DNzx3Fey9h77ZbMevgirnagF4Rvye36WUD3Ug== X-Received: by 2002:a05:600c:4fc1:b0:434:f218:e1a8 with SMTP id 5b1f17b1804b1-4389141c21cmr359787385e9.19.1738072505153; Tue, 28 Jan 2025 05:55:05 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd573245sm170550175e9.33.2025.01.28.05.55.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 28 Jan 2025 05:55:04 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Paolo Bonzini , Laurent Vivier , Thomas Huth , Hyman Huang , Phil Dennis-Jordan , Peter Xu , Akihiko Odaki , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 7/7] tests/qtest/migration: Allow using accelerators different of TCG / KVM Date: Tue, 28 Jan 2025 14:54:29 +0100 Message-ID: <20250128135429.8500-8-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250128135429.8500-1-philmd@linaro.org> References: <20250128135429.8500-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@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-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org There is no particular reason to restrict all the framework to TCG or KVM, since we can check on a per-test basis which accelerator is available (via MigrationTestEnv::has_$ACCEL). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- tests/qtest/migration/framework.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/qtest/migration/framework.c b/tests/qtest/migration/framework.c index 30808de14e0..e5f0712c266 100644 --- a/tests/qtest/migration/framework.c +++ b/tests/qtest/migration/framework.c @@ -950,11 +950,6 @@ MigrationTestEnv *migration_get_env(void) env->has_hvf = qtest_has_accel("hvf"); env->has_tcg = qtest_has_accel("tcg"); - if (!env->has_tcg && !env->has_kvm) { - g_test_skip("No KVM or TCG accelerator available"); - return env; - } - env->has_dirty_ring = env->has_kvm && kvm_dirty_ring_supported(); env->has_uffd = ufd_version_check(&env->uffd_feature_thread_id); env->is_x86 = !strcmp(env->arch, "i386") || !strcmp(env->arch, "x86_64");