From nobody Sun Apr 6 22:06:30 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1736515470; cv=none; d=zohomail.com; s=zohoarc; b=BedZuwg4GIjA0IYYJWrl0a9wrw0LLYv5mjkynlhd3ruidIfZ2VIsKqNC/dp1G7SUd5CO9690lh8tbqf5MytMRdxIZeNDkDoh4fYiS2LfshxKCUWhmjYjsfiiZSnxfuDpLTVyj4b81c/qYCA5QjowOLdlE55Pl/QA74AbyKqfpgQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1736515470; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qpICeKmMeYnALi5nXUee1KCr49oIbU3BKgAvEP82Pcw=; b=FFA8rbevDSc3rsimN2iQYzcCQe0moQ5Z+FmqaIwEUAMka0sNfuR1FnXI7e5wtzOFY44NPFRwN3/23sX2q6TPRXh4dPAqBB5GXgaigxaJDymJqAX386bLliqrZSCJ+/z+C9+oQin33oZCyrBce/OifrM3kPfklIt+IDZamUYgQdY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1736515470474941.1808256822299; Fri, 10 Jan 2025 05:24:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tWEzW-0000Nq-ES; Fri, 10 Jan 2025 08:23:58 -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 1tWEz7-0008OH-MY for qemu-devel@nongnu.org; Fri, 10 Jan 2025 08:23:36 -0500 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tWEz5-0005di-1J for qemu-devel@nongnu.org; Fri, 10 Jan 2025 08:23:33 -0500 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5d3e9a88793so3206444a12.1 for ; Fri, 10 Jan 2025 05:23:30 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d9904a55f9sm1594282a12.81.2025.01.10.05.23.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2025 05:23:26 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 8F0885F8C8; Fri, 10 Jan 2025 13:17:55 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736515409; x=1737120209; 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=qpICeKmMeYnALi5nXUee1KCr49oIbU3BKgAvEP82Pcw=; b=eQwrmj4gTbyyB6buPpOKgfgCETpZ+9WATWHjGtPMfRkK2vj6qzfRXjZAj4oC472cU9 IXf+5HTplMQMkT3PeC//DvRpgeSQ1b38Oq2P2BQhVdhdRl/iROr3KLINkPRbpX1txayR qkfx+35iA+ujN16rIlg43QhM1QSMczYLvcgwORaMn9tthNnFyGVy6za4iHfKZ9eDlBYl e3nmAvniYgmAjZuUckmQL5h0yoZ9cEtfMvPGCNxnNXOygkVjUD4K5FeIvOaNgrxaKRug zIjGKo/bgbusQC6STgLkRKzJqasHODVm7uJK6ZGp/0vo8ezTog7DVyl9dsec7dIDgp+3 uCQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736515409; x=1737120209; 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=qpICeKmMeYnALi5nXUee1KCr49oIbU3BKgAvEP82Pcw=; b=RfOUnmOcQD7mokOhch1Ll4kdOmlPxXkqTOCF5ySZsYGHFnygnfHrfewAwKqc7ARwju aeRzMgbV9VBMe8oOnWjjzLosg30w20Qqgh/Uv8m5gSXlV4Y6oOueqIPb0THwQJh2bgbM ysMJzb8dUw3FwnEh0GLEqsQni6PpYX+QUQDrg3Rn2ymp8FEC9oT9LEhLlrC1opThGD3G 64Y1Kd1I2Qxf1egqE1j9nQJUtOj8gReH1eQo2ijuZRPu6VkA+6Ks9LmUy3E2IsmfFD/M odkE7H8RxpWK1JusuYtYgxvMPSgOnTrKxaByHgCfXOq9+v3vDFoJWOqLtruT+khwuPye 38GA== X-Gm-Message-State: AOJu0Yx9SJh4LsH4EyHzrLU/Xyjnf7F2o180NG6Oguv9v5wuDK+pDFYB +uOoLVjbfBiAsjuMN/WPfLjZB2Dw4Ct0zJ0Y3jknVpeiJQkwRAxmUlMEqUCNfeo= X-Gm-Gg: ASbGncvTvLQERQUInlwvncgVQL/h3mX9SDvq9ccQUt39j66fB0gBglu5snPDPA/nl5M YgjJqgQIoxehxcvyTkNdBd0VN47F0n2Nj/pf4v0bn3mq50KVxNvQ1OhMM52KD+NI1RhS+yYB8Wx gnQiHjQqbUGImeG02wFxW6NJ40Qd5Psba4AuQlLMhR9oynQQJJtj+qS129UGU6v/DPh68P9pE2g mEQfidBL4/yloTNzkJHXklkMT7Y7HfqHVGXUZfy2Qat467+6PMg4Bw= X-Google-Smtp-Source: AGHT+IGaDXQeiRr/23scJQTyk7g9DEZIVkR+IxpcHwMfXLAysMQZbQvm+ibsQDgDIjiL5Gz4lb6A5A== X-Received: by 2002:a05:6402:3888:b0:5d1:2377:5afc with SMTP id 4fb4d7f45d1cf-5d972dfb38amr9630561a12.3.1736515409327; Fri, 10 Jan 2025 05:23:29 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Fabiano Rosas , Laurent Vivier , Paolo Bonzini Subject: [PULL 16/32] tests/qtest: remove clock_steps from virtio tests Date: Fri, 10 Jan 2025 13:17:38 +0000 Message-Id: <20250110131754.2769814-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250110131754.2769814-1-alex.bennee@linaro.org> References: <20250110131754.2769814-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x536.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=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1736515471894019000 In the qtest environment time will not step forward if the system is paused (timers disabled) or we have no timer events to fire. As a result VirtIO events are responded to directly and we don't need to step time forward. We still do timeout processing to handle the fact the target QEMU may not be ready to respond right away. This will usually be due to a slow CI system or if QEMU is running under something like rr. Future qtest patches will assert that time actually changes when a step is requested. Reviewed-by: Fabiano Rosas Signed-off-by: Alex Benn=C3=A9e Message-Id: <20250108121054.1126164-17-alex.bennee@linaro.org> diff --git a/tests/qtest/libqos/virtio.c b/tests/qtest/libqos/virtio.c index a21b6eee9c..2e7979652f 100644 --- a/tests/qtest/libqos/virtio.c +++ b/tests/qtest/libqos/virtio.c @@ -170,7 +170,6 @@ void qvirtio_wait_queue_isr(QTestState *qts, QVirtioDev= ice *d, gint64 start_time =3D g_get_monotonic_time(); =20 for (;;) { - qtest_clock_step(qts, 100); if (d->bus->get_queue_isr_status(d, vq)) { return; } @@ -192,7 +191,6 @@ uint8_t qvirtio_wait_status_byte_no_isr(QTestState *qts= , QVirtioDevice *d, uint8_t val; =20 while ((val =3D qtest_readb(qts, addr)) =3D=3D 0xff) { - qtest_clock_step(qts, 100); g_assert(!d->bus->get_queue_isr_status(d, vq)); g_assert(g_get_monotonic_time() - start_time <=3D timeout_us); } @@ -219,14 +217,12 @@ void qvirtio_wait_used_elem(QTestState *qts, QVirtioD= evice *d, for (;;) { uint32_t got_desc_idx; =20 - qtest_clock_step(qts, 100); =20 if (d->bus->get_queue_isr_status(d, vq) && qvirtqueue_get_buf(qts, vq, &got_desc_idx, len)) { g_assert_cmpint(got_desc_idx, =3D=3D, desc_idx); return; } - g_assert(g_get_monotonic_time() - start_time <=3D timeout_us); } } --=20 2.39.5