From patchwork Mon Feb 3 14:40:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 861553 Delivered-To: patch@linaro.org Received: by 2002:adf:fb05:0:b0:385:e875:8a9e with SMTP id c5csp2055632wrr; Mon, 3 Feb 2025 06:42:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUBYl1zpvK3tHFg02cCyUsxbsp8MxxOiZNTaVjp1Dmlg402XpPcszGm/U7cotBHVtpik0xx2A==@linaro.org X-Google-Smtp-Source: AGHT+IE7+3Rw7OLXs+UOj+Y33aVVMYvCbDqv0l4+Zkj96R4lURxX8Nuav3p3CwnXkRr8LsLZ0g+w X-Received: by 2002:a05:620a:28c8:b0:7b6:dfcf:3352 with SMTP id af79cd13be357-7bffcd95672mr2976078885a.38.1738593740626; Mon, 03 Feb 2025 06:42:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1738593740; cv=none; d=google.com; s=arc-20240605; b=cL4Kz6m8WAO7Roq2O2gWdpIEGKEFUec+AQ+QW3lcamABmigDKbHcm401jmlfc1ghF2 TSk3Rh2LqjNWsZAEcNDo1uzslv1uAqHnu+5T8vqXAETXZAu4YHUBzv+yQRV2WrOm/TW3 OnuiM55V8FWcklxWtHxKFXy6v4uM2K5YjWd8TMHFQdVuo7MNMwR+OOhEKlaFkpSuduU/ 8ybhiFmBFY1TU7TOqBjpYpWmBV7Xw2T6ROAmTeGdazBzbD+PTIBPZ21uFtlhFjrbvt0j P1b3z0khL9wJUbzBEpiMEnsWM+zK7gedzLQMomQ2GnxXnbCcMmlDAckurl0TcJ7S2fp8 lBJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3UFLMzp9qGvO/TMJfobXhH747ty7fBk8K8S5c0aFteA=; fh=jyfZ4bE00qD+eKuDDH0TAcN7aiec48pwVXD5svQqzcE=; b=ATnrI+jTATHPw5RLaOkgQJttHgk5an7NHbYjhlv6hts/eMAarHOElzo3RQgfa/er8y S++9W2TZob/CmkJHcmc6czzSUCG9ZwJcBrZgYw8B/puwnKgvn13VAYnLRNualWjvhbnN HPmL8yssdFo1fj/cKdLfeoYth4M1HrLLU94LVRy0E0JDLYPuMc0Xr8lGV4pVT9cJW7zX y9lHPGInroVODXk5lLEgiCR9hhPIxf+qRLnnhrQQcLK4U8fAHn53LlQmUXULcbNwhS4+ PJEfROHfRnq1sYvNNXXr3kQwClzjpCrWWhc1LKQgBneatZ/GXeJWxIxL+dl4HtbQzdg9 p+Sw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OJkpiYtD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7c02db62b5fsi26599285a.175.2025.02.03.06.42.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Feb 2025 06:42:20 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OJkpiYtD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1texdX-0003iv-2f; Mon, 03 Feb 2025 09:41:19 -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 1texdC-0003Ts-Em for qemu-devel@nongnu.org; Mon, 03 Feb 2025 09:40:59 -0500 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1texd7-0002Li-8S for qemu-devel@nongnu.org; Mon, 03 Feb 2025 09:40:57 -0500 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5d3cf094768so8280784a12.0 for ; Mon, 03 Feb 2025 06:40:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738593651; x=1739198451; 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=3UFLMzp9qGvO/TMJfobXhH747ty7fBk8K8S5c0aFteA=; b=OJkpiYtD6E6GEmmqrI9dSgSRSlzrb1j0auefJdyFSeiqYpuBDUasJJj3HwdPcvDSPE 6pEwYe0KAWpsYLshitEQX+N+4YiOn2rMOMB1NFtoCt+FZRvYElZpS2fNZS7ExCP7JY5c XZbP1GFNt8pHc9DPY436eyYtKtU6BxsrKU43mEAnLpf7C6AL2+l4oDEcJrn7nAOUpgdj /7yAZ8AP7qrmOkxjhWGoV3GmVJCrvr4977H1EpNR/kgvmXA+JHJ3VH/ArXjWccPr/nit YzFk4/EQGoQNURCHp0UKHH93ir/V9AsLjTNXh/JtL8g2DMgm4C/40GkxrpDxnfYU7BoW CmxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738593651; x=1739198451; 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=3UFLMzp9qGvO/TMJfobXhH747ty7fBk8K8S5c0aFteA=; b=kYkD/i1RAZIo6CB/7mi2Y5N86eUGxDbjJzArNzwzw6QxqJzZGpo4EUWu7RT1Q+Z1rA vcK86Ma4cdYh+XvyvQ/7iIFiyZvGprNzBZn9DV1ZFDQKozwmKai12tp3ZdmMThGC5lTi LlZDa44sCUFoN2114w9XhaWrYRgrGlVwKfxptF7NG5AJadkaHyHQ7DEa4QNlZsoX5rhN UKOZRdrfhz4uxc9eZHwk0vR+KkKTVXdzND8/HsZrFe0KgdTkw7ysL4zJaisOlkcVGQh0 7GMMU8BVa8JLbBCfp1k/0doEOV56P6vt6jrKhnQhwKbwLdxcdwfsSupi3uLI46/8/Lhu ychA== X-Gm-Message-State: AOJu0Yx9zA+i+Obd3+JaGq6bog/PNPSPK/u8MFWQlJSQAiPLC+vbYDhz 4P/0dXFGKiKsw/Stc4rfxB9CZ8SLixbiwEBl9XDFY9kSDNLj/tdAMaScfYvhGxQ= X-Gm-Gg: ASbGnctH7FfEyOce+uuNuW5pN901jwmC8fV5VkpYDJ+jt0q03CH1dk++udsuaoJpoHr YvX/iL34Z2/gYOt7O8TGjd/Cc7kraPYh2vDDct4hOgcCi7vjlRxDzv0EpkGA8Ipg4UkFzCnvUya /63igAfHa7I6P3mTb8ZL9WrGMPJ6ohwFP4V/rLsy5Ge3jEqUGTIcfxm+zPaxgZJEGYwtwWBr0K3 Ilb30eQfIHsSyEbH127ZltC++I9mk+xyCdwXzmKziQ8d54xh9lNx3w6K+H2WrLKJzjBk5f1nzjP j2ty0RyCCFW295MjIg== X-Received: by 2002:a17:907:72c4:b0:aa6:5eae:7ed6 with SMTP id a640c23a62f3a-ab6cfce8dbbmr2236592666b.13.1738593651441; Mon, 03 Feb 2025 06:40:51 -0800 (PST) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab6e47d21aasm763112666b.74.2025.02.03.06.40.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Feb 2025 06:40:49 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id C3E6D5FA53; Mon, 3 Feb 2025 14:40:48 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Mahmoud Mandour , Thomas Huth , Daniel Henrique Barboza , Alistair Francis , =?utf-8?q?Alex_Benn=C3=A9e?= , Hao Wu , Peter Xu , Warner Losh , Pierrick Bouvier , qemu-arm@nongnu.org, Harsh Prateek Bora , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Palmer Dabbelt , Kyle Evans , Laurent Vivier , Riku Voipio , Bin Meng , qemu-rust@nongnu.org, Laurent Vivier , Liu Zhiwei , Weiwei Li , qemu-riscv@nongnu.org, Fabiano Rosas , Tyrone Ting , Paolo Bonzini , Nicholas Piggin , Alexandre Iooss Subject: [PATCH 02/18] tests/qtest: don't attempt to clock_step while waiting for virtio ISR Date: Mon, 3 Feb 2025 14:40:32 +0000 Message-Id: <20250203144048.2131117-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250203144048.2131117-1-alex.bennee@linaro.org> References: <20250203144048.2131117-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x532.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 autolearn=unavailable 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This replicates the changes from 92cb8f8bf6 (tests/qtest: remove clock_steps from virtio tests) as there are no timers in the virtio code. We still busy wait and timeout though. Signed-off-by: Alex Bennée --- v2 - fix trailing space --- tests/qtest/libqos/virtio-pci-modern.c | 6 ++---- tests/qtest/libqos/virtio-pci.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/qtest/libqos/virtio-pci-modern.c b/tests/qtest/libqos/virtio-pci-modern.c index 18d118866f..4e67fcbd5d 100644 --- a/tests/qtest/libqos/virtio-pci-modern.c +++ b/tests/qtest/libqos/virtio-pci-modern.c @@ -173,13 +173,11 @@ static bool get_config_isr_status(QVirtioDevice *d) static void wait_config_isr_status(QVirtioDevice *d, gint64 timeout_us) { - QVirtioPCIDevice *dev = container_of(d, QVirtioPCIDevice, vdev); gint64 start_time = g_get_monotonic_time(); - do { + while (!get_config_isr_status(d)) { g_assert(g_get_monotonic_time() - start_time <= timeout_us); - qtest_clock_step(dev->pdev->bus->qts, 100); - } while (!get_config_isr_status(d)); + } } static void queue_select(QVirtioDevice *d, uint16_t index) diff --git a/tests/qtest/libqos/virtio-pci.c b/tests/qtest/libqos/virtio-pci.c index 485b8f6b7e..002bf8b8c2 100644 --- a/tests/qtest/libqos/virtio-pci.c +++ b/tests/qtest/libqos/virtio-pci.c @@ -171,13 +171,11 @@ static bool qvirtio_pci_get_config_isr_status(QVirtioDevice *d) static void qvirtio_pci_wait_config_isr_status(QVirtioDevice *d, gint64 timeout_us) { - QVirtioPCIDevice *dev = container_of(d, QVirtioPCIDevice, vdev); gint64 start_time = g_get_monotonic_time(); - do { + while (!qvirtio_pci_get_config_isr_status(d)) { g_assert(g_get_monotonic_time() - start_time <= timeout_us); - qtest_clock_step(dev->pdev->bus->qts, 100); - } while (!qvirtio_pci_get_config_isr_status(d)); + } } static void qvirtio_pci_queue_select(QVirtioDevice *d, uint16_t index)