From patchwork Mon Jan 20 21:02:06 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: 858769 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp2121690wrb; Mon, 20 Jan 2025 13:03:32 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW9aoclW8bIJ1wBOLi2e4RY40qeqb6pLVn4HIKQbXJVMYG6vBUSC0juERiMkjBEze2ssOzPpg==@linaro.org X-Google-Smtp-Source: AGHT+IGgXKqhMqlehw657fJqVsv8CoTytZaKDyQyWXpBAivjIYfNACO6e5HDakkbbBZMl3QAuHCY X-Received: by 2002:a05:6214:2021:b0:6d9:353b:a8e9 with SMTP id 6a1803df08f44-6e1b217a868mr208016306d6.15.1737407012572; Mon, 20 Jan 2025 13:03:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737407012; cv=none; d=google.com; s=arc-20240605; b=c69ks48N+IIP5sFSqOftN4JWJ7mdQZn8WsUZ5Dh7JCF04SZke+qzHqekxRii7DjmNQ VdA7sQKVx2nJXN/VJvofTso+LT/A3S7b1hlRJTYzPFeknRrf7GKNy7ssWGJZpW+f+z5d Om1Is6Ap6Y+0ktrKGzy98nPOaJBiRnlDhbLqKb1x7Rx+kcWGQvKkTMbtggiC8uAo8ovU g7byWudO5UBKQW9dNy1UjTRwwdwQZnLFwXtZchyyPMnoPtKUoUIJiehMMOJjE2n2GQ/1 njBVJLk9uDmlpI+ak65lB4gDxeUM/tCmpuWVOWamKGgo3973wO9S3u13XaHA+pqSl/ar VzFw== 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=tLu0rGl+J06PZUR5LsaS3cXdzyCcNICroK1QJ5nx9oM=; fh=EQp6smEaFdAr7wpyP5h5rYJIEl1oD9ydaw4Da2y3ICs=; b=SdLD07IOVlEYkmCWgbrFHnpqRYzVP/EYieC7eHAqvcPjlZE5DEWC8MR4wF/MLRyAzh fSeUO5NmzOfwYlj3rJ6rT//jWH2DXkOsnyVJPNS4t1b2+CrOE//xe81m2TDEAxN6uJ1V W22pkKSVDSYpsD6eovbXKObbNI1SDnjM3zciZTkiiZU/XvRWzlB3pqn9r6uJBXnAmx1U wDqWKYYmSbDOYommXpSbtnfZHqY7gpjC0JY6fssLIYxvC3zJRadD9ajb/W1XHlxXtLVh KSswmcPY93fJMi+0o7BAqoLCizjDv/c/dJ+EOHVQNMQid2hRuxbsFUFGzeixDrIVB2Dt K+TQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R5vu3SB3; 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 6a1803df08f44-6e1afc176cdsi103464406d6.103.2025.01.20.13.03.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Jan 2025 13:03:32 -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=R5vu3SB3; 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 1tZyun-0001rj-Gf; Mon, 20 Jan 2025 16:02:33 -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 1tZyua-0001cM-9R for qemu-devel@nongnu.org; Mon, 20 Jan 2025 16:02:22 -0500 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tZyuX-0002wX-He for qemu-devel@nongnu.org; Mon, 20 Jan 2025 16:02:19 -0500 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-ab2b29dfc65so732267266b.1 for ; Mon, 20 Jan 2025 13:02:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737406936; x=1738011736; 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=tLu0rGl+J06PZUR5LsaS3cXdzyCcNICroK1QJ5nx9oM=; b=R5vu3SB3NKu5zflkKQRE0A7up1K8L9mZa49AvbMLEiHvLwqm6XG2cVKShlDrxzclJU 9oNNMhtNDGJzNUJYF2xvlEGSlLB1fBTav/HnA86j1g5loRHlTb26KkGSkMXOAeLyAhDC eBs+IHY55EeGYtVsNhLCxSpPoMRYnYaoG1Si2u9DAqRuKbxniYcT/8NtPJXzgYEoVpLD hDjY7iAXROH+api9YpjtEVwEkjGATzsl0aUxtT2Tpw4Ddqm2eDrRr53InWDdTdFAwots AH5ka+hErAPKyJEB2Bx9AAeHgMK2FJ0eoGZ4u3cTZcCdTv3W2pKL45uBZmW3Q8FmYN05 3GGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737406936; x=1738011736; 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=tLu0rGl+J06PZUR5LsaS3cXdzyCcNICroK1QJ5nx9oM=; b=tyuKPikRq6O6rwylAtVYrlkJ/f+0S1+eNiyT+XN0bo5h0ux2aFyBaG9xDuCrQLfxRi zn3zKqrlVAk+JaKSaXTLxF4v9IR+fYaSmK6BrH44xRQZMKnlqXic6xEmU7MslgC3CosU kP6HmTRa9/ha3vFHEVr7mZj603q/v4q9K5+aEq9iIU6iKHgGGzqTi0KMqQe7GoOe3R5z qKewBZ2KpYNvOC1AUYIG1Geho6/LP9h2dEYDGIbeDx+6r5ETa+Zb2rKIyw9FJJjEhCk+ kB6HG/18y50MVeU4tRGLweeTHJ4f9k+M1u4JPZRQ+74ol9jWv6Y3w8Nalrgjwxi0IADA Vv9A== X-Gm-Message-State: AOJu0YzOk3ukXd4+m6cRUoq1dCVEpSJkqpQqHQALVfrIaANb2O2DnrTD YxtqCVl4IxQjLuQfIUO/qpYrYgC0GvjxTbYKXZKlOgZij5bNTDi16xj9GNJgUpQ= X-Gm-Gg: ASbGncsq5sLbCO4/C8wZnui5m6p8OFRLztVnMrs86gQoMJBOy7MVJg+dBBaVN1VB/sq uiqQloGkwkLe0t76wluoVztwvZXfd9NothSeUDKl2Pq1xDwMLl3JsEnEB9HOq/J2uAWmc/N+Dp6 IbvBCee2zM+74AtrzKtsABZDEFh10ApZUEXWbOEdB7rz1fWdc74iy+z+n8zoTHwXKe+rRcq8vd7 k2V1VbR4t8cfY5MOnS8uzF7+VqImuOosdDsxOm3bhppaIz4opnat80hsSjmOTZD4s41 X-Received: by 2002:a17:907:969f:b0:ab2:c9b8:aaa7 with SMTP id a640c23a62f3a-ab38b36b7f6mr1377104766b.44.1737406935643; Mon, 20 Jan 2025 13:02:15 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384f23007sm668940166b.96.2025.01.20.13.02.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2025 13:02:13 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id F0FE85F864; Mon, 20 Jan 2025 21:02:12 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Thomas Huth , Peter Maydell , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= Subject: [PATCH 1/7] tests/docker: replicate the check-rust-tools-nightly CI job Date: Mon, 20 Jan 2025 21:02:06 +0000 Message-Id: <20250120210212.3890255-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250120210212.3890255-1-alex.bennee@linaro.org> References: <20250120210212.3890255-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x631.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 allows people to run the test locally: make docker-test-rust@fedora-rust-nightly Signed-off-by: Alex Bennée --- tests/docker/Makefile.include | 3 +++ tests/docker/test-rust | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100755 tests/docker/test-rust diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index fead7d3abe..fa1cbb6726 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -236,3 +236,6 @@ docker-image: ${DOCKER_IMAGES:%=docker-image-%} docker-clean: $(call quiet-command, $(DOCKER_SCRIPT) clean) + +# Overrides +docker-test-rust%: NETWORK=1 diff --git a/tests/docker/test-rust b/tests/docker/test-rust new file mode 100755 index 0000000000..e7e3e94a55 --- /dev/null +++ b/tests/docker/test-rust @@ -0,0 +1,21 @@ +#!/bin/bash -e +# +# Run the rust code checks (a.k.a. check-rust-tools-nightly) +# +# Copyright (c) 2025 Linaro Ltd +# +# Authors: +# Alex Bennée +# +# This work is licensed under the terms of the GNU GPL, version 2 +# or (at your option) any later version. See the COPYING file in +# the top-level directory. + +. common.rc + +cd "$BUILD_DIR" + +configure_qemu --disable-user --disable-docs --enable-rust +pyvenv/bin/meson devenv -w $QEMU_SRC/rust ${CARGO-cargo} fmt --check +make clippy +make rustdoc From patchwork Mon Jan 20 21:02:07 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: 858768 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp2121679wrb; Mon, 20 Jan 2025 13:03:32 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW/+BQPFHK8MRVM5qRnWvFy54A539dG/EVSaZoLE0pcy7jr0PR2WAx0bUtJZAU0QY+wOD+r4Q==@linaro.org X-Google-Smtp-Source: AGHT+IFKWT8WWJF0kZMlSQ18zpMdTAsIJ2+JEaKIgYi3m3SuW2/Ldg9TuNClbAWizK3GzfMxZzLK X-Received: by 2002:a05:6122:4892:b0:518:7ab7:afa9 with SMTP id 71dfb90a1353d-51d5b39ad76mr11267240e0c.10.1737407011850; Mon, 20 Jan 2025 13:03:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737407011; cv=none; d=google.com; s=arc-20240605; b=At0nL/9TJBzODtU4Yg8+VDseqXfIgVO/WpDF7fOffSXgQUhqdopkV6soPci4Oheyr0 UglIxXlxM0pZ/zYQTG78d7lIDE4VOrYnUYet2fUzwbro3wi9bciy5CJ9EKLU+f60yvPW zNU1bn/Z9nTKlrLy15ewudbZQ8CsxDWczC01tooVP+QrpyeWB8bwIVfb8YGSamnpy4az 0Vp4FDibDpUqx3yWYwx4xD8C9lUBGXsQUuNsm95g83Vi43fASYwv9HDU0bUbkRnCW8NJ os+VDRTPxOCkaagmzPsEJjJMpjsMn6U6AMQRNYvuOnblnvDQZmTkxsfawVUCp+RXNRnB mHJg== 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=oWOWHYCR1Up3N6CQ+zs5ErSlqDqJEtYq0Ac6711jAJE=; fh=g+DwzFOvFlHHnH1XTIEKlzjmBvVkftQxzS3vh+kbty4=; b=hM1fLEakxtACagm3etoTmvUuFuGFmrEMQdnNcbu52TrOLKf8QJ/5PK7fyoXOce+TaF sYpTpSovxK5anzAaKlE5VjKX/HpMbRA44SfyEKK7+ImBYAoPuzPFaPIHtQR+qPGwOELM 3vsfxKHNs6fbRbRnQuprhKP6mcKUW+TDWwN5fyH4UG2awXqH7+AL2M4W1QqtCL9G7RlA qaxFemBLyLzA5RJZZMUHX7von0epF+kCJmVt27zyntSATZhyZQtCSSxy2DiokkGnPm5y Bzr3UIsJYeSd0FzkpkoMLpn5fMwXzN16jdyxHhnaFTa6iXxE3gJhYIXlWK+hkK3IAet8 PuSg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wyWpY3rR; 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-51cf578337esi2571877e0c.177.2025.01.20.13.03.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Jan 2025 13:03:31 -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=wyWpY3rR; 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 1tZyur-0001xU-Ax; Mon, 20 Jan 2025 16:02:37 -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 1tZyua-0001cK-96 for qemu-devel@nongnu.org; Mon, 20 Jan 2025 16:02:22 -0500 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tZyuW-0002wD-Mv for qemu-devel@nongnu.org; Mon, 20 Jan 2025 16:02:19 -0500 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-5d9f0a6adb4so9995931a12.1 for ; Mon, 20 Jan 2025 13:02:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737406935; x=1738011735; 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=oWOWHYCR1Up3N6CQ+zs5ErSlqDqJEtYq0Ac6711jAJE=; b=wyWpY3rR9KQYuZUnINPqXmPOQGY2NENLUIlrlJOERruEY2NDcXDuYEWawxhq2pknKm DR4TAXIhGhR0BPaEA/LQYr9YnCJEuuV00wU43b85igpxMATgIrGluj0O9FVs7DUX70av S7knR0ay/zteYiyIgXBoSBjdJhLPiIFs9f2GemJsjhfgiH+HMqTKO7ZM3aAjsQkj17f1 3EBwNigUbJZTwljXekud3mRHc8ttm9auq8287BkXULacy5TrymCetjH6hT5sA2EHLNb2 scNODD6SWpOqNrZLppuZkiM0p9r2aU3b9pImSmOhSSiQ9G7aGFNjjFL/9a79zE/LVk8Y r9Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737406935; x=1738011735; 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=oWOWHYCR1Up3N6CQ+zs5ErSlqDqJEtYq0Ac6711jAJE=; b=q9nEN/1SCIwp2D/MI7Jw7js5hzhbnKpHLQY0qCjFhPQCWGud3epX6v1ZXlASc42Ac1 Vpw/Y1rHvUmwXmhk3vBk1NC+g3lYuk3h+rbGPMAKCCenf2pMSNQ16bWdjrKltf+hnGfz B64fobKE8W/0WPKju2WMVfTYGvQ9P93VJpkAWD5ZZB/zYc9CkprCk7Gow2RUavV81eEt VDvKu2LpqdS4JHWP6mNdrvnXyl4UZULpUdktgjTuhxNdi7RKDupZSRPagSb1DNJI9C2H kT6GhPGjjVYDw8fEARR4EahyUwdMIZGW3DLxdNv4T2NJL2DKxNXMq/MIes8OQ6fR6887 VXfA== X-Gm-Message-State: AOJu0YzFRKC616+rM+0eP4Xx1cp0lKUw3ymEpNkqy1c3ey6IQ19hTtOL EIkALX3T/m2Nmd6OV+Zm4tfI1sTM5HQe+CMAv3y4d3TiMTbKLFnmKhZqskIlZNpgQS6E9bMFBY9 AKho= X-Gm-Gg: ASbGnctKmoBgkm1J4NZEGMqSFKxYpG8525afZ2jsbcxCAjIy5IksExb3BCldu/3LLKX 1J5yRby15KlRRn9gDJGvYEdS/7/CcpLrXTu87WBViB7MznvnnvStMq987LgPi0QkBMmhQ1ZpOvF yT3H7CPAXk9Oa6B6EK3/3o5hmmrMlGzdXYiqIoqD/5UUbllzZLok0aKEkAnwbvRrJJrz26by9L7 aZnJUmkGmxujS7i5B6C4W50sT3T3NSDerGGftj4/Gqlgvbvqg58t8LKjMX13jn7BFrK X-Received: by 2002:a05:6402:5194:b0:5d4:3105:c929 with SMTP id 4fb4d7f45d1cf-5db7db07853mr14025988a12.23.1737406934983; Mon, 20 Jan 2025 13:02:14 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5db73edbaffsm6178874a12.66.2025.01.20.13.02.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2025 13:02:14 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 11BFD5F9D8; Mon, 20 Jan 2025 21:02:13 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Thomas Huth , Peter Maydell , =?utf-8?q?Alex_Benn=C3=A9e?= , Fabiano Rosas , Laurent Vivier , Paolo Bonzini Subject: [PATCH 2/7] tests/qtest: don't attempt to clock_step while waiting for virtio ISR Date: Mon, 20 Jan 2025 21:02:07 +0000 Message-Id: <20250120210212.3890255-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250120210212.3890255-1-alex.bennee@linaro.org> References: <20250120210212.3890255-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52e.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 --- 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..f6e3e32891 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) From patchwork Mon Jan 20 21:02:08 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: 858773 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp2121906wrb; Mon, 20 Jan 2025 13:04:04 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUGb0KPBG1OsdAi07o9RA+jKH5Tu+SGFE6kBBVa4jLo//NkmAFRGzdssYvL5A+kIkJSDatzEw==@linaro.org X-Google-Smtp-Source: AGHT+IG64x0cXIB4BmvhvWM9aCFLkotqMIEf1K+v3IVyzqm1FPO8wbIbhwUF8jRCS1RJ3fNjBx99 X-Received: by 2002:a05:6102:941:b0:4b2:7446:fc18 with SMTP id ada2fe7eead31-4b690c8b6f3mr12032994137.17.1737407044066; Mon, 20 Jan 2025 13:04:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737407044; cv=none; d=google.com; s=arc-20240605; b=eFRuEheMeBNi7V8JTSddOEWJDXV0Gdlz+62DU+s8Sp3M8hTAw3XO6Y44G3DlvIi27Y bKu7phCSjWvhtstN1bw313pKpjUu32iaz4ajEjVsHwIE6Gi1jex0wp+8gHkQ6M7EEACn KuS0iGcXlL4MCiGSB0ZvojlBQhSk3R9FSgdAXQ9CjRmuFyXzIf0v2Jn7iDLF90it7cGd sU1QY7nux+lt6rxvB0xx0zgDuyq3HUD5SDCmIFPhjycNJBZ9HC4m4wT/GoFkQRK5v8Ku yKYZ9YUU98cVaXYOCbAOgO1DCEttqdQqKzJMptXd1nXY+zXcytcFOZdCyV00CNIIi/BQ gvmw== 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=+48eX+l7U8ZWofmz36TBzUOPc9ZUOZwyExE6gyBI1a0=; fh=KjrMMQS9NQDRGNEdlpO1/ZX0rVREi4CIuv1QjMyLUBA=; b=Nys7YROn05ejxCuR8PMa57ZK4NaVlhNgitSEM0v/vvSgtqzXe5KtkbsF/hibhdaPgg oN3yYiuC1cNELjWLSjBMVOkwlzoRCQfxwE/oxo01rIcl2NM+e04X/CWH2Cx1nKzPW8s/ qyX+bveOY0nhFxJjFjnGiuNJbIP9UodFFhZeRcU0uFGrS4PLG4onRhq6P+GurdggIJpq ml9UAloae2exIjbUotAUNiBwCy3wCk7WgV84Iu4kzQBl6uSSiNMyA9iLBs0WTwt+Bskx 4P6gOYQDpx8OFcjHb6a3FwsgsGU+riAcMScVru5TohLfR+y/hJLyLpkmFDuCvCNs1orp czEQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oMAXsNtt; 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 a1e0cc1a2514c-8642ccdbee1si2452010241.137.2025.01.20.13.04.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Jan 2025 13:04:04 -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=oMAXsNtt; 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 1tZyuu-00022H-VO; Mon, 20 Jan 2025 16:02:40 -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 1tZyuY-0001bJ-3T for qemu-devel@nongnu.org; Mon, 20 Jan 2025 16:02:19 -0500 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tZyuW-0002w7-Dr for qemu-devel@nongnu.org; Mon, 20 Jan 2025 16:02:17 -0500 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-aaf0f1adef8so951730366b.3 for ; Mon, 20 Jan 2025 13:02:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737406934; x=1738011734; 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=+48eX+l7U8ZWofmz36TBzUOPc9ZUOZwyExE6gyBI1a0=; b=oMAXsNttBz86KeIZqg4mdPZTxKBCULiJAzjqtR92Gsro2nqC8PKb0gu+oGeemwdsYa 6+RkeuZwxDnrj/re5umy3t24Grq4mV3+4YqVWJLom5WjutXmOppNMu1eQdEBsx7j4Qwr NzYmycvMoPSIHVpIUr8CZ8EX52kN3QLQGssv6B1NV3qEqnb1xj6DqvEJnXAbs+aZwAyO +9WCvfD3IHjtec6vToAIRQQQ9CqwXg2dnrBcTSnGDi9Ygpv7Rjxlf9EmkFtftDQp6qh5 lfJxE2qpYhHAceMc5o9Bvby36eBGrGMkdm+t8UcuBeFlEdsp+i8nuVmowAQapw/xGCqI qGPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737406934; x=1738011734; 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=+48eX+l7U8ZWofmz36TBzUOPc9ZUOZwyExE6gyBI1a0=; b=sNkngisJeeM4E9ZTJm8RqI7/CNgdhqzhZTZOJIF1RZ1dKp0KtRF3g8NTnL7tDzYGCp MeOyWhDDGJNfp5pPciJJiZomXgkBE9860Om6eTKfiU/qw0fiI/stDSde9VQe5xCveKnG n6qnakpiYHHxznHzg5YRIqgmNp/59sAnGVWYnSmHzHJPRRXT+GEZihLtXQub1vJsk6TW EpFkEaEt9BH2bM9IR3DkM8wbEyQs2VlY/AT3tcRnLn1ADVzQFanXTPQd39eIovepWCNl JzfhpmUTO5QH1PIsIUInLdpvWPLcGZYzuijUunvS8ZAhMePHIVJtoneGbhc4HF147iLA Ug9g== X-Gm-Message-State: AOJu0YxHIP5Cb2iIXfjnPA9f3NvHBAla6oc3qwPHCYa92Ri/hhE83Hvg P2kBIInXEHjSZWx0GdyUjT3QOxQ94hgThIpO0cV+uDtPr9yrCtwjQ//Cc/rNMTM= X-Gm-Gg: ASbGncuAY7H3+pqJsgNnSAYHwOuD5KMPQDaWpWbah1g1VT1zwS+chWYvmNuL9zibBhJ 7AMJfLZTkPHh2IInrIYRgoy8iL1FOxmMXdY9DdpydlRsz6RvROEUFndSNif1Jh2WMrYeX3NjKTg nifIFOpwnhgxp2NtMtVL6uTFJhl3g43mf0XLNUptYeI1tmyQKRey6o8PoiVXnaAxqJSMQkB9vj1 Rj0cGlkkrUXXvldaz9HtmSCkrcGh4yd5Zpz421Hib+S+uG9X1jXjk45e858Gt0JyNRu X-Received: by 2002:a17:907:3e0b:b0:aa6:94c0:f753 with SMTP id a640c23a62f3a-ab38b17b9e0mr1068680966b.33.1737406934320; Mon, 20 Jan 2025 13:02:14 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384c5c3e1sm660622466b.7.2025.01.20.13.02.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2025 13:02:13 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 246155F9DA; Mon, 20 Jan 2025 21:02:13 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Thomas Huth , Peter Maydell , =?utf-8?q?Alex_Benn=C3=A9e?= , Tyrone Ting , Hao Wu , Fabiano Rosas , Laurent Vivier , Paolo Bonzini Subject: [PATCH 3/7] tests/qtest: don't step clock at start of npcm7xx periodic IRQ test Date: Mon, 20 Jan 2025 21:02:08 +0000 Message-Id: <20250120210212.3890255-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250120210212.3890255-1-alex.bennee@linaro.org> References: <20250120210212.3890255-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x632.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 Until there are timers enabled the semantics of clock_step_next() will fail. Since d524441a36 (system/qtest: properly feedback results of clock_[step|set]) we will signal a FAIL if time doesn't advance. Signed-off-by: Alex Bennée --- tests/qtest/npcm7xx_timer-test.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/qtest/npcm7xx_timer-test.c b/tests/qtest/npcm7xx_timer-test.c index 58f58c2f71..43711049ca 100644 --- a/tests/qtest/npcm7xx_timer-test.c +++ b/tests/qtest/npcm7xx_timer-test.c @@ -465,7 +465,6 @@ static void test_periodic_interrupt(gconstpointer test_data) int i; tim_reset(td); - clock_step_next(); tim_write_ticr(td, count); tim_write_tcsr(td, CEN | IE | MODE_PERIODIC | PRESCALE(ps)); From patchwork Mon Jan 20 21:02:09 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: 858772 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp2121902wrb; Mon, 20 Jan 2025 13:04:03 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWMCO9NtPQe9Lt7X0ezMYSGRrHymEzZFEZtXIbH1zgQ8BoD1gejBXO+1/OHfrrgXyqP5VLueg==@linaro.org X-Google-Smtp-Source: AGHT+IGEE07m/UEul/i7D/PbtClQMr9AqFq4WdIamYekSCw0mvBIXgFsmiFMqYGjxgnx7PXeZjRw X-Received: by 2002:ac8:5713:0:b0:466:85eb:6118 with SMTP id d75a77b69052e-46e12a637b1mr225700251cf.16.1737407043615; Mon, 20 Jan 2025 13:04:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737407043; cv=none; d=google.com; s=arc-20240605; b=M4du7OH78RCO2n0MYMq7EvARODGGJO+lazsLZDISrpF4Qb2C3qU9E2SS46pyiJvHCX lHAXChz0DgiJjEAzi1jnk4vmtWMxf+MTsSsEj21YzNLlih/tpMZGHCNS0e4IMBenxyrR ZiFbD08Fj2gMBti7y9gOa7spg/cJZfJo4tuKQwzU14zbcCbn+Gh1w5kC9wGjIT4UaY/C 4+8vv4qFNxCB2AMPjD8UGi/MF3fV5iT1ZwzO+3SOuXEluw2VIB4xFYhv/Cpfle2UuVsM EjEQKLkX/nOP18gT/yJ/gssGXhuO1AvkEUIFVpe1C5REN6sBxRwftMkJuNhkIZsdDzdj 6qEQ== 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=ptvjzIuVDQT2UCn5M7MTp4nlZSIRLqW4pGkuqXQqZnQ=; fh=g+DwzFOvFlHHnH1XTIEKlzjmBvVkftQxzS3vh+kbty4=; b=DVCBfMd5THFzt5pggxj8zmolm2MIPpfn7Ts9w97438PoW9EhkDp3mvXaN4I7Obi9WF nVdhw4YR8Tef+SIpdQXfcR7C5qnXKID7AXrtbnLMbiCT7YC3+mi79X3J3LSqeDVyCMPf 7HnmDr8pHpRlEA0DklFW/x4cyW4KzNOaCWxHHR1Q4QevXx1xe/u7XHUeSFa186XHVyvl +dLL8TIZjh7v7xcWiFtL2SMsPU+8qr97Gt5gzF+9iW5jyX+rNJ3II9IlJNe76/oy4jv1 QoYOke+WOF79udHTxMc3EsAXN88/k+LkYuFMmb16GkVzoMZGQttliI9DARUFpynMrGYR z6MA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gWL5oCrM; 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-46e1040a8f2si102619601cf.206.2025.01.20.13.04.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Jan 2025 13:04:03 -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=gWL5oCrM; 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 1tZyv0-00029t-GJ; Mon, 20 Jan 2025 16:02:46 -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 1tZyub-0001cU-GA for qemu-devel@nongnu.org; Mon, 20 Jan 2025 16:02:25 -0500 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tZyuY-0002x3-Rn for qemu-devel@nongnu.org; Mon, 20 Jan 2025 16:02:21 -0500 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-5d9837f201aso10886783a12.0 for ; Mon, 20 Jan 2025 13:02:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737406937; x=1738011737; 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=ptvjzIuVDQT2UCn5M7MTp4nlZSIRLqW4pGkuqXQqZnQ=; b=gWL5oCrMq1p46LoYyWfGNHlihzfQlZ78aMZAxao9Sermz0HFtyJ+uE+lRNYDVy3d7C /UK8T4/yfL+t4LKMDJMf/FfubZ/CZD1dL6tl7eT22f1oFezX3Ki32KKXvXOhntp9LkFI e84qGhgWbPd6cB0/IragWLYrP6uZxZjB8wfiJprnl+Wwo9P9YPDpkMWs8dwQIsO3E9uc 8TbBg/ngylzoAhaolDNC6h8HCdDNP0CzBgQdJL8I+eyaEvWO5JtWFYIE5kiy15Zuujz6 S7Qt57dOJzftAp+cVe2Cz9o1ANBKhHsc65ybWWvbxDfJ5yPjtYT6yqjpkYQFXtn/q5br CD8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737406937; x=1738011737; 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=ptvjzIuVDQT2UCn5M7MTp4nlZSIRLqW4pGkuqXQqZnQ=; b=xCdufuqjsHgHMx9jk3mJbDmPf+tOdh8e1LFj0UyksM5NaJtbUnBKkdFbB7IOr94BSM D6jg/o+freIwO4I2bYuydlq6A7Hhpt8sE4pzJwyFkIKrd38Lb6GNK/527TmTo8+16xLy ignmCW0lu3HuTQlNjaTOLB2zfQQ28XnVHues5x3ICga3fUAXzd8CQ2TnyIKhnEZ+NhKL ilg9vv4yeWaEtk/g9H1isEUsQVDjJv9J2q09dX+e9A6q6GVficYYcYGq5/iQ0Qu7wPEl 5vzGSld1Th/tKpDq/1u2c6Zx39vM0B/JgyR9aF9UePWVBVOE7uiyhhHCUguYQUSfrbJB dkfQ== X-Gm-Message-State: AOJu0Ywrzg6Tw+5BVQbzQXThk37RHBmqLjOlbxVTl9/t9ey8bXUX6hfa DK6LhkObUrpv1P1/xDe6kauC5lhUj7k4i2Mssi9JX8P9tmvO8gWAQCQrk8BS954= X-Gm-Gg: ASbGncv7g/lt2p5ers9ErkXqTQvCx6EZZnYMp/zelAFdNvVB2YFjF7uKILFLr+V2uzR YxxHYZ/c63CeuIOg4OFCKQ7rwgCndqSkli13pr7UNF73MLInnCloDzIqzbp5yHU3ooKIFul04HG oau5SFDFLFeiPQoxO0wANXB02E2Mmma99ZlfVcu3deq0Tk4OPkAZQeElpNlsmNlnM+ZxPBfs+UB 3lPmKb3FuPC5NV3k6cg9NeZoQUlDQJBucOXT/eLXy25argc3T4oAarxVS3gEXWXyara X-Received: by 2002:a17:906:794d:b0:aae:8687:c41e with SMTP id a640c23a62f3a-ab38cd913ebmr1339787666b.26.1737406936897; Mon, 20 Jan 2025 13:02:16 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384f223f3sm664050266b.116.2025.01.20.13.02.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2025 13:02:15 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 380E15F9F8; Mon, 20 Jan 2025 21:02:13 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Thomas Huth , Peter Maydell , =?utf-8?q?Alex_Benn=C3=A9e?= , Fabiano Rosas , Laurent Vivier , Paolo Bonzini Subject: [PATCH 4/7] tests/qtest: simplify qtest_process_inbuf Date: Mon, 20 Jan 2025 21:02:09 +0000 Message-Id: <20250120210212.3890255-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250120210212.3890255-1-alex.bennee@linaro.org> References: <20250120210212.3890255-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x529.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 Don't both creating a GString to temporarily hold our qtest command. Instead do a simpler g_strndup and use autofree to clean up afterwards. Signed-off-by: Alex Bennée --- system/qtest.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/system/qtest.c b/system/qtest.c index e68ed0f2a8..bb1efba9fd 100644 --- a/system/qtest.c +++ b/system/qtest.c @@ -763,25 +763,21 @@ static void qtest_process_command(CharBackend *chr, gchar **words) } } +/* + * Process as much of @inbuf as we can in newline terminated chunks. + * Remove the processed commands from @inbuf as we go. + */ static void qtest_process_inbuf(CharBackend *chr, GString *inbuf) { char *end; while ((end = strchr(inbuf->str, '\n')) != NULL) { - size_t offset; - GString *cmd; - gchar **words; - - offset = end - inbuf->str; + size_t len = end - inbuf->str; + g_autofree char *cmd = g_strndup(inbuf->str, len); + g_auto(GStrv) words = g_strsplit(cmd, " ", 0); - cmd = g_string_new_len(inbuf->str, offset); - g_string_erase(inbuf, 0, offset + 1); - - words = g_strsplit(cmd->str, " ", 0); + g_string_erase(inbuf, 0, len + 1); qtest_process_command(chr, words); - g_strfreev(words); - - g_string_free(cmd, TRUE); } } From patchwork Mon Jan 20 21:02:10 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: 858766 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp2121660wrb; Mon, 20 Jan 2025 13:03:30 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCURA5kkPSAuhXhRfSSXHLjjirIDiDCtvthtnwNuREaLCP0975MKn03rTtlGQBmzg7Vl+Lgjkg==@linaro.org X-Google-Smtp-Source: AGHT+IErdJvjrRXu8SiBBesEHElKaTqyjobipWFIYTfgfmJMjMOhRzk+iNglumVOu1nbWp4uSxcC X-Received: by 2002:a67:fbcd:0:b0:4af:f1c6:af04 with SMTP id ada2fe7eead31-4b66a03db81mr14673533137.8.1737407009931; Mon, 20 Jan 2025 13:03:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737407009; cv=none; d=google.com; s=arc-20240605; b=bZdi4OS/3wNZEAL2bJxiw5YR0LCkFYsXLFlThVYKZgtFwEVluNNHRbqptCNbeX/T7S 73Kh2F48eAXh3iAKPCawTxtYEkb1YanhUiA1xUXbGoWNQyBo/yUnS2p5vGlmYiwLmCvn IglhYYk5zLbi8L2dFs5BSrRfzp9Rpdmx2tfI+NIO5KIboc5+CM5YNKqlonaArbS3hPXW 4JP7+jDfwhU5cOu1qwx3tDGr0FVwjsFrYxPtx8biEfGzDH8d2ZLV23g8bTjZiJvK5Vta 7HaeVlOxlUzAC2hz77g50vRDYOFoAsJHwLU4VFXqWh+amcsRQdiqR07P2faxPxGUZtJP fGeQ== 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=5lDr+EsB9w5MfJH5NPFFSWodYWU+B9nCbgauMyudXbU=; fh=jCvGEaeWaknQe1PLNrHvYaTG/gFH+bAe7CrHX/C6fZQ=; b=GNEAF0d2YTTkT19JbyRBB5DkYH2xTEG82G+XjF4iBIJ74Sa6Vzf7RGXF8SWXWUykIo Q4i6LxX632HmjvIioIBDMbs6gZGiMfUUZkO0FzLmEKa7QKp5c6dZax8QdEJVT01RAooU woFE7iY5Q4SarW0WMn+IJnNa9nenMFSAv1f3Z6d4kvi5OZsynJvqompxemHKHkrtl+KN I05W6dQwXQ9Woz0mqx1UjWrdZeTeacNG8nAyw1BxXfUPhA3pqPooElaKaV/kYpaaf1Lu SOnWwgNWZcTLKVaqVn9PbkJmzLNfBE2WjBcQ6NaxI9inKfdJ2lKjY92zHKpYI2s7xKGo TdlQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Az4w/Z9q"; 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 ada2fe7eead31-4b68a3232e3si2845565137.444.2025.01.20.13.03.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Jan 2025 13:03:29 -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="Az4w/Z9q"; 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 1tZyuq-0001wd-WA; Mon, 20 Jan 2025 16:02:37 -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 1tZyud-0001dG-2x for qemu-devel@nongnu.org; Mon, 20 Jan 2025 16:02:27 -0500 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tZyuZ-0002xY-Sf for qemu-devel@nongnu.org; Mon, 20 Jan 2025 16:02:22 -0500 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-aaedd529ba1so642826266b.1 for ; Mon, 20 Jan 2025 13:02:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737406938; x=1738011738; 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=5lDr+EsB9w5MfJH5NPFFSWodYWU+B9nCbgauMyudXbU=; b=Az4w/Z9q4iywCGT+7q0ob1d/BfxKZHYXG6gmdF4HgI/etCltM2XkZ3VY4sGir5OOlf Uo0SwWaXvjLkiXXSt2qxa9JyO5kZQGVDl5Uk0j0VwXjiL7augIDTEHjnmcyYPlv00AMM ymrZlxwOnlWGQLoGLhdTY97Df2b8buMnoI1oghKGVf5cor7mGUZjZYFRMQCFxhsRLN+V UADKfSkND+gwUI+CgrYJi0+5PFh2dR8kP7rqOO0QsVHc9XIYGgf85BfjDnpxf3HOF4fP /q6LJegICvtRrpTGwBGxaUheyzJWjr1hEDVLyQWvVESnZmUW6QZRVCiL8w86xkU1WXzo SJbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737406938; x=1738011738; 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=5lDr+EsB9w5MfJH5NPFFSWodYWU+B9nCbgauMyudXbU=; b=gjPozcGEg945zU9E8Ph07txCl6fbYLffraV2EeMkNTxQV6lxSiBbbsp5OSUCieeKeS c9eqbIXiHrcl7BF6xF79GCwwGTfenLoLaJGYz3Dup4IE6Zole1B+klhEsis7enel8aYH uwIKdBfIq4N8fZXLWq6EGE2UNhgNonnyo9Mhcl/uZs5YRJrXZQqX/T8R7gsIUmyHZq5l Ua3EdwH4a41JC5atOdZc165LkscQ5NTz67KGqJ5t+JGD9008HTTxwVg0wvuCx9dN7La4 dliBPM24N/Rh5C+CB5mVe8yUlArMByEh+iirlZLkZzwe0cRfgqD9MNsH5Ooxk3hWiuhg frxA== X-Gm-Message-State: AOJu0YyWYKH2eYjXnxRxPmoDbM9fQyjxmB8xRXwqfAOxCQ8WEc+on/qA 5KOpoSm16QIfAnPlfkhVa0YycVBStf7KHNGvTEx56HBy58hnRettzBfGdrJkN2s= X-Gm-Gg: ASbGncsq6UOw7arjD1naqhj3/AwGpAsw3dipAKJ02nV70+yl6gdkin3sdI57fgMyS7Y Y0pkvSKayA9XaovgVd3aZ3xi5c+1tt6yEL39LJD9U8uREB52DDjtAQEtUEZujPd2TUXRkZ6wo3y e7xuFhIY/u7gA4SCHAfxJniVj9TGdkGePkjf6tW2y7Rn4YJAMjFoxpx5iWOdykuDzkUYOp1kuiO P1YaJZyNTKLfRJ8wO9TvDDuOpQK25Hk3WCdKCWvGuUpPSUUPbs+agoxLKX9Oy2znx7+ X-Received: by 2002:a05:6402:1d4e:b0:5d0:d491:2d5e with SMTP id 4fb4d7f45d1cf-5db7d2dc941mr33161083a12.7.1737406937605; Mon, 20 Jan 2025 13:02:17 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384c60751sm662877366b.30.2025.01.20.13.02.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2025 13:02:16 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 4EF8B5FA07; Mon, 20 Jan 2025 21:02:13 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Thomas Huth , Peter Maydell , =?utf-8?q?Alex_Benn=C3=A9e?= , Nicholas Piggin , Daniel Henrique Barboza , Harsh Prateek Bora , Palmer Dabbelt , Alistair Francis , Bin Meng , Weiwei Li , Liu Zhiwei , Fabiano Rosas , Laurent Vivier , Paolo Bonzini , qemu-ppc@nongnu.org (open list:sPAPR (pseries)), qemu-riscv@nongnu.org (open list:RISC-V TCG CPUs) Subject: [PATCH 5/7] tests/qtest: rename qtest_send_prefix and roll-up into qtest_send Date: Mon, 20 Jan 2025 21:02:10 +0000 Message-Id: <20250120210212.3890255-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250120210212.3890255-1-alex.bennee@linaro.org> References: <20250120210212.3890255-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x631.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 qtest_send_prefix never actually sent something over the chardev, all it does is print the timestamp to the QTEST_LOG when enabled. So rename the function, make it static, remove the unused CharDev and simplify all the call sites by handling that directly with qtest_send (and qtest_log_send). Signed-off-by: Alex Bennée Reviewed-by: Daniel Henrique Barboza --- include/system/qtest.h | 1 - hw/ppc/spapr_rtas.c | 1 - hw/riscv/riscv_hart.c | 1 - system/qtest.c | 26 +++----------------------- 4 files changed, 3 insertions(+), 26 deletions(-) diff --git a/include/system/qtest.h b/include/system/qtest.h index c161d75165..6ddddc501b 100644 --- a/include/system/qtest.h +++ b/include/system/qtest.h @@ -24,7 +24,6 @@ static inline bool qtest_enabled(void) } #ifndef CONFIG_USER_ONLY -void qtest_send_prefix(CharBackend *chr); void G_GNUC_PRINTF(2, 3) qtest_sendf(CharBackend *chr, const char *fmt, ...); void qtest_set_command_cb(bool (*pc_cb)(CharBackend *chr, gchar **words)); bool qtest_driver(void); diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c index df2e837632..503d441b48 100644 --- a/hw/ppc/spapr_rtas.c +++ b/hw/ppc/spapr_rtas.c @@ -565,7 +565,6 @@ static bool spapr_qtest_callback(CharBackend *chr, gchar **words) g_assert(rc == 0); res = qtest_rtas_call(words[1], nargs, args, nret, ret); - qtest_send_prefix(chr); qtest_sendf(chr, "OK %"PRIu64"\n", res); return true; diff --git a/hw/riscv/riscv_hart.c b/hw/riscv/riscv_hart.c index ad67cd7645..a55d156668 100644 --- a/hw/riscv/riscv_hart.c +++ b/hw/riscv/riscv_hart.c @@ -94,7 +94,6 @@ static bool csr_qtest_callback(CharBackend *chr, gchar **words) g_assert(rc == 0); csr_call(words[1], cpu, csr, &val); - qtest_send_prefix(chr); qtest_sendf(chr, "OK 0 "TARGET_FMT_lx"\n", (target_ulong)val); return true; diff --git a/system/qtest.c b/system/qtest.c index bb1efba9fd..28b6fac37c 100644 --- a/system/qtest.c +++ b/system/qtest.c @@ -265,7 +265,7 @@ static int hex2nib(char ch) } } -void qtest_send_prefix(CharBackend *chr) +static void qtest_log_timestamp(void) { if (!qtest_log_fp || !qtest_opened) { return; @@ -282,7 +282,7 @@ static void G_GNUC_PRINTF(1, 2) qtest_log_send(const char *fmt, ...) return; } - qtest_send_prefix(NULL); + qtest_log_timestamp(); va_start(ap, fmt); vfprintf(qtest_log_fp, fmt, ap); @@ -301,6 +301,7 @@ static void qtest_server_char_be_send(void *opaque, const char *str) static void qtest_send(CharBackend *chr, const char *str) { + qtest_log_timestamp(); qtest_server_send(qtest_server_send_opaque, str); } @@ -324,7 +325,6 @@ static void qtest_irq_handler(void *opaque, int n, int level) if (irq_levels[n] != level) { CharBackend *chr = &qtest->qtest_chr; irq_levels[n] = level; - qtest_send_prefix(chr); qtest_sendf(chr, "IRQ %s %d\n", level ? "raise" : "lower", n); } @@ -380,19 +380,16 @@ static void qtest_process_command(CharBackend *chr, gchar **words) is_outbound = words[0][14] == 'o'; dev = DEVICE(object_resolve_path(words[1], NULL)); if (!dev) { - qtest_send_prefix(chr); qtest_send(chr, "FAIL Unknown device\n"); return; } if (is_named && !is_outbound) { - qtest_send_prefix(chr); qtest_send(chr, "FAIL Interception of named in-GPIOs not yet supported\n"); return; } if (irq_intercept_dev) { - qtest_send_prefix(chr); if (irq_intercept_dev != dev) { qtest_send(chr, "FAIL IRQ intercept already enabled\n"); } else { @@ -419,7 +416,6 @@ static void qtest_process_command(CharBackend *chr, gchar **words) } } - qtest_send_prefix(chr); if (interception_succeeded) { irq_intercept_dev = dev; qtest_send(chr, "OK\n"); @@ -438,7 +434,6 @@ static void qtest_process_command(CharBackend *chr, gchar **words) dev = DEVICE(object_resolve_path(words[1], NULL)); if (!dev) { - qtest_send_prefix(chr); qtest_send(chr, "FAIL Unknown device\n"); return; } @@ -457,7 +452,6 @@ static void qtest_process_command(CharBackend *chr, gchar **words) irq = qdev_get_gpio_in_named(dev, name, num); qemu_set_irq(irq, level); - qtest_send_prefix(chr); qtest_send(chr, "OK\n"); } else if (strcmp(words[0], "outb") == 0 || strcmp(words[0], "outw") == 0 || @@ -480,7 +474,6 @@ static void qtest_process_command(CharBackend *chr, gchar **words) } else if (words[0][3] == 'l') { cpu_outl(addr, value); } - qtest_send_prefix(chr); qtest_send(chr, "OK\n"); } else if (strcmp(words[0], "inb") == 0 || strcmp(words[0], "inw") == 0 || @@ -501,7 +494,6 @@ static void qtest_process_command(CharBackend *chr, gchar **words) } else if (words[0][2] == 'l') { value = cpu_inl(addr); } - qtest_send_prefix(chr); qtest_sendf(chr, "OK 0x%04x\n", value); } else if (strcmp(words[0], "writeb") == 0 || strcmp(words[0], "writew") == 0 || @@ -537,7 +529,6 @@ static void qtest_process_command(CharBackend *chr, gchar **words) address_space_write(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED, &data, 8); } - qtest_send_prefix(chr); qtest_send(chr, "OK\n"); } else if (strcmp(words[0], "readb") == 0 || strcmp(words[0], "readw") == 0 || @@ -571,7 +562,6 @@ static void qtest_process_command(CharBackend *chr, gchar **words) &value, 8); tswap64s(&value); } - qtest_send_prefix(chr); qtest_sendf(chr, "OK 0x%016" PRIx64 "\n", value); } else if (strcmp(words[0], "read") == 0) { g_autoptr(GString) enc = NULL; @@ -593,7 +583,6 @@ static void qtest_process_command(CharBackend *chr, gchar **words) enc = qemu_hexdump_line(NULL, data, len, 0, 0); - qtest_send_prefix(chr); qtest_sendf(chr, "OK 0x%s\n", enc->str); g_free(data); @@ -613,7 +602,6 @@ static void qtest_process_command(CharBackend *chr, gchar **words) address_space_read(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED, data, len); b64_data = g_base64_encode(data, len); - qtest_send_prefix(chr); qtest_sendf(chr, "OK %s\n", b64_data); g_free(data); @@ -649,7 +637,6 @@ static void qtest_process_command(CharBackend *chr, gchar **words) len); g_free(data); - qtest_send_prefix(chr); qtest_send(chr, "OK\n"); } else if (strcmp(words[0], "memset") == 0) { uint64_t addr, len; @@ -673,7 +660,6 @@ static void qtest_process_command(CharBackend *chr, gchar **words) g_free(data); } - qtest_send_prefix(chr); qtest_send(chr, "OK\n"); } else if (strcmp(words[0], "b64write") == 0) { uint64_t addr, len; @@ -705,10 +691,8 @@ static void qtest_process_command(CharBackend *chr, gchar **words) address_space_write(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED, data, len); - qtest_send_prefix(chr); qtest_send(chr, "OK\n"); } else if (strcmp(words[0], "endianness") == 0) { - qtest_send_prefix(chr); if (target_words_bigendian()) { qtest_sendf(chr, "OK big\n"); } else { @@ -726,7 +710,6 @@ static void qtest_process_command(CharBackend *chr, gchar **words) QEMU_TIMER_ATTR_ALL); } new_ns = qemu_clock_advance_virtual_time(old_ns + ns); - qtest_send_prefix(chr); qtest_sendf(chr, "%s %"PRIi64"\n", new_ns > old_ns ? "OK" : "FAIL", new_ns); } else if (strcmp(words[0], "module_load") == 0) { @@ -734,7 +717,6 @@ static void qtest_process_command(CharBackend *chr, gchar **words) int rv; g_assert(words[1] && words[2]); - qtest_send_prefix(chr); rv = module_load(words[1], words[2], &local_err); if (rv > 0) { qtest_sendf(chr, "OK\n"); @@ -752,13 +734,11 @@ static void qtest_process_command(CharBackend *chr, gchar **words) ret = qemu_strtoi64(words[1], NULL, 0, &ns); g_assert(ret == 0); new_ns = qemu_clock_advance_virtual_time(ns); - qtest_send_prefix(chr); qtest_sendf(chr, "%s %"PRIi64"\n", new_ns == ns ? "OK" : "FAIL", new_ns); } else if (process_command_cb && process_command_cb(chr, words)) { /* Command got consumed by the callback handler */ } else { - qtest_send_prefix(chr); qtest_sendf(chr, "FAIL Unknown command '%s'\n", words[0]); } } From patchwork Mon Jan 20 21:02:11 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: 858771 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp2121737wrb; Mon, 20 Jan 2025 13:03:37 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVAbRWRgN4quLHOxWN5CKPoGYxTtwwRtTB0GvTvlhXMNlYgRq2jurorO++gckDBTJ9ewenFvA==@linaro.org X-Google-Smtp-Source: AGHT+IHYDqefJUFjZ4gWnY2m3JUOSXAS4GCi+mqT2hq/8fCslbvwN+CltvuLcXnFJ0Mx6yMFYyZS X-Received: by 2002:a05:622a:180c:b0:467:94c9:24e1 with SMTP id d75a77b69052e-46e12b75584mr208595401cf.32.1737407017736; Mon, 20 Jan 2025 13:03:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737407017; cv=none; d=google.com; s=arc-20240605; b=WydZp4Lc1Ts463ZXZ5WNPeuXCgwdu5FE21TFdXUtKGn0hsu+mBlB62aCwHoygyUTpc QJj3/5DxnPMjSRgmdbfEsBzVIRykAOdt8cYjLI7itTRT9UrgxaMcfBtcl4GpfUuxmQG/ P1TW9a9yZM+MN/La9GTySQKtY8L9h6dOGKXpAG26LrbM567qzeb0yTJAZatTmMHC9nB7 2ROaeroSh0tqkALzK0bZDR02xfNa3JtBuMDtE3Yuaz4C76rK58fAum8hb3KlSlaKaJ4V sWrVrxrbXFmVIrsTjEee54TlzUqENT/79pNpqxVGsx7i2shQoRfT1gjMsJNda0LOgo4q C4QA== 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=EFe2HzElji14TI185hUsajOPss7t//BADmWsqkIN0JA=; fh=g+DwzFOvFlHHnH1XTIEKlzjmBvVkftQxzS3vh+kbty4=; b=DtHBOJRHHOIlx444U2jXtuw36s9kmmQg/1euIEogBol1Objk7f30DZP2WvwFKuxdez Jq3xv8yVxXLRXH3/KtTHPiIJU7bKrYEGstDovD8SC998T2ft9oqxCDGBO17z0PGOxl/S IVJmgJpUoDW/umTxptebQX7WrXDKMSBhCw0pu1s5w1AvuJmUct/9yC5FeRnbHDqlbql3 El3hLpcLT+C+4VK+GIK8pXNVslqJoIf8LnGnrHyPPd5CLcMajHHMYtDSKtsWm67gDH2m 1Ar2dBV1uP3msAPD91l4L7s7LrIahIKoeJwxFrOJGicpmcVA1EPBuo51j25do5wgQz1A IqSw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pMKM+W6G; 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 ada2fe7eead31-4b68a3202e3si2983758137.463.2025.01.20.13.03.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Jan 2025 13:03:37 -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=pMKM+W6G; 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 1tZyuv-00022w-JE; Mon, 20 Jan 2025 16:02:41 -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 1tZyug-0001g9-0d for qemu-devel@nongnu.org; Mon, 20 Jan 2025 16:02:28 -0500 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tZyub-0002yL-7i for qemu-devel@nongnu.org; Mon, 20 Jan 2025 16:02:24 -0500 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-5d9f06f8cf2so9469623a12.3 for ; Mon, 20 Jan 2025 13:02:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737406939; x=1738011739; 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=EFe2HzElji14TI185hUsajOPss7t//BADmWsqkIN0JA=; b=pMKM+W6GooQ6tIwX770Eqn//b7J8BKK5QKTdpxzmY7cdSarXOKjCc/AHeCju40+AuP iPajOWlEjNiNP5n7cOKbU0Gmgo+hyI4N2f6LLBvLmftpJJ0XSBA5T8nVyHUAxmdoPz94 X7ZTfpORf9ujZbX+cD3407o5vWgBlFx73sJCejKQWakzWFTnIZ0nuPYphtzkOweN61c6 xZ9qWZf4xCHX7EpAIfZNKqKU7f3DiGWmBvJzAhtEHjXbpZxrNNxsECBk5djL8Po3ggd7 7gupysOvmZSI4L2uy+uUwnEYNShxeQX2Z7cacUXdJC9+T7ZoevRcF2dEJbNXWr+VCQxb d+BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737406939; x=1738011739; 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=EFe2HzElji14TI185hUsajOPss7t//BADmWsqkIN0JA=; b=HmgOMJatMdvogHgwmZQwX2oLUHPAeEUGfQqunoyrJESJeNfoKKuXZeJC2qD8QRgpz6 +IIqyBLd7HNM+Z/TMF4msWUBAz4hOpLkZilLOtAKeqEk7fuFJ1JeNZFsd5R6RbKrY1Gi kpy1MOlMshaluHqdjyVNggbr4K51l/5McLhOMTXuyeAM6RbSKJR9B6KKgvSY9b5b+xx3 UDB+Vv859Smut129uGeG2oT43AMC/B+SHZu+rOow9YRbI2qS7hpKFdshwd0pClByZHQz nd8V7XIzc03NH+xsP/Dhxolt95nq2sRkNKDox7bQYUF7vXysdz73oCNrBOij6Hp4Xhqi LKEA== X-Gm-Message-State: AOJu0Yz9+G0WnhMyjYhKF6ejfSBQgAu8aBbzYteCACfeYGIS5liaqABV tqNqNJY2mF7CK3lrEVj5Q7kb333mpPeETBiDTbmCRei3mE2KMpb3QVWpPlZLDoo= X-Gm-Gg: ASbGncsuEQRqfaAhsHoTVDaNNp3d6z4cDA/BYbdnT2qBJgLpPLaP+1UAuEj7Zl27yCL SkIiZhxcGk8i8hvLACaR1DiLlAVmwM1tlQgJLbvRePHrCmzIKJznnw6cc6fysC4FDvvB/GIm/b6 n7ckL6t6GJpv+0T/fKn2HIBR9+sLnZd4RTkN+VZVXpEO6AYks6A6Gmp4Ruwj9qH3lDgFo1RBoKR MVUagiKKR2iAoctxpxtsdOsOGMYeOVzW2wL4GXvCRM2LHCRt+h5e1SlPDJWH5w/6DLN X-Received: by 2002:a05:6402:5251:b0:5d2:d72a:77e4 with SMTP id 4fb4d7f45d1cf-5db7db1234bmr14902156a12.28.1737406939279; Mon, 20 Jan 2025 13:02:19 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5db73edce5csm6200172a12.75.2025.01.20.13.02.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2025 13:02:16 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 61A675FA1B; Mon, 20 Jan 2025 21:02:13 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Thomas Huth , Peter Maydell , =?utf-8?q?Alex_Benn=C3=A9e?= , Fabiano Rosas , Laurent Vivier , Paolo Bonzini Subject: [PATCH 6/7] tests/qtest: tighten up the checks on clock_step Date: Mon, 20 Jan 2025 21:02:11 +0000 Message-Id: <20250120210212.3890255-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250120210212.3890255-1-alex.bennee@linaro.org> References: <20250120210212.3890255-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x530.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 It is invalid to call clock_step with an implied time to step forward as if no timers are running we won't be able to advance. Signed-off-by: Alex Bennée --- system/qtest.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/system/qtest.c b/system/qtest.c index 28b6fac37c..1a9bfd0b33 100644 --- a/system/qtest.c +++ b/system/qtest.c @@ -708,10 +708,15 @@ static void qtest_process_command(CharBackend *chr, gchar **words) } else { ns = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL, QEMU_TIMER_ATTR_ALL); + if (ns < 0) { + qtest_send(chr, "FAIL " + "no timers for clock_step to follow\n"); + return; + } } new_ns = qemu_clock_advance_virtual_time(old_ns + ns); qtest_sendf(chr, "%s %"PRIi64"\n", - new_ns > old_ns ? "OK" : "FAIL", new_ns); + new_ns > old_ns ? "OK" : "FAIL could not advance time", new_ns); } else if (strcmp(words[0], "module_load") == 0) { Error *local_err = NULL; int rv; From patchwork Mon Jan 20 21:02:12 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: 858767 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp2121669wrb; Mon, 20 Jan 2025 13:03:31 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXHB6qJIWjtY+KVa9KXLkeswgvdL4y6p6cCGs/ORQf1mlaPJFiwgPIFK5rttpUTZyXgR489xw==@linaro.org X-Google-Smtp-Source: AGHT+IEOaZqLcRZe+YweALRLBfmaKAhJ65JNawG6Ou9Jz5N97V47fSU4velUCsfe1Zor2qxzY/Ri X-Received: by 2002:a05:6102:c48:b0:4b2:49ff:e470 with SMTP id ada2fe7eead31-4b690cdf00bmr8851585137.21.1737407011106; Mon, 20 Jan 2025 13:03:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737407011; cv=none; d=google.com; s=arc-20240605; b=h+frttHGV8IjNpKa5LYUSgXkHEu5pD6FcUkIbLUaCUwiSZUdtDA4CFBFrmHHEzXkJe 1zk9UEtXTNkS/ju3r/fK2CokDeHFSWsg8pYxrhi9HpQEazaakqJqFHiGJAbb30MRbDIo khhZ7Tp1hjiyB/FmkopoMrHlL0iEuxWNHPtbo/AYAXMkZOCPzsndkpxsPdJexqmStF+0 /L5qWyMrPrOeaXSA/ml/MLVoIMp9oFsdhxOGcFWOY7yTegFeOyCG/YK5WuI9O16WO0Zn 5KR1Cb2iWBsDTD3LR77z/5/6BpJ8v1rC/fQWqLAABVL/9srPAYSPrRHJvYOznlgseJeJ Gm2Q== 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=OdEyfb2ARjEb4j0/bYd/22LdLj+HvII9zUuxIjGCbvU=; fh=iCFl+fBZFrunY0EaQgN6g6Y7B9hqxuXuonA7mcbdEiY=; b=ahN9E/xqBs6+yZha+e7OoLQ243rgGKJfJGyD1OF+DprwzUaPsPaCT7zwjL3FkrcADk bKYYEidqeGfFJlwvmOEVdfsqFNld3W/OqfAZ3X/QxxVA/qdSEUZpAUDbYJV1U/Ivh3mF Lxo8R61Y/Z1n0p+tSRpVXYnjAmojcsrOvWjbSuiV3Y0eH5YmA56QXFiMnb5PY+PAWQgM +/fltoDx9KJHj2oot1bEwaAjcsmcpnzhkRrMXV6B5ofv6Oa5/Aq4cibSMgU12hyzYIna NRZSGYpTtwrzu0r2+1xzPd8+7Vg5/+rzFAaQWP+LQfUbj1PwwGQPmVRQK1Wd1dQKRTrX Lkgw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HStwBCVV; 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 ada2fe7eead31-4b68a32463dsi2476794137.446.2025.01.20.13.03.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Jan 2025 13:03:31 -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=HStwBCVV; 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 1tZyuy-000267-VG; Mon, 20 Jan 2025 16:02:44 -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 1tZyug-0001g6-0U for qemu-devel@nongnu.org; Mon, 20 Jan 2025 16:02:28 -0500 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tZyua-0002xo-RG for qemu-devel@nongnu.org; Mon, 20 Jan 2025 16:02:24 -0500 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5db6890b64eso903120a12.3 for ; Mon, 20 Jan 2025 13:02:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737406938; x=1738011738; 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=OdEyfb2ARjEb4j0/bYd/22LdLj+HvII9zUuxIjGCbvU=; b=HStwBCVV+8cg0Ohbz26qptk2rHQSjHESSNfrA3pcjKGnsjAETjBZj9ntDVnzS/24HT OrOjGNklqe4lvURAgpxyGGAbqatD0W2pYFeHiQG3iZt5PUXlJqlDj4N5RAh4hVeBUCmf Ri3R0eyYBi86JiwVM22nVM/wGS3gAB5e0ApT6M0ZJYi60Rb5+RDVRN7B4W2jqwSU7rbq bYgK7bHocluasme3K8gQGOhTqIYu34/RLGCgy4LHO6IDD8n1q3bZOkO14flQlxqj5Ctm KJcEfPtbK2kQ78UARdxXjd+kYnWiJkH2ABHP5QwqCmnPcktE+MtHOLUsVobuy8BB9Y5S 3e8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737406938; x=1738011738; 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=OdEyfb2ARjEb4j0/bYd/22LdLj+HvII9zUuxIjGCbvU=; b=HDlYhy1TALX7MLT05nxfYEHaFN2oWEFsBDsZh5D9uE93jVb3i1TBGpjd4RzYDuQJZk qnZykFk7PGYPu4y6AwDXmH5lhHgaSipY+yFaZsQuTFqvCzbSn7f+3DlVCJfe/nvVG7/k 4+cCBhk5PkUPOSzdDMbsHXuByOYOG4WezAVwU1uy86rD+/mH77WgIA0kVL+g8bw9Dl+L eO+R6nw5rYUnEU288BV+mdAstKidDnE1AW8OK5HvECmooeJICkyXNZfu8q5T5xobRdWj C5Khxpclf8bpITIiEDqNALw5AvgalBF2IbiGDMZaa54dj51OX1pahXUpagkS0hHgb+T0 bm/g== X-Gm-Message-State: AOJu0Yw23tzV+X8piwrqhOagW3wlfJ3d3pj3QQtfWtFeouGnuQwcxZkN OEJOjtO/b4iB0FugGsl0/o/ObSr1mgmJJzjnHV1eniooJ2L63WPhx0ybPggSPZI= X-Gm-Gg: ASbGncvnJ99/VcfLK06/6/ShSa6Ti9vd26fqf/OxXKc5FtHQv5aVVzx/+yDlg4MC7/B Xc4ewkNJKuyztOLUTHfZ5YYrCuqE2dKxo8RG5CPThN2bEuJ9BlSAswS72YelK6xs35Xtyc5w14c 51QFTUlkc54Hji74E5YegXENVuSbXpaCJSnG/5HXB+ENj83SELGBvJ4Kfz7TPzVMVJOOoG4OzeE aGcmPqR7UzBs/epKqFnFq49QQuWjqRUtoO8zmvWXCrqSbJjbzCMG6SzvgawxUQuPj51 X-Received: by 2002:a17:907:7e95:b0:aa6:715a:75b5 with SMTP id a640c23a62f3a-ab38b44d44fmr1166183966b.46.1737406938130; Mon, 20 Jan 2025 13:02:18 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384f86fe9sm664667166b.135.2025.01.20.13.02.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2025 13:02:16 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 73BA35FA4B; Mon, 20 Jan 2025 21:02:13 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Thomas Huth , Peter Maydell , =?utf-8?q?Alex_Benn=C3=A9e?= , Paolo Bonzini Subject: [PATCH 7/7] Revert "util/timer: avoid deadlock when shutting down" Date: Mon, 20 Jan 2025 21:02:12 +0000 Message-Id: <20250120210212.3890255-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250120210212.3890255-1-alex.bennee@linaro.org> References: <20250120210212.3890255-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x533.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 reverts commit bc02be4508d8753d1f6071b77d10f4661587df6f. Now we catch attempts to clock_step to the next timer when none are enabled we can revert the previous attempt to prevent deadlock. As long as a new target time is given we will move time forward even if no timers will fire. This is desirable for tests which are checking that nothing changes when things are disabled. Previously most tests got away with it because --enable-slirp always has a timer running while the test is active. Signed-off-by: Alex Bennée Cc: Peter Maydell --- util/qemu-timer.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/util/qemu-timer.c b/util/qemu-timer.c index 0e8a453eaa..3243d2c515 100644 --- a/util/qemu-timer.c +++ b/util/qemu-timer.c @@ -675,17 +675,10 @@ int64_t qemu_clock_advance_virtual_time(int64_t dest) { int64_t clock = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); AioContext *aio_context; - int64_t deadline; - aio_context = qemu_get_aio_context(); - - deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL, - QEMU_TIMER_ATTR_ALL); - /* - * A deadline of < 0 indicates this timer is not enabled, so we - * won't get far trying to run it forward. - */ - while (deadline >= 0 && clock < dest) { + while (clock < dest) { + int64_t deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL, + QEMU_TIMER_ATTR_ALL); int64_t warp = qemu_soonest_timeout(dest - clock, deadline); qemu_virtual_clock_set_ns(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + warp); @@ -693,9 +686,6 @@ int64_t qemu_clock_advance_virtual_time(int64_t dest) qemu_clock_run_timers(QEMU_CLOCK_VIRTUAL); timerlist_run_timers(aio_context->tlg.tl[QEMU_CLOCK_VIRTUAL]); clock = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); - - deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL, - QEMU_TIMER_ATTR_ALL); } qemu_clock_notify(QEMU_CLOCK_VIRTUAL);