From patchwork Tue May 28 00:42:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13675952 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 1BC9FC25B79 for ; Tue, 28 May 2024 00:44:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBkvx-0005Hi-1U; Mon, 27 May 2024 20:43:21 -0400 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 1sBkvv-0005HW-Cg; Mon, 27 May 2024 20:43:19 -0400 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sBkvt-0001jx-Hz; Mon, 27 May 2024 20:43:19 -0400 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1f47f07acd3so2597925ad.0; Mon, 27 May 2024 17:43:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716856995; x=1717461795; 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=JYItAgXfmEMBJST21EhnFhl+vIQAb1/uVlcExgVfNw0=; b=jjRYIaBXdID1JDjnR4kmA+pPHM62JvmNLkrodip1wxESkxveDYZt6n0k5XEDM0yZbq 3wxEU5Lw3Oy0nb1fsJqhw7a6KB75CodGb/yzrMEd35wTEY2fbopCA3MlWV6ZXjmv6U+1 yBQiXaIkHLpgG3V9g7PcasJ0KI5POnYpxRBEO5epjCZNg82tuaGvGxjIZuvWH2FUf9iP s8Azvhyv9ynUfSlspY3qrdHUQzBAFYJAgoznb5d2SXO0WW3yNAS/rgCHyFex7C/nD0e6 RKo7LXubSFgL3NL4n2G7GuusABKkV44tpEBCrbeXST6nFcChSplBOIveOFW9HiMOJbOa tWBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716856995; x=1717461795; 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=JYItAgXfmEMBJST21EhnFhl+vIQAb1/uVlcExgVfNw0=; b=J/nk0aXRw61AuiyoMJGkhWBXKEVQdQVm9m8g9aQVJu3GLtreloPfau62RyCCrLO9kj mtnpbkqaPRqluqXvT91Z89R9Xr60gXxWRifVdNjNZd5wetILxcBAxglCmmEoIuz9kRoF k1wxrlJkOy0VUv90QEKxDbPL6ci23VADNAcmlfSFYNHXXqvfRL0r5IFINsRVoCcklnju NgLzrPnoVELo3ELv2erdghM/F9hdzhVz1/xgZVj7ZjKgeoiqpjf78VoPcI1HQ+uV7H7Y 9lSRpQjF5zfbSqSG1MXRS/oZ8ncW/CPpMSXNIXJRv2OAzPlYfv+uhQR5Bdv+Djy2T304 pwmQ== X-Forwarded-Encrypted: i=1; AJvYcCUR62zemtHGG4WuJp5V6lxb23v9Ea7TkO3M4Hnl1MxFak6/lULzDzPJPloSAdiAK0kqmC1TnX6zLw6Ab0hdbtQtzZDB X-Gm-Message-State: AOJu0YyfAysjkAsDTNY97nJAiALsd+aeciPt1vzDiGyB21VGbhlsbB9B GFPXuK+Mi8PPOaCcpNGG783A8jvx/nxau7LbWVUBr68cOfiC6dv8I/WedA== X-Google-Smtp-Source: AGHT+IETu27bxGuH1BrCNHOGJpzmyaXNt272m2myqcXdcu3cWyT5FUoxJXzkjaUBezJ2EpfRtVj9Pw== X-Received: by 2002:a17:902:d2d1:b0:1f4:8a14:f4cd with SMTP id d9443c01a7336-1f48a14fa90mr52370325ad.39.1716856995425; Mon, 27 May 2024 17:43:15 -0700 (PDT) Received: from wheely.local0.net (110-175-65-7.tpgi.com.au. [110.175.65.7]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f44c75783asm67613595ad.23.2024.05.27.17.43.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 17:43:15 -0700 (PDT) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , Peter Xu , Fabiano Rosas , Thomas Huth , Laurent Vivier , Paolo Bonzini , qemu-ppc@nongnu.org Subject: [PATCH v2 1/6] tests/qtest/migration: Run test_mode_reboot outside gitlab CI Date: Tue, 28 May 2024 10:42:05 +1000 Message-ID: <20240528004211.564010-2-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240528004211.564010-1-npiggin@gmail.com> References: <20240528004211.564010-1-npiggin@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=npiggin@gmail.com; helo=mail-pl1-x62e.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, FREEMAIL_FROM=0.001, 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 As Fabiano points out, this test isn't flaky it just can't run under gitlab CI since runners have a very small shm size. Suggested-by: Fabiano Rosas Signed-off-by: Nicholas Piggin --- tests/qtest/migration-test.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index b7e3406471..04bf1c0092 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -706,6 +706,14 @@ static int test_migrate_start(QTestState **from, QTestState **to, g_test_skip("/dev/shm is not supported"); return -1; } + if (getenv("GITLAB_CI")) { + /* + * Gitlab runners are limited to 64MB shm size. See: + * https://lore.kernel.org/all/87ttq5fvh7.fsf@suse.de/ + */ + g_test_skip("/dev/shm is not supported in Gitlab CI environment"); + return -1; + } } dst_state = (QTestMigrationState) { }; @@ -3506,15 +3514,7 @@ int main(int argc, char **argv) test_precopy_file_offset); migration_test_add("/migration/precopy/file/offset/bad", test_precopy_file_offset_bad); - - /* - * Our CI system has problems with shared memory. - * Don't run this test until we find a workaround. - */ - if (getenv("QEMU_TEST_FLAKY_TESTS")) { - migration_test_add("/migration/mode/reboot", test_mode_reboot); - } - + migration_test_add("/migration/mode/reboot", test_mode_reboot); migration_test_add("/migration/precopy/file/mapped-ram", test_precopy_file_mapped_ram); migration_test_add("/migration/precopy/file/mapped-ram/live", From patchwork Tue May 28 00:42:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13675951 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 335FEC25B7C for ; Tue, 28 May 2024 00:44:09 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBkwB-0005LV-PK; Mon, 27 May 2024 20:43:35 -0400 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 1sBkw8-0005KT-AX; Mon, 27 May 2024 20:43:32 -0400 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sBkw6-0001kO-9K; Mon, 27 May 2024 20:43:32 -0400 Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-6819b3c92bbso237913a12.2; Mon, 27 May 2024 17:43:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716857007; x=1717461807; 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=3mPEcT8P6LlsNxCea2gf8+eejmJ05T1RMXKOf/aIwTk=; b=C7Q823NIkmUvjUMQvT6bJfo3NVILYcJydMNUL9MD85PtcsxVYWG1iWAHyCifNZ9v+/ 2L1s5au+o4hCjBuM4oztKXAjvVXIBBhXp1EUMl0z56jg40k6xygop+uHMkMZkrRIIvxh l9lEzWpy7SEkL7o5klMgQRRgTboaa93nOF7IUW4AqsWApmiTZQbmNI94AvZzYRhgK35k /39zMEMyihj4hJgw07EA1Cl/jhoGlNIufUTJcbsxDIb+x1wWPLKRwNZCA4gslnAcp/ja TBNc8GQ0D99Y69JgEcDBdzIkmMpRsIJoNo3Cg2ImB+leSGqzq9zRYYSE0cKDgkZzhSpb OwpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716857007; x=1717461807; 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=3mPEcT8P6LlsNxCea2gf8+eejmJ05T1RMXKOf/aIwTk=; b=pPd8SrZFoe1KL8UEOW9KUVhIQN3BqcWIwf8zWunGKkl5WmjVHi+F68UQd3aSh1URRO DkNBoo7TeKORROvfTJfTBybySzlQlF148RrkhiWrqygVrdwEMZN/jglAp8ztSn3jwOhB /FiQQeF5vJltu46/NmbkE+IXkRyaICcNtFReC8h74syfDB6pZVjkVCjonc5uQBZFJl9E rbPKyvgIBzmou2DDls/e+t2AXElxgER4YI3I1VgCyaGEki4Y6SRj6nLBRk0aVD4cffqe AZZgpS5s8vOmdcR7XZKznFlHptbg95VyQp8TJwDCOMwcKUABo9Je747nJeI42U/2uxIg RqjQ== X-Forwarded-Encrypted: i=1; AJvYcCVEeJIppNTrClPQeEWiTDjbQiVdTlmO8dR5NkhYetJw6FV32kAGOqJXMuBwrUN5Rronv+pxhFGBBGEKez69yCVPYc6+ X-Gm-Message-State: AOJu0YwUuKskgqpJ/gxx8XMspTAaydpjtTPO0rtei03TUGMMnJAWONjK q61Lb+Y/DYOaOg1bgsdg4fuAcOG3w+Xn7xy+/jFU6joSSwAsRFipPthPQQ== X-Google-Smtp-Source: AGHT+IHqoFnHHbxx0Q63S8Sqvhn9jmI40SjLAPh8Vzn/zHVttsK5p2xvIBVaelNFNPF2Q/2xliuefA== X-Received: by 2002:a17:903:1c3:b0:1f4:6dca:234e with SMTP id d9443c01a7336-1f46dca265cmr101261155ad.25.1716857007105; Mon, 27 May 2024 17:43:27 -0700 (PDT) Received: from wheely.local0.net (110-175-65-7.tpgi.com.au. [110.175.65.7]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f44c75783asm67613595ad.23.2024.05.27.17.43.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 17:43:26 -0700 (PDT) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , Peter Xu , Fabiano Rosas , Thomas Huth , Laurent Vivier , Paolo Bonzini , qemu-ppc@nongnu.org, Yury Kotov , "Dr . David Alan Gilbert" Subject: [PATCH v2 2/6] tests/qtest/migration-test: Fix and enable test_ignore_shared Date: Tue, 28 May 2024 10:42:06 +1000 Message-ID: <20240528004211.564010-3-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240528004211.564010-1-npiggin@gmail.com> References: <20240528004211.564010-1-npiggin@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::535; envelope-from=npiggin@gmail.com; helo=mail-pg1-x535.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, FREEMAIL_FROM=0.001, 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 This test is already starting to bitrot, so first remove it from ifdef and fix compile issues. ppc64 transfers about 2MB, so bump the size threshold too. It was said to be broken on aarch64 but it may have been the limited shm size under gitlab CI. The test is now excluded from running on CI so it shouldn't cause too much annoyance. So let's try enable it. Cc: Yury Kotov Cc: Dr. David Alan Gilbert Signed-off-by: Nicholas Piggin --- tests/qtest/migration-test.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 04bf1c0092..8247ed98f2 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -1893,14 +1893,15 @@ static void test_precopy_unix_tls_x509_override_host(void) #endif /* CONFIG_TASN1 */ #endif /* CONFIG_GNUTLS */ -#if 0 -/* Currently upset on aarch64 TCG */ static void test_ignore_shared(void) { g_autofree char *uri = g_strdup_printf("unix:%s/migsocket", tmpfs); QTestState *from, *to; + MigrateStart args = { + .use_shmem = true, + }; - if (test_migrate_start(&from, &to, uri, false, true, NULL, NULL)) { + if (test_migrate_start(&from, &to, uri, &args)) { return; } @@ -1925,11 +1926,11 @@ static void test_ignore_shared(void) wait_for_migration_complete(from); /* Check whether shared RAM has been really skipped */ - g_assert_cmpint(read_ram_property_int(from, "transferred"), <, 1024 * 1024); + g_assert_cmpint(read_ram_property_int(from, "transferred"), <, + 4 * 1024 * 1024); test_migrate_end(from, to, true); } -#endif static void * test_migrate_xbzrle_start(QTestState *from, @@ -3580,7 +3581,8 @@ int main(int argc, char **argv) #endif /* CONFIG_TASN1 */ #endif /* CONFIG_GNUTLS */ - /* migration_test_add("/migration/ignore_shared", test_ignore_shared); */ + migration_test_add("/migration/ignore_shared", test_ignore_shared); + #ifndef _WIN32 migration_test_add("/migration/precopy/fd/tcp", test_migrate_precopy_fd_socket); From patchwork Tue May 28 00:42:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13675953 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 ACD87C25B74 for ; Tue, 28 May 2024 00:44:28 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBkwZ-0005i6-9Z; Mon, 27 May 2024 20:43:59 -0400 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 1sBkwW-0005gD-K2; Mon, 27 May 2024 20:43:56 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sBkwV-0001mI-0Y; Mon, 27 May 2024 20:43:56 -0400 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1f44b42d1caso2422115ad.0; Mon, 27 May 2024 17:43:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716857033; x=1717461833; 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=18rm/lPX5mSSlNdlY87VqUvEx91nenlZ+MsIhknHyAI=; b=kuupIvGsBBIv4nGNQpurk8xZ3U/Sc6NdGJCaQvo9Xem+JU5f7MxDbDA/wNhOlAwX41 5CcsZiGRKQJd4u8aToVhCQoXm6rqbXyLcw7OxfZI/5av2fX0bGr2EoOV2IOo5D5mhssZ 6FYU9Y794BuM5bp7f4yup0kg04b3CpjKdCD26XmOVOSlNo5L9MlEcI4Tt4WjQSJ+3mcD qtcDTXE9yAbkx3ne7foguHfYjWsjyvlevMnRquWwmh3p2N8wWCUQTM5MmvC3eB6JMDKR 4kKdIUQXFlL3mp+N6OVmwrcmuSipTnjXoA4sxjIdH82CAIBEo0LgZvbB+VV/ZpWdq1SZ UDqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716857033; x=1717461833; 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=18rm/lPX5mSSlNdlY87VqUvEx91nenlZ+MsIhknHyAI=; b=OTaKrpEr2YogK2hUZmTs/2VgbbfFIJQ6Cbnp/JzkexmdpHII00+BLVF5b8+0ynl08Y cZJGt5j2e31NcB23f5OqWil6NXXMux86O9mEsOcmirnZ7VvKVTynF5jtfN+BuyKm9Uap VM1kaFZeupO3IVKTNX0ZLAgxroOaJQakafp3iuPgAh27/K0Aj7o/mKemhOzFXj4AZzGd bukf9yZNpg4ErPw0riyS2iGOVES0b0pqJWxmYGR7blzips3/6Vmch3rGHys4Vtr95V0m WN6xi7L5cs7Hy5QNA1t7i/gqbmyLfO6SdA0WpnS8JVF/HBw/mybUoNFiARes19wh21R/ zUgw== X-Forwarded-Encrypted: i=1; AJvYcCWkbJ1AcMtVFqhJHsowgtBrDF53SBGPAKUIo4WsyPCqYawhfrihD2kUuaHDm/UAl8J7bOECLXePq/S7fV2EmNU7iLkZ X-Gm-Message-State: AOJu0YxzlkG2kXMStPjhRCpLBzEbGBqSbQ2nxibjDDRAZGlUe3yDPXxR VYdNIyEzdComknBw6D3yV9Es0oR3BjQKQcrWJHVX8VuubSVjT/5yQ0ln/g== X-Google-Smtp-Source: AGHT+IGpMyTGV6gT9SNkH0qm6Y7k5jspalpctPrfpUc0hSVarnVrMq9dXmjpAxKRqnwLRzHE0MeJ5g== X-Received: by 2002:a17:902:fa83:b0:1f2:ff7d:ecf1 with SMTP id d9443c01a7336-1f44872db15mr91230825ad.16.1716857032830; Mon, 27 May 2024 17:43:52 -0700 (PDT) Received: from wheely.local0.net (110-175-65-7.tpgi.com.au. [110.175.65.7]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f44c75783asm67613595ad.23.2024.05.27.17.43.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 17:43:52 -0700 (PDT) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , Peter Xu , Fabiano Rosas , Thomas Huth , Laurent Vivier , Paolo Bonzini , qemu-ppc@nongnu.org Subject: [PATCH v2 3/6] tests/qtest: Move common define from libqos-spapr.h to new ppc-util.h Date: Tue, 28 May 2024 10:42:07 +1000 Message-ID: <20240528004211.564010-4-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240528004211.564010-1-npiggin@gmail.com> References: <20240528004211.564010-1-npiggin@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=npiggin@gmail.com; helo=mail-pl1-x62a.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, FREEMAIL_FROM=0.001, 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 spapr QEMU machine defaults is useful outside libqos, so create a new header for ppc specific qtests and move it there. Signed-off-by: Nicholas Piggin Reviewed-by: Thomas Huth --- tests/qtest/libqos/libqos-spapr.h | 7 ------- tests/qtest/ppc-util.h | 19 +++++++++++++++++++ tests/qtest/boot-serial-test.c | 2 +- tests/qtest/prom-env-test.c | 2 +- tests/qtest/pxe-test.c | 2 +- 5 files changed, 22 insertions(+), 10 deletions(-) create mode 100644 tests/qtest/ppc-util.h diff --git a/tests/qtest/libqos/libqos-spapr.h b/tests/qtest/libqos/libqos-spapr.h index e4483c14f8..a446276416 100644 --- a/tests/qtest/libqos/libqos-spapr.h +++ b/tests/qtest/libqos/libqos-spapr.h @@ -9,11 +9,4 @@ QOSState *qtest_spapr_boot(const char *cmdline_fmt, ...) G_GNUC_PRINTF(1, 2); void qtest_spapr_shutdown(QOSState *qs); -/* List of capabilities needed to silence warnings with TCG */ -#define PSERIES_DEFAULT_CAPABILITIES \ - "cap-cfpc=broken," \ - "cap-sbbc=broken," \ - "cap-ibs=broken," \ - "cap-ccf-assist=off," - #endif diff --git a/tests/qtest/ppc-util.h b/tests/qtest/ppc-util.h new file mode 100644 index 0000000000..f68ee93520 --- /dev/null +++ b/tests/qtest/ppc-util.h @@ -0,0 +1,19 @@ +/* + * PowerPC misc useful things + * + * Copyright (c) 2024, IBM Corporation. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef PPC_UTIL_H +#define PPC_UTIL_H + +/* List of capabilities needed to silence warnings with TCG */ +#define PSERIES_DEFAULT_CAPABILITIES \ + "cap-cfpc=broken," \ + "cap-sbbc=broken," \ + "cap-ibs=broken," \ + "cap-ccf-assist=off," + +#endif /* PPC_UTIL_H */ diff --git a/tests/qtest/boot-serial-test.c b/tests/qtest/boot-serial-test.c index df389adeeb..3b92fa5d50 100644 --- a/tests/qtest/boot-serial-test.c +++ b/tests/qtest/boot-serial-test.c @@ -15,7 +15,7 @@ #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/libqos-spapr.h" +#include "ppc-util.h" static const uint8_t bios_avr[] = { 0x88, 0xe0, /* ldi r24, 0x08 */ diff --git a/tests/qtest/prom-env-test.c b/tests/qtest/prom-env-test.c index 39ccb59797..14705105ad 100644 --- a/tests/qtest/prom-env-test.c +++ b/tests/qtest/prom-env-test.c @@ -21,7 +21,7 @@ #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/libqos-spapr.h" +#include "ppc-util.h" #define MAGIC 0xcafec0de #define ADDRESS 0x4000 diff --git a/tests/qtest/pxe-test.c b/tests/qtest/pxe-test.c index e4b48225a5..a3f900fbea 100644 --- a/tests/qtest/pxe-test.c +++ b/tests/qtest/pxe-test.c @@ -16,7 +16,7 @@ #include #include "libqtest.h" #include "boot-sector.h" -#include "libqos/libqos-spapr.h" +#include "ppc-util.h" #define NETNAME "net0" From patchwork Tue May 28 00:42:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13675954 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 2070AC25B74 for ; Tue, 28 May 2024 00:45:08 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBkxX-0007uS-UT; Mon, 27 May 2024 20:45:01 -0400 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 1sBkxN-0007rp-An; Mon, 27 May 2024 20:44:53 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sBkxJ-0001oq-1h; Mon, 27 May 2024 20:44:47 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1f44b42d1caso2424445ad.0; Mon, 27 May 2024 17:44:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716857083; x=1717461883; 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=13qmKqCPl+qGgTh3whvODJy15pxSC172gp95suOonmc=; b=ktOhS8zBej8S3MVRznLK2TD9gE4e+N6UmI85qc6q8A+7jphJZxSCP/SCGTo02XtYez G/KkXiWhULwq3+15uJWfNL749DaVL6KkJc/uneR/5CMOTgB711iZnI+O8KA5dzV2acvY VwyLkPizsi3URuFMgWFIH1bq6ortRCiKPdaaURrtTBiV2SXLRMphnIu76qooM9OUb2oU NeEDCvtXj7QgHtRHhnhrJzKlGsRv2Gxh2BLYw72m4MzU+R3jXZKeJg50iasgStxm07C5 aspSVNyBxsx8qBFYubFQTMsiqI0cbC8PpX7ltrcYaFZG2c3JcqJRjJNMGF86GtKfooVH lxyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716857083; x=1717461883; 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=13qmKqCPl+qGgTh3whvODJy15pxSC172gp95suOonmc=; b=WG+vFDklZbWpYU7h13wPMKDy3bscOpLKzvzU+rThMsZ5HyShtawKpYBTqn5GEL+fqY 1iX/5iKlt5ck0L7BRvS71K2wicwBXFXtmAUiBbnv0cry+x/czIDREAkX3dq6a+4DH0yI qro+h4hlIg0xszmGPwWG9KwKD5jebV14x3Zx+sAC3T4t9gac5IabaeDggqK9Ul0aS6xN J0Sm+h/4CW/YPa2Jbu6BoxmVKQsmIqeyAfwoQhVnjXKOIXaC5tdrr7pkYvLy/tMOjXfP T2JOzOveEhA1RNjYYCuh/FxW64jYb8NKlIrrdekcac6FvDIhVMQtefP8vsdL7Y6XQ+px LQyQ== X-Forwarded-Encrypted: i=1; AJvYcCVJaM992AbXmOPP/13l71juKU1ve7AJOU9o/uBqW6rdTKuwGSlWXx5aE5Ts8GN0XqQZmtMmWUK/8P6hrFydXSYK1Lp+ X-Gm-Message-State: AOJu0YzOSsBj45/tcuewI8Jg3nUtGvN5IuAlBJ78wkIx2r3B1RYZvuq9 B5CtXQRa8Xjy/WgoYjM6BeKtKQm0OY1Q4tziHOpa9b3OoLQ/oQy0Y3XCmg== X-Google-Smtp-Source: AGHT+IHho8N4Wfr+wNsnqgG170+dK+nw+JuD9vitgprk7NO3/3f6BNvewcZPFvefH+LYfIaNycQ7Vw== X-Received: by 2002:a17:902:e810:b0:1f2:f613:f0a1 with SMTP id d9443c01a7336-1f449901d09mr123073875ad.64.1716857082819; Mon, 27 May 2024 17:44:42 -0700 (PDT) Received: from wheely.local0.net (110-175-65-7.tpgi.com.au. [110.175.65.7]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f44c75783asm67613595ad.23.2024.05.27.17.44.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 17:44:42 -0700 (PDT) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , Peter Xu , Fabiano Rosas , Thomas Huth , Laurent Vivier , Paolo Bonzini , qemu-ppc@nongnu.org Subject: [PATCH v2 4/6] tests/qtest/migration-test: Quieten ppc64 QEMU warnigns Date: Tue, 28 May 2024 10:42:08 +1000 Message-ID: <20240528004211.564010-5-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240528004211.564010-1-npiggin@gmail.com> References: <20240528004211.564010-1-npiggin@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=npiggin@gmail.com; helo=mail-pl1-x635.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, FREEMAIL_FROM=0.001, 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 Reviewed-by: Thomas Huth Signed-off-by: Nicholas Piggin --- tests/qtest/migration-test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 8247ed98f2..7d64696f7a 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -21,6 +21,7 @@ #include "chardev/char.h" #include "crypto/tlscredspsk.h" #include "qapi/qmp/qlist.h" +#include "ppc-util.h" #include "migration-helpers.h" #include "tests/migration/migration-test.h" @@ -750,7 +751,8 @@ static int test_migrate_start(QTestState **from, QTestState **to, "until'", end_address, start_address); machine_alias = "pseries"; machine_opts = "vsmt=8"; - arch_opts = g_strdup("-nodefaults"); + arch_opts = g_strdup("-nodefaults " + "-machine " PSERIES_DEFAULT_CAPABILITIES); } else if (strcmp(arch, "aarch64") == 0) { memory_size = "150M"; machine_alias = "virt"; From patchwork Tue May 28 00:42:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13675955 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 64419C25B74 for ; Tue, 28 May 2024 00:45:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBkxu-00007I-7Q; Mon, 27 May 2024 20:45:22 -0400 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 1sBkxs-0008TE-Db; Mon, 27 May 2024 20:45:20 -0400 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sBkxq-000227-JD; Mon, 27 May 2024 20:45:20 -0400 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1f44b4404dfso2826235ad.0; Mon, 27 May 2024 17:45:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716857116; x=1717461916; 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=lZyn79nnxkPwl3oi0R+R2zUQX2JpkgjOQGabZyaJRaU=; b=DBNyFN8PVHiLu174JklePpT01/DFZyWEy2/nXSIXu5Ll0uZReoj25bSnP2ioJ835ta u728+SGfwXTexwOrplLLCayq5DfM+PWW1+t9rDrSlbMruhbi9n3hfKKmLxIIFJDD5Sl1 dk/i6IxARFRN+0yflCMVMcdRnQBHqUvzNUtJHoG/rnai02DKmlHjNlZZ9vJyWOaKwdRS TZFgLi9dy1HJhGasIcXygkQAYDeK8BG0n8fDnWt/EdttWD+O/aeY0m1vs6/X+oRU3D6X 5e67dDt/wsqv5ovocIWWreoPUcH+7piIGxjt7QHukewk2aSaIDvQqNEorT4+ov788p7o wKgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716857116; x=1717461916; 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=lZyn79nnxkPwl3oi0R+R2zUQX2JpkgjOQGabZyaJRaU=; b=eOp3s02vsw3ZuPd+qQYy6npKD3up96Ru6kUUvw5KScB8lLpAqCCUj16+jRrWsMYiZd bbFpgH+qflD7dzDd7p3Nu5XTq+DaM7ppVsK5S41yZEri5dINTUZJ7fWT1pn5W8wlFXMT 0w3bC9NVUTFW5V2lk1iKXP7VUY8E3ycIJ18+PkOMgNMYiXhbzaXSYXYvqk4xMEGinTve vOIFruhXfF+xuJnFXgg1xdK5Pzk/rcUGDex6HN2JJJE7Cl7v9SL4YtvvOMZeiCTgeC6n pUgYD8QrBUCEtOaX7hSdhBZLWeo70OzN9PLWj2hwscxiIIjFhezGVC1jyV/l3LWbT35u wP3A== X-Forwarded-Encrypted: i=1; AJvYcCUeKS/Mr839Rt9g4U0xiYhvY5bzw2RQI/KV4AKIWSG6/GQjG9xjsA7f8Pxj2+msbXK7MBmNdmW68sUAepmHsSZily8f X-Gm-Message-State: AOJu0YyVHErqbFy7B5E2MM2jHugnhKlshBuQwkvDnsRenotPh6HIpIgN h3p4H5bunOqfnxL4aQeitR0Ikem9V5O4Og9z8z1zdIOcBabPyRzqlbtHPg== X-Google-Smtp-Source: AGHT+IE+EM8JAJ0GoIzzRIYlhNmvLO5T2gZ4m7rY06yGSZ0SfhC5MpHSjoSkn9i6dgNmiwm5O59gJw== X-Received: by 2002:a17:903:1c6:b0:1f4:befa:7a79 with SMTP id d9443c01a7336-1f4befa8b8fmr19066735ad.27.1716857116438; Mon, 27 May 2024 17:45:16 -0700 (PDT) Received: from wheely.local0.net (110-175-65-7.tpgi.com.au. [110.175.65.7]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f44c75783asm67613595ad.23.2024.05.27.17.44.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 17:45:16 -0700 (PDT) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , Peter Xu , Fabiano Rosas , Thomas Huth , Laurent Vivier , Paolo Bonzini , qemu-ppc@nongnu.org Subject: [PATCH v2 5/6] tests/qtest/migration-test: Enable on ppc64 TCG Date: Tue, 28 May 2024 10:42:09 +1000 Message-ID: <20240528004211.564010-6-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240528004211.564010-1-npiggin@gmail.com> References: <20240528004211.564010-1-npiggin@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=npiggin@gmail.com; helo=mail-pl1-x633.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, FREEMAIL_FROM=0.001, 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 ppc64 with TCG seems to no longer be failing this test, perhaps since commit 03bfc2188f061 ("physmem: Fix migration dirty bitmap coherency with TCG memory access") which is not ppc specific but was seen to hit ppc64 quite easily. Let's enable it again. The s390x problem has been identified so mention it while we are adjusting the comment. Reviewed-by: Thomas Huth Signed-off-by: Nicholas Piggin --- tests/qtest/migration-test.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 7d64696f7a..87fa733d60 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -3463,19 +3463,9 @@ int main(int argc, char **argv) #endif /* - * On ppc64, the test only works with kvm-hv, but not with kvm-pr and TCG - * is touchy due to race conditions on dirty bits (especially on PPC for - * some reason) - */ - if (g_str_equal(arch, "ppc64") && - (!has_kvm || access("/sys/module/kvm_hv", F_OK))) { - g_test_message("Skipping tests: kvm_hv not available"); - goto test_add_done; - } - - /* - * Similar to ppc64, s390x seems to be touchy with TCG, so disable it - * there until the problems are resolved + * On s390x with TCG, migration is observed to hang due to the 'pending' + * state of the flic interrupt controller not being migrated or + * reconstructed post-migration. Disable it until the problem is resolved. */ if (g_str_equal(arch, "s390x") && !has_kvm) { g_test_message("Skipping tests: s390x host with KVM is required"); From patchwork Tue May 28 00:42:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13675956 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 D9817C25B79 for ; Tue, 28 May 2024 00:46:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBkyd-0001Cf-8u; Mon, 27 May 2024 20:46:07 -0400 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 1sBkyW-0001AN-V1; Mon, 27 May 2024 20:46:01 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sBkyR-0002Ao-Dw; Mon, 27 May 2024 20:45:59 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6f8e98760fcso203861b3a.1; Mon, 27 May 2024 17:45:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716857152; x=1717461952; 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=OhithohsNPYTGyXMJUrpfp+cpIArLBLtByy9vuqNc1U=; b=Yc/h0BlVi9ZyKD1RvlFUOxIB6P/V1VkNEVCAu73tVObiT2XGBSnBznx8fhNqdaPvTa VeMb7BEbApeCrqiOlTR1sGA3ZgUdjIXs6VNBVmkcThUyXeF394ERPeBqLXY/c6HTiy7e 5ctVYDSGd9JS3O9TyiuKxGGQAHin7J6qdKyk+JYRI52qxqxhN/Ta0Oj/RpPPV0v4tNNb 2eAa0HTgpc81qo680kLe/3ng6/Pz3Ssgl2CPTXL/kpdXPbSpMTeA0Uiy9KXTJ1Y9rIA9 haoJrE7qr7oj/homYJ68nOgJHwe0My8Ss4PDVjX7wV7RUdXCr7jY8JkjXQxs3+JCJH0v TQ0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716857152; x=1717461952; 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=OhithohsNPYTGyXMJUrpfp+cpIArLBLtByy9vuqNc1U=; b=gNCv8TazfIT9cnAl7bCaj6wRdo/kZBoxY++qsosv0626/Awc7SKKgxgTc880ynVF4v LoWubNv7Y30BItfXmCJj3Sx+8OD6zfv3akdURitUoqecgESM+r+FPYZL8gnVIiUU+FNN G94skZzGQO81+XoT/X1guWzWIGLCfBN4sWIZMOJwq6s7FCq9UigX90pQzcqvHumxYFmi QLkw5XNwUM9x/KY1CwS5p6ytXuuS9i4BBNcbtRhRKAYmZ0/zpycYPYy3pCGwjWTNlc/U VgUrdzwlW1Z01tpuifUQx1HXjvswB9hseyEpp4n+G61s7OMYtsHQZg0045HDB/YyrZcP NFWA== X-Forwarded-Encrypted: i=1; AJvYcCXNmW16pTJNnp+BnuL2uo7IK2Rlp4MGI8xzfIEwypVCSqjPVh3tyQ3R5Eqwr3nYOgOH8CxM9ZcLUTCGSfNt8bUhbykK X-Gm-Message-State: AOJu0YwtuHktkMS8STlEY+bIv6kOk/NH+i8OOMTMhuEI0DG17g6T2LiQ cgBUmNx2tOkvVRGWcHpGWLbRwikjQzxI0lPlmt4JGIOM+5AmU9kq6yOctw== X-Google-Smtp-Source: AGHT+IFS6jXt6QyLyd3UjsWh7BxavqWRqOqodP9V9UMy0IAYj5HODCAcJJELMJiLVGQShNAst4DJEA== X-Received: by 2002:a05:6a21:3a83:b0:1b0:1a02:4128 with SMTP id adf61e73a8af0-1b212cc391fmr14519484637.6.1716857151816; Mon, 27 May 2024 17:45:51 -0700 (PDT) Received: from wheely.local0.net (110-175-65-7.tpgi.com.au. [110.175.65.7]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f44c75783asm67613595ad.23.2024.05.27.17.45.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 17:45:51 -0700 (PDT) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , Peter Xu , Fabiano Rosas , Thomas Huth , Laurent Vivier , Paolo Bonzini , qemu-ppc@nongnu.org Subject: [PATCH v2 6/6] tests/qtest/migration-test: Use custom asm bios for ppc64 Date: Tue, 28 May 2024 10:42:10 +1000 Message-ID: <20240528004211.564010-7-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240528004211.564010-1-npiggin@gmail.com> References: <20240528004211.564010-1-npiggin@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=npiggin@gmail.com; helo=mail-pf1-x432.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, FREEMAIL_FROM=0.001, 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 Similar to other archs, build a custom bios memory updater. Running the test with OF code is a cool trick, but SLOF takes a long time to boot. This reduces test time by around 3x (150s to 50s). Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas Piggin --- tests/migration/migration-test.h | 1 + tests/migration/ppc64/a-b-kernel.h | 42 +++++++++++++++++++ tests/qtest/migration-test.c | 37 +++-------------- tests/migration/Makefile | 2 +- tests/migration/ppc64/Makefile | 15 +++++++ tests/migration/ppc64/a-b-kernel.S | 66 ++++++++++++++++++++++++++++++ 6 files changed, 131 insertions(+), 32 deletions(-) create mode 100644 tests/migration/ppc64/a-b-kernel.h create mode 100644 tests/migration/ppc64/Makefile create mode 100644 tests/migration/ppc64/a-b-kernel.S diff --git a/tests/migration/migration-test.h b/tests/migration/migration-test.h index 68512c0b1b..194df7df6f 100644 --- a/tests/migration/migration-test.h +++ b/tests/migration/migration-test.h @@ -22,6 +22,7 @@ /* PPC */ #define PPC_TEST_MEM_START (1 * 1024 * 1024) #define PPC_TEST_MEM_END (100 * 1024 * 1024) +#define PPC_H_PUT_TERM_CHAR 0x58 /* ARM */ #define ARM_TEST_MEM_START (0x40000000 + 1 * 1024 * 1024) diff --git a/tests/migration/ppc64/a-b-kernel.h b/tests/migration/ppc64/a-b-kernel.h new file mode 100644 index 0000000000..673317efdb --- /dev/null +++ b/tests/migration/ppc64/a-b-kernel.h @@ -0,0 +1,42 @@ +/* This file is automatically generated from the assembly file in + * tests/migration/ppc64. Edit that file and then run "make all" + * inside tests/migration to update, and then remember to send both + * the header and the assembler differences in your patch submission. + */ +unsigned char ppc64_kernel[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x7d, 0x20, 0x00, 0xa6, 0x39, 0x40, 0xff, 0xff, + 0x79, 0x49, 0xf8, 0x0e, 0x7d, 0x20, 0x01, 0x64, 0x3e, 0x80, 0x00, 0x10, + 0x62, 0x94, 0x00, 0x00, 0x3d, 0x20, 0x06, 0x40, 0x61, 0x29, 0x00, 0x00, + 0x7e, 0xb4, 0x48, 0x50, 0x39, 0x40, 0x10, 0x00, 0x7e, 0xb5, 0x53, 0xd2, + 0x38, 0x60, 0x00, 0x58, 0x38, 0x80, 0x00, 0x00, 0x38, 0xa0, 0x00, 0x01, + 0x38, 0xc0, 0x00, 0x41, 0x78, 0xc6, 0xc1, 0xc6, 0x44, 0x00, 0x00, 0x22, + 0x38, 0x60, 0x00, 0x00, 0x7e, 0x89, 0xa3, 0x78, 0x7e, 0xa9, 0x03, 0xa6, + 0x98, 0x69, 0x00, 0x00, 0x39, 0x29, 0x10, 0x00, 0x42, 0x00, 0xff, 0xf8, + 0x7e, 0x89, 0xa3, 0x78, 0x7e, 0xa9, 0x03, 0xa6, 0x88, 0x69, 0x00, 0x00, + 0x38, 0x63, 0x00, 0x01, 0x98, 0x69, 0x00, 0x00, 0x39, 0x29, 0x10, 0x00, + 0x42, 0x00, 0xff, 0xf0, 0x38, 0x60, 0x00, 0x58, 0x38, 0x80, 0x00, 0x00, + 0x38, 0xa0, 0x00, 0x01, 0x38, 0xc0, 0x00, 0x42, 0x78, 0xc6, 0xc1, 0xc6, + 0x44, 0x00, 0x00, 0x22, 0x4b, 0xff, 0xff, 0xcc +}; + diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 87fa733d60..45830eb213 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -128,6 +128,7 @@ static char *bootpath; */ #include "tests/migration/i386/a-b-bootblock.h" #include "tests/migration/aarch64/a-b-kernel.h" +#include "tests/migration/ppc64/a-b-kernel.h" #include "tests/migration/s390x/a-b-bios.h" static void bootfile_create(char *dir, bool suspend_me) @@ -147,10 +148,8 @@ static void bootfile_create(char *dir, bool suspend_me) content = s390x_elf; len = sizeof(s390x_elf); } else if (strcmp(arch, "ppc64") == 0) { - /* - * sane architectures can be programmed at the boot prompt - */ - return; + content = ppc64_kernel; + len = sizeof(ppc64_kernel); } else if (strcmp(arch, "aarch64") == 0) { content = aarch64_kernel; len = sizeof(aarch64_kernel); @@ -181,29 +180,10 @@ static void wait_for_serial(const char *side) { g_autofree char *serialpath = g_strdup_printf("%s/%s", tmpfs, side); FILE *serialfile = fopen(serialpath, "r"); - const char *arch = qtest_get_arch(); - int started = (strcmp(side, "src_serial") == 0 && - strcmp(arch, "ppc64") == 0) ? 0 : 1; do { int readvalue = fgetc(serialfile); - if (!started) { - /* SLOF prints its banner before starting test, - * to ignore it, mark the start of the test with '_', - * ignore all characters until this marker - */ - switch (readvalue) { - case '_': - started = 1; - break; - case EOF: - fseek(serialfile, 0, SEEK_SET); - usleep(1000); - break; - } - continue; - } switch (readvalue) { case 'A': /* Fine */ @@ -215,8 +195,6 @@ static void wait_for_serial(const char *side) return; case EOF: - started = (strcmp(side, "src_serial") == 0 && - strcmp(arch, "ppc64") == 0) ? 0 : 1; fseek(serialfile, 0, SEEK_SET); usleep(1000); break; @@ -745,14 +723,11 @@ static int test_migrate_start(QTestState **from, QTestState **to, memory_size = "256M"; start_address = PPC_TEST_MEM_START; end_address = PPC_TEST_MEM_END; - arch_source = g_strdup_printf("-prom-env 'use-nvramrc?=true' -prom-env " - "'nvramrc=hex .\" _\" begin %x %x " - "do i c@ 1 + i c! 1000 +loop .\" B\" 0 " - "until'", end_address, start_address); machine_alias = "pseries"; machine_opts = "vsmt=8"; - arch_opts = g_strdup("-nodefaults " - "-machine " PSERIES_DEFAULT_CAPABILITIES); + arch_opts = g_strdup_printf( + "-nodefaults -machine " PSERIES_DEFAULT_CAPABILITIES " " + "-bios %s", bootpath); } else if (strcmp(arch, "aarch64") == 0) { memory_size = "150M"; machine_alias = "virt"; diff --git a/tests/migration/Makefile b/tests/migration/Makefile index 13e99b1692..2c5ee287ec 100644 --- a/tests/migration/Makefile +++ b/tests/migration/Makefile @@ -5,7 +5,7 @@ # See the COPYING file in the top-level directory. # -TARGET_LIST = i386 aarch64 s390x +TARGET_LIST = i386 aarch64 s390x ppc64 SRC_PATH = ../.. diff --git a/tests/migration/ppc64/Makefile b/tests/migration/ppc64/Makefile new file mode 100644 index 0000000000..a3a2d98ac8 --- /dev/null +++ b/tests/migration/ppc64/Makefile @@ -0,0 +1,15 @@ +.PHONY: all clean +all: a-b-kernel.h + +a-b-kernel.h: ppc64.kernel + echo "$$__note" > $@ + xxd -i $< | sed -e 's/.*int.*//' >> $@ + +ppc64.kernel: ppc64.elf + $(CROSS_PREFIX)objcopy -O binary -S $< $@ + +ppc64.elf: a-b-kernel.S + $(CROSS_PREFIX)gcc -static -o $@ -nostdlib -Wl,--build-id=none $< + +clean: + $(RM) *.kernel *.elf diff --git a/tests/migration/ppc64/a-b-kernel.S b/tests/migration/ppc64/a-b-kernel.S new file mode 100644 index 0000000000..0613a8d18e --- /dev/null +++ b/tests/migration/ppc64/a-b-kernel.S @@ -0,0 +1,66 @@ +# +# Copyright (c) 2024 IBM, Inc +# +# This work is licensed under the terms of the GNU GPL, version 2 or later. +# See the COPYING file in the top-level directory. + +#include "../migration-test.h" + +.section .text + +.macro print ch + li %r3,PPC_H_PUT_TERM_CHAR + li %r4,0 + li %r5,1 + li %r6,\ch + sldi %r6,%r6,56 + sc 1 +.endm + + .globl _start +_start: +. = 0x100 + /* + * Enter 64-bit mode. Not necessary because the test uses 32-bit + * addresses, but those constants could easily be changed and break + * in 32-bit mode. + */ + mfmsr %r9 + li %r10,-1 + rldimi %r9,%r10,63,0 + mtmsrd %r9 + + /* + * Set up test memory region. Non-volatiles are used because the + * hcall can clobber regs. + * r20 - start address + * r21 - number of pages + */ + lis %r20,PPC_TEST_MEM_START@h + ori %r20,%r20,PPC_TEST_MEM_START@l + lis %r9,PPC_TEST_MEM_END@h + ori %r9,%r9,PPC_TEST_MEM_END@l + subf %r21,%r20,%r9 + li %r10,TEST_MEM_PAGE_SIZE + divd %r21,%r21,%r10 + + print 'A' + + li %r3,0 + mr %r9,%r20 + mtctr %r21 +1: stb %r3,0(%r9) + addi %r9,%r9,TEST_MEM_PAGE_SIZE + bdnz 1b + +loop: + mr %r9,%r20 + mtctr %r21 +1: lbz %r3,0(%r9) + addi %r3,%r3,1 + stb %r3,0(%r9) + addi %r9,%r9,TEST_MEM_PAGE_SIZE + bdnz 1b + + print 'B' + b loop