From patchwork Fri Feb 7 15:30:57 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: 862980 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e42:0:b0:385:e875:8a9e with SMTP id r2csp382503wrt; Fri, 7 Feb 2025 07:32:39 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUZWSGOxxgyBHAJlMskhRIMKmFXEkdozyyzfyDDArx3mP36dzyNEYI3irsVsBK+se7FOIsLRA==@linaro.org X-Google-Smtp-Source: AGHT+IFrAQO2cVH7XTVABXcEyyazh60YYThWiUKgyVuVRNjZCnuCM21LCibknMUoHB3MmkAC5I2S X-Received: by 2002:a05:6122:18a8:b0:51f:306f:f360 with SMTP id 71dfb90a1353d-51f306ff9famr1622774e0c.9.1738942358718; Fri, 07 Feb 2025 07:32:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1738942358; cv=none; d=google.com; s=arc-20240605; b=J2r8JamZPlcdAZVxSKk4oKYlXovZVCaVlJeGux9MNfQg1ze5aT/KKAvOSQaUSS9fRg ZgbHfRbONA7HQMxMsJZwVyb33KnRjFgM8mcKajZ+hA7ReMrrVb/57rRx813s4qhj3rHB q01GTaSUDutsCJO+RQIz9xN0GrxVI9ABklmUb6B/2IOsF+u9CXtrQGrRlaT47LhEKtVm weNIRP+oWR91OVPUKvMHGa3wuS9321lC4m2VOAD8aQWegWvgdALF6s1GcQVz/mltSuwn D9Uwtv9dTrZOD0SjUdtzHDp1mYPDPZCJiOJsTUInD9bcNqhGYfZ2rSxorFVqcrMDzXqH Ey6Q== 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=wU5jWsflgZeWkD4KPn0erLqYU9C64YFheOYh1YAvMfA=; b=Sw2UJGeQ0N4+Wy+pNet8VRNDTanT3zD6aHFzmMiXYKj2TKLpnwfpfO7czKT2R+Mnml ZEE9T1Y+TOYDBXb5M7OXS6LTjED/qj5t13ixK3Pnwa9CJt6xY8w+y6wRNp28gY/wSsSg CZ3r/M3SJOi6km4We7FR24t7SU5M44KtFAQNUJyFgntbCpIvbYiztxRpNpo86JcBgEa0 z5kxwvVGQjsRiBjH45k8mW6+lGLvpNsivgX/0X4iKjVi+33YUdG+lMOsnNMgNQ4cQ7f2 LJRONmRoA97Gh86vj0zCb2SK+Qp+SYAXXC+MorJwgLsVogLjgze/TiEYzSKA+HjCfZOQ vlmw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kOljxhz4; 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 71dfb90a1353d-51f22787a54si656507e0c.91.2025.02.07.07.32.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Feb 2025 07:32:38 -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=kOljxhz4; 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 1tgQL3-0008Uh-MX; Fri, 07 Feb 2025 10:32: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 1tgQKE-000848-5k for qemu-devel@nongnu.org; Fri, 07 Feb 2025 10:31:27 -0500 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tgQK6-0003xs-JU for qemu-devel@nongnu.org; Fri, 07 Feb 2025 10:31:25 -0500 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-5de4c7720bcso1090651a12.0 for ; Fri, 07 Feb 2025 07:31:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738942277; x=1739547077; 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=kOljxhz4VbNtfTFeYvbgwiMvzXMLiNtH7LM/Z2jQ14plEOuRY6r56EMcP7x94Opf7Z 3kJLTkaFcddZBZ+KJ+ZYY6WTZ4y3AAnHyUO5tSUyi/c89VfTdlnoJy8EOfHMRPuRjZhz 1JOKaoK5fcDPW9+jMtbbvCeiBVs2oMiiKIfQhfUaWSt0Gl8sLKSLmBwJhPcZqpg58unX w3g0YFRa1HS641Sk/bE9y/5nRTfD2bkjJSFc504R4CZ5Ach+MmAw5S0+FxxNLcISwCqd 9es6bEe31v/qRyJM6Jcx+2GzLtQGLthTLaiYVnTL2Q5ejGOSrOAJgJwgYo5WDRRceeCe TqWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738942277; x=1739547077; 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=ifVa0h0kX2rXkygCs69fj+wBTG5wqe2yQQubFt7qVTn1v924b06iYia/bp6ApF2yAB Maw84vmxPucy7erB3wq6SqyOnNFxBeCxmAv3wIVEfNR/x5A8eV+qXXY9qp5mH0WA5P9x NkenWQStaYejFzJlfefluH02J3iKMUJecsG8NkNZ8KIyDywC96VLzDFlnSO2oQBShqIy StQMjI1HofwLTvww9AlD/OvL9p6Q0lZsLrglEMMEHRhNh8Y+2N7cdXLjRugYSEGCjy9Y 5vdCKPQhOtdWVcZ7j9qqxsKj/50RnpKNkLJbeovUpnnkApo96hvmAYf5IM2+57Cmg9ND B7cA== X-Gm-Message-State: AOJu0YyBMpvuFuu5PNa/Kqinb4SV7q9eHhXpppYd4e2/EIU96as86/yp ynDXwCf1DjF7nyl2/eAa+mAjl6nV3vz6ir0rG1Teu0MhNLJ6m5zHA8VDVz99UO8= X-Gm-Gg: ASbGncvtmUMJzZvqoxaSLhLDpgTunZyH70muTgXkQOuV1pJx8fCKO8IRWbyDWJzJhvI L31oFnX2n/Tk8XRJk+Zm2JSvmq47cUEpTwVy5He9p798pWBqqkvXmhm4w/n4D7RCPC1nihf0xPO /SRLq6HxX5njJS9PnZ0B/20+2budSj5M8lCorXgNoweC8I880f1mR1qpDMhsdoZklj0Sgk/3vk+ EjvZst5zv4GEDsH5EovysARDHI89k3KQ3W5argCj4EewVnWPrCVwXfjk9kVGTJy4Do07OXo81ey bW9Z0CCHimghlmUn/A== X-Received: by 2002:a05:6402:51cf:b0:5dc:57a5:c414 with SMTP id 4fb4d7f45d1cf-5de45088202mr4207907a12.30.1738942276558; Fri, 07 Feb 2025 07:31:16 -0800 (PST) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5de52712538sm325379a12.49.2025.02.07.07.31.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2025 07:31:15 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 924C95FA60; Fri, 7 Feb 2025 15:31:12 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Peter Xu , =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth , Weiwei Li , qemu-arm@nongnu.org, Nicholas Piggin , Liu Zhiwei , Bin Meng , Tyrone Ting , Hao Wu , Kyle Evans , Alistair Francis , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Laurent Vivier , Riku Voipio , Harsh Prateek Bora , Fabiano Rosas , Alexandre Iooss , Laurent Vivier , Daniel Henrique Barboza , Warner Losh , Pierrick Bouvier , Palmer Dabbelt , Mahmoud Mandour , qemu-ppc@nongnu.org, Paolo Bonzini , qemu-rust@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH v2 02/17] tests/qtest: don't attempt to clock_step while waiting for virtio ISR Date: Fri, 7 Feb 2025 15:30:57 +0000 Message-Id: <20250207153112.3939799-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250207153112.3939799-1-alex.bennee@linaro.org> References: <20250207153112.3939799-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x534.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 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 Reviewed-by: Thomas Huth --- 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)