From patchwork Tue Aug 13 20:23:21 2024 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: 818858 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp430745wrm; Tue, 13 Aug 2024 13:26:31 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUGBsc5qbvQCbuNTIG+sEzymn+U5ddGM1WBX2Bt/VZfNi7xqIahtx+O4bqg04hKzit0zQaIaA==@linaro.org X-Google-Smtp-Source: AGHT+IFLTqO5ysGOgvj5wSjfi2WOHnHG8SVXOgEbZ8B+M2ZqbH4w2qmmdrMkDagrx59qVtIbg8Z1 X-Received: by 2002:a05:6358:2c93:b0:1a8:b83a:8e26 with SMTP id e5c5f4694b2df-1b1aa9a808cmr83641555d.0.1723580791061; Tue, 13 Aug 2024 13:26:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723580791; cv=none; d=google.com; s=arc-20160816; b=ySYTbEns8RYtEQ+tUBWMTZKPgHy/ycCZH3ek2Qjg4LsPTEclNVYoJqwhdiYFzRPL0Y yru8ezicR5tOV/QhRtR23M98O9d0jKxX5flbyT1vHA0a9fbIAouRgR83IIwKBLXkL4VO 0JE/MwVJrSHnR5+egW+nNCX+Is8twD/DRY0IinfHzSaxxwz8T/dSV44aNwX/IUaSRf9a 3DKmXFwualgv2B6rUXp/R5dTmqtoSuOfuRoMVcUwqpwEykYq9oAb4FpigS17lhW7cg5u gdK0naMTOd7Q+n8FlGccHiuTtu7Jk9jhkBGJDjB1zAkStpmS1Zq5tkmh48c5z6LLiUGW A0yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=LWXPvrAXN+b9vbW8f3D9TjDx5XdO3wBrf9b11Ogrln0=; fh=2Uj2tGQCTXopsDH26iMBTwdsgctwEBjqGya0Hcf7oYs=; b=XyQqEiVfADBG9zfDVqf9aPZC8BjvinzGcL2FWM1ltc8q19NGI/n1BdooQyMO6dIVwS dYCAQbRd2Cq2YMRx7DD0L7E3+16VI2DXNb1bOt+QKHDgfpc92ZqP/vo88UIvT6LOhAdn FF9b0mnDXh30T0ZZjMuCqD3L2eXEMi269g+PHXT55VMcxUkNL/QW6fTL6JaCOLS4+H+J ALtP9Leo5pS62nfZMIPXOFTeXeVmikm9P2XLGZ7e5T7GYXRUOvXRA5dVKkFLDZzZHs61 aQ/JNgNFiKL1HtwEV5tmDlM/lk7N9ajV87nnYwFB7Dm8CehxBmuQ61/HRdGhYLxonVkT 1KHA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ejEKkYMB; 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-7a4c7e05690si984655385a.387.2024.08.13.13.26.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Aug 2024 13:26:31 -0700 (PDT) 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=ejEKkYMB; 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 1sdy40-0006Z7-Or; Tue, 13 Aug 2024 16:24:16 -0400 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 1sdy3s-00060g-Mg for qemu-devel@nongnu.org; Tue, 13 Aug 2024 16:24:09 -0400 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 1sdy3S-0006Gl-GW for qemu-devel@nongnu.org; Tue, 13 Aug 2024 16:24:06 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-428ec6c190eso45335995e9.1 for ; Tue, 13 Aug 2024 13:23:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723580621; x=1724185421; 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=LWXPvrAXN+b9vbW8f3D9TjDx5XdO3wBrf9b11Ogrln0=; b=ejEKkYMBIvRcmoBbwB/OoxI1xhEXX28w6sTylrPxb23f0mPhocMewCvnKb+c0bpeqF bSEeoPmmV/zeg/6cacsnFi1uyfxmUrhuM9olxFcRSpmH6FfFT79EukzNt4X1qg3vRUir juNmwntJOVkXMSy4kC/MH0q8HOa90YqeS2bhkhFMr/dOc1lQcaTdK7nOqgy9mgxM9YIE ++oa82OjY344zqtGov3nGOt2eouGucblHCiPkXz5Z//+IcBEKed0EdVAHsh58TXrLurj LJvd9ITQt3hzyO0kDOQNYy4J9qprGBdeiRXIj3TLGe01N1u4w/i+DdzLkj1xXaStPyud W0yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723580621; x=1724185421; 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=LWXPvrAXN+b9vbW8f3D9TjDx5XdO3wBrf9b11Ogrln0=; b=m2IoNroGqYEAgcgKm+w+QjBxAY/2XJMRl5tEx4aHbj3SCm58Tie4j8Q4GUKbYBZgzq 15khZBfGkyw3Vic3ltTXwbU9tKB8KJOkoqAfU90y5ENSNh3Fu+AlGaWs7c3OXY4N3y1w toHG6o1dbSopMbrkvb3xHmTk8GQhgghJd+r0LubduKIWkKdBR4+bLl3yjX3wNc5pImi+ NYZv3tM/+VMlQzw0dgbJbcvox4EKIPnKun0D37tdma1mKhTe/yH8/UCayt7f6thxzDZp 7U9aUHb0+1yrW88IVEo888SaDdq3JHZ6B0Nl0n1BMfccQssMmjGOCg3sh85WCKx/rl2i RTqg== X-Gm-Message-State: AOJu0YwULQ+3aKjSBVFlv1oI9smOkVDoUEZJbCRV2PFBdZx1MDd2vuzA n7kl+drI/jfWNM2xNzziwEwxS+WMt89U/l7+FpUQzPcSZr/6/F/RRcUv4VlB22s= X-Received: by 2002:a5d:4001:0:b0:371:72a8:15e with SMTP id ffacd0b85a97d-37177777850mr446555f8f.16.1723580620625; Tue, 13 Aug 2024 13:23:40 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36e4cfeef61sm11263938f8f.57.2024.08.13.13.23.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2024 13:23:38 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id A48BE5FD6E; Tue, 13 Aug 2024 21:23:30 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , Michael Roth , Palmer Dabbelt , Mahmoud Mandour , Pavel Dovgalyuk , Yoshinori Sato , Weiwei Li , Eduardo Habkost , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , David Hildenbrand , Beraldo Leal , Liu Zhiwei , Eric Auger , Song Gao , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-arm@nongnu.org, Peter Xu , Jiri Pirko , Eric Blake , Fabiano Rosas , qemu-s390x@nongnu.org, Peter Maydell , "Michael S. Tsirkin" , Daniel Henrique Barboza , John Snow , Alexandre Iooss , Konstantin Kostiuk , Pierrick Bouvier , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Thomas Huth , Paolo Bonzini , Richard Henderson , Jason Wang , Bin Meng , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Nicholas Piggin Subject: [PATCH v2 13/21] Revert "replay: stop us hanging in rr_wait_io_event" Date: Tue, 13 Aug 2024 21:23:21 +0100 Message-Id: <20240813202329.1237572-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240813202329.1237572-1-alex.bennee@linaro.org> References: <20240813202329.1237572-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, T_SCC_BODY_TEXT_LINE=-0.01 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 From: Nicholas Piggin This reverts commit 1f881ea4a444ef36a8b6907b0b82be4b3af253a2. That commit causes reverse_debugging.py test failures, and does not seem to solve the root cause of the problem x86-64 still hangs in record/replay tests. The problem with short-cutting the iowait that was taken during record phase is that related events will not get consumed at the same points (e.g., reading the clock). A hang with zero icount always seems to be a symptom of an earlier problem that has caused the recording to become out of synch with the execution and consumption of events by replay. Acked-by: Alex Bennée Signed-off-by: Nicholas Piggin Message-Id: <20240813050638.446172-6-npiggin@gmail.com> Signed-off-by: Alex Bennée --- include/sysemu/replay.h | 5 ----- accel/tcg/tcg-accel-ops-rr.c | 2 +- replay/replay.c | 21 --------------------- 3 files changed, 1 insertion(+), 27 deletions(-) diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h index f229b2109c..8102fa54f0 100644 --- a/include/sysemu/replay.h +++ b/include/sysemu/replay.h @@ -73,11 +73,6 @@ int replay_get_instructions(void); /*! Updates instructions counter in replay mode. */ void replay_account_executed_instructions(void); -/** - * replay_can_wait: check if we should pause for wait-io - */ -bool replay_can_wait(void); - /* Processing clocks and other time sources */ /*! Save the specified clock */ diff --git a/accel/tcg/tcg-accel-ops-rr.c b/accel/tcg/tcg-accel-ops-rr.c index 48c38714bd..c59c77da4b 100644 --- a/accel/tcg/tcg-accel-ops-rr.c +++ b/accel/tcg/tcg-accel-ops-rr.c @@ -109,7 +109,7 @@ static void rr_wait_io_event(void) { CPUState *cpu; - while (all_cpu_threads_idle() && replay_can_wait()) { + while (all_cpu_threads_idle()) { rr_stop_kick_timer(); qemu_cond_wait_bql(first_cpu->halt_cond); } diff --git a/replay/replay.c b/replay/replay.c index b8564a4813..895fa6b67a 100644 --- a/replay/replay.c +++ b/replay/replay.c @@ -451,27 +451,6 @@ void replay_start(void) replay_enable_events(); } -/* - * For none/record the answer is yes. - */ -bool replay_can_wait(void) -{ - if (replay_mode == REPLAY_MODE_PLAY) { - /* - * For playback we shouldn't ever be at a point we wait. If - * the instruction count has reached zero and we have an - * unconsumed event we should go around again and consume it. - */ - if (replay_state.instruction_count == 0 && replay_state.has_unread_data) { - return false; - } else { - replay_sync_error("Playback shouldn't have to iowait"); - } - } - return true; -} - - void replay_finish(void) { if (replay_mode == REPLAY_MODE_NONE) {