From patchwork Fri Jan 10 13:17:38 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: 856247 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp222931wrc; Fri, 10 Jan 2025 05:24:30 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVLyKlnSWnpDfacgzjR7t39n/f/GIcNBNsddYkvJdIX2ROm2KOIm2m8TqpNoZaZ5rTl5CO5YA==@linaro.org X-Google-Smtp-Source: AGHT+IF2t1vyG+LqjmJKeeV0dOQx1tCj7O7rA/PMcvGnvVTLEEuWaJmV0w9aXjD1oIo6G5lD5k9j X-Received: by 2002:ac8:5955:0:b0:467:8765:51ae with SMTP id d75a77b69052e-46c71081664mr153221921cf.39.1736515470361; Fri, 10 Jan 2025 05:24:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736515470; cv=none; d=google.com; s=arc-20240605; b=g0ZJLvvNpPeQCIeNlJQ9KF0lrk+XWmrF47BA0xI/+1DP1JTUTYneRPNvH2TD08ez8/ Wn9/NXOLT1D2WdwLB93NGtLjCtRnbSRNsFFjB2rsfNKGN+UK2Bez1Of7UUTRbONR6t9I UFdmyOtIFESoPFNT2nrPKNddrUeeETTkauulmF0LUFHoAQsxyCfW50oULCIXj7IL845E oU7SJH/CWlxPeEkam/VAguGp0uo16XqWyrs696l7DLI23CINMHUVuRzSTjMX6x2MbHEQ CQ6UCF+WUzZ2YksTgMa/EgZGLY0sVhC3fj5VzsfH+jNM+MPjqcr33B/01dHcRGSEYf8W 9nxg== 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=qpICeKmMeYnALi5nXUee1KCr49oIbU3BKgAvEP82Pcw=; fh=2iAtZVMPeHSpEU1BdrqjMAyPSzMzQN8Ofxt9dTNF4N8=; b=cHH1xs6kO1MyuRfre58GmkiHmvE2VRhDanjAkzOc1AXxynWg0QV4YByAUXk2g2temL 1CP/dwSQz9cEwqMFmmdFo65BtC+UbpQ+6fERj4VOkys0TFHyH7MesiZMO+hl3b5tGxuH LPGjIpjui/iFzLVpWg7KpL1R62YlsZXYIs2CdmPYhPZQma6mVRKXbIAvVtVLWAADTTRo kl+gP5hlswnviUZLI+tTr6BKtHESh37blEflMErSkl59XcVmDybfhkySSD6gL1eYb0js xN1WkOKjqkTkZ2W0W3mxiRCD2mkF9wY9GCflvNpW8LHyjepLECwJD8l8ECqcrUQ+EnFH U4Fg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eQwrmj4g; 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 d75a77b69052e-46c873313a2si20378601cf.119.2025.01.10.05.24.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Jan 2025 05:24:30 -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=eQwrmj4g; 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 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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ée 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, QVirtioDevice *d, gint64 start_time = g_get_monotonic_time(); 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; while ((val = qtest_readb(qts, addr)) == 0xff) { - qtest_clock_step(qts, 100); g_assert(!d->bus->get_queue_isr_status(d, vq)); g_assert(g_get_monotonic_time() - start_time <= timeout_us); } @@ -219,14 +217,12 @@ void qvirtio_wait_used_elem(QTestState *qts, QVirtioDevice *d, for (;;) { uint32_t got_desc_idx; - qtest_clock_step(qts, 100); if (d->bus->get_queue_isr_status(d, vq) && qvirtqueue_get_buf(qts, vq, &got_desc_idx, len)) { g_assert_cmpint(got_desc_idx, ==, desc_idx); return; } - g_assert(g_get_monotonic_time() - start_time <= timeout_us); } }