From patchwork Tue Jan 7 16:51:54 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: 855499 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp319035wra; Tue, 7 Jan 2025 08:57:28 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXJ7WGyPuc3vKPiYahfLuEPdZnTvZ27ti/+vBvTyBaVya+b90UB4boMBCSgcw9F4EyIPC9WgA==@linaro.org X-Google-Smtp-Source: AGHT+IG7MIkOQbjhvRwrqiFu7khYCun9vN9bz5yfdqwa68ISAktnxV6lmNusWG+/k2596p4DMMj0 X-Received: by 2002:a05:620a:31a8:b0:7b6:f34a:c0db with SMTP id af79cd13be357-7b9ba8237d4mr9112327085a.57.1736269048383; Tue, 07 Jan 2025 08:57:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736269048; cv=none; d=google.com; s=arc-20240605; b=HIcwZooHFf2fKjD40vwolfNpPdTjlKarGgWN8ffJOE+I8LcS8RdhfiDQu/WoBHMJw1 R2dROQ72vSiWbLVaBpj9CeEwS3Bffgs1RHM+XFBOJjtQeTK369wf4yqgIK2JjzFYu94q vYvOwkXVMDfds+xiiu0F7i4ENfJGFT3hyVnYXLDxyuJsgppT+ycgfkzYwUbs66z3U0WS XA8TnWlP6+CydNpOeY8aXjYYSs6s16FmxpxTPWqMD9AMP2vt4TDhlBzZWSS4PGt9YXky axbKpMsNPN4qRoNFTaWz9P0bDB77nEIgPGnsn+AtERoCT1Qev1nAzg6kgWDwoTh73QcP 8B2Q== 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=EpM6m6rbJjz/cMmDUZY1x5tfWrWucIQIPNslhUNIhio=; fh=gCrRMsBOO2s5UczjHW2I0Xj39iNRWP/OR2J6q01yAGs=; b=PxR7t6WcIoRed/Gq3Rw79ZEAKymPvBrMBwEN8ks+l9L8S9Q/Rf2+7mHv6UTsW2w/Sn IFI84WyB70mIxQGi/TVC2F9/gQX2D0gCFa+Vu4aFVqZobLU1+uQCjZn5B154DPJPcI3d zLvfOZe5DJ0qJw2/+1pjjNNl05pB/fsw8FEElDe3y7q30jMVH4pidut8NwvRWsJKUybq ngeYPJB9gwQ7A25SEcetXPYqpv4bjMjDjgjYrSI9qm2GWgX65Om+c4VcvY+wndMbZOrE S92y/DfR9rS48XtZHKoPAGZLXoOo/XiXyyHQUjdARj57TNsE099jdbo8AqcVk7EsHqh4 GBVw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Obyxev90; 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-7b9ac47a3e2si4641625785a.217.2025.01.07.08.57.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Jan 2025 08:57:28 -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=Obyxev90; 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 1tVCqK-0006Og-88; Tue, 07 Jan 2025 11:54:12 -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 1tVCpR-00050p-HJ for qemu-devel@nongnu.org; Tue, 07 Jan 2025 11:53:18 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVCoX-0005ud-3H for qemu-devel@nongnu.org; Tue, 07 Jan 2025 11:53:17 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4361f664af5so178688605e9.1 for ; Tue, 07 Jan 2025 08:52:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736268739; x=1736873539; 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=EpM6m6rbJjz/cMmDUZY1x5tfWrWucIQIPNslhUNIhio=; b=Obyxev90yOp9K+tU0BuHp0J2Bi7Xdo/iGYIsGbOxbAHYRlQQ13BYRCC9lnjKBUQFsu OK9jVd/RMJdEOZ4MPqqfNQdKjNnivgIgzYzFnJ9qp9sBVxoV5y15fgzBpkDECHFw8pJF SU5JmtOneGiNbmoncsJyPWzbj1fu4zs8Ra/GgPsyOPuGFixvlXUFAiYUJgPQ3bfUTtPp UF3es1sbfwBgQfDIcZqjovAAlD+HOS4/iq4bf9nyeoD/UB+kNQWVyXwtff7qhVvv7AJH 3Y7pEFaHfRLcGoXqo9IjG6Q8yWM6+7lq8L2cjRp1Tkx1KltSJjuR65HmqoOUZBbXL7at cVQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736268739; x=1736873539; 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=EpM6m6rbJjz/cMmDUZY1x5tfWrWucIQIPNslhUNIhio=; b=e9hgZfr59yWQ97wkCWWJHJ28HcnDdfpAUzZwQuGNHmCMy4x566ZhOHrwxEP5Hu9M4m dowMtcvKLLCDxnmOWQUFLQMk7Aw9LvPsXFu5ze7YLlL1YsfQdFt/lHbYFg7zEk3H2Vs2 fpvrUXhaMKk56uEbj3VddVaWxZaQhmZtIBEaF0EVb7DlIyI1tmQwj1Klib5SCkVZfQht QaL+cKlXK4UJpERvFHw9N6JUYdl6/5hUI8UCm4pUAnOsdsoG0JH/LodbJ4YhjiBpc/sj im28cDEkyT7WWihxfhZyeqcgA0T2edBA0zzquvc992skuwNtHV7fc1vOdc8AmdgHIA5M rw8w== X-Gm-Message-State: AOJu0YwN0RQ0gbQD6gpV48za6keazWPaPq3BqgZcUlOdMCNHFPLfZ/hF 9Lfk4AA5j6+PCOWIkHDzBYGZD4iX0t7W6nWJYbMExBh+7zREcD5xQcRWfSFz4Ew= X-Gm-Gg: ASbGncsGk7siAvsK7B0W6stfrJ9jLgTPMGViOO1wIz8DXTdRYr7w8BJfBuf6NU5Wp61 VDODBUSVHQrl0/3heoTsCljirLw/U96P0CzVoEqnJSknDMfueIMHY80vc6cOHO9ehKNjqZ6tFtE sJlPV1Via1X/GLa8YybfIgT2ZHWY8fJ3B8TdvCpvo5xGvAYyqRgI9+9TNm0UmQfq5tM1uidjmI6 5BceH/r8yN+xLUEKYsDvD9Xl/17pAYJUkpi/+P4bVP16Evwtur+vpU= X-Received: by 2002:a05:600c:1388:b0:434:a7e3:db5c with SMTP id 5b1f17b1804b1-436686440abmr513224965e9.11.1736268739582; Tue, 07 Jan 2025 08:52:19 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c847263sm50585906f8f.50.2025.01.07.08.52.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2025 08:52:16 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 78EC65FBC2; Tue, 7 Jan 2025 16:52:09 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Beraldo Leal , Ed Maste , Halil Pasic , qemu-ppc@nongnu.org, John Snow , Radoslaw Biernacki , Nicholas Piggin , Markus Armbruster , Leif Lindholm , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Bin Meng , Daniel Henrique Barboza , Marcel Apfelbaum , qemu-riscv@nongnu.org, Christian Borntraeger , Wainer dos Santos Moschetta , qemu-s390x@nongnu.org, Alistair Francis , Liu Zhiwei , Fabiano Rosas , Weiwei Li , Harsh Prateek Bora , qemu-arm@nongnu.org, Li-Wen Hsu , Palmer Dabbelt , Daniel Henrique Barboza , Richard Henderson , Cleber Rosa , Marcin Juszkiewicz , Peter Maydell , Laurent Vivier , Aurelien Jarno , Eric Farman , Pavel Dovgalyuk , Jiaxun Yang , Thomas Huth , Laurent Vivier , Joel Stanley , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Alex?= =?utf-8?q?_Benn=C3=A9e?= , Bernhard Beschow , "Michael S. Tsirkin" Subject: [PATCH v3 16/29] tests/qtest: remove clock_steps from virtio tests Date: Tue, 7 Jan 2025 16:51:54 +0000 Message-Id: <20250107165208.743958-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250107165208.743958-1-alex.bennee@linaro.org> References: <20250107165208.743958-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32f.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 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. Signed-off-by: Alex Bennée Reviewed-by: Fabiano Rosas --- v2 - s/with/when/ - drop clock_step entirely --- tests/qtest/libqos/virtio.c | 4 ---- 1 file changed, 4 deletions(-) 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); } }