From nobody Sat Apr 27 16:39:46 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ispras.ru ARC-Seal: i=1; a=rsa-sha256; t=1617004828; cv=none; d=zohomail.com; s=zohoarc; b=Hw9IUa3PFzBh2ynSPc2oO1ITkDJa1eVexMaGcPdoEiIzVCmd0yZHvr6nRN5uMfV1yAkvuWBIZqTyr6Nu7iQk6N3cNlTXPaIuYOAO4nxI1bH+V3cNSoLXrLu2FpFdEkIsAtfLLjSnUN0onp8ohYq6tSeqtNCZQX4lhZhKaq946d8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617004828; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=NnvZ0GWQG+kHRhXFpYstiATBnvXiyK0qrL5gipiflrw=; b=d0b3dJT/gliY+nM9cwyWYZjEFhDeGvbX7q6Mpj++avr9wCsL4mOw/3EzTFsweb848DCAFsX41Di+l105lkZcVWZh5MK0314xaAaYKSewuXx2jk3AzONRt5FYDt0LMq15Xo5EtV1mTHyHT95/LysLOpPTZgDT2l7onfGoUW/4tBw= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1617004828585386.503552169753; Mon, 29 Mar 2021 01:00:28 -0700 (PDT) Received: from localhost ([::1]:43788 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lQmoz-0001Hh-8G for importer@patchew.org; Mon, 29 Mar 2021 04:00:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lQmoC-0000pd-FY for qemu-devel@nongnu.org; Mon, 29 Mar 2021 03:59:36 -0400 Received: from mail.ispras.ru ([83.149.199.84]:56664) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lQmoA-0005X4-8b for qemu-devel@nongnu.org; Mon, 29 Mar 2021 03:59:36 -0400 Received: from [127.0.1.1] (unknown [62.118.151.149]) by mail.ispras.ru (Postfix) with ESMTPSA id 55E3C40755CC; Mon, 29 Mar 2021 07:59:25 +0000 (UTC) Subject: [PATCH] replay: fix recursive checkpoints From: Pavel Dovgalyuk To: qemu-devel@nongnu.org Date: Mon, 29 Mar 2021 10:59:25 +0300 Message-ID: <161700476500.1140362.10108444973730452257.stgit@pasha-ThinkPad-X280> User-Agent: StGit/0.23 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=83.149.199.84; envelope-from=pavel.dovgalyuk@ispras.ru; helo=mail.ispras.ru X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org, pbonzini@redhat.com, pavel.dovgalyuk@ispras.ru Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Record/replay uses checkpoints to synchronize the execution of the threads and timers. Hardware events such as BH are processed at the checkpoints too. Event processing can cause refreshing the virtual timers and calling the icount-related functions, that also use checkpoints. This patch prevents recursive processing of such checkpoints, because they have their own records in the log and should be processed later. Signed-off-by: Pavel Dovgalyuk --- replay/replay.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/replay/replay.c b/replay/replay.c index c806fec69a..6df2abc18c 100644 --- a/replay/replay.c +++ b/replay/replay.c @@ -180,12 +180,13 @@ bool replay_checkpoint(ReplayCheckpoint checkpoint) } =20 if (in_checkpoint) { - /* If we are already in checkpoint, then there is no need - for additional synchronization. + /* Recursion occurs when HW event modifies timers. - Timer modification may invoke the checkpoint and - proceed to recursion. */ - return true; + Prevent performing icount warp in this case and + wait for another invocation of the checkpoint. + */ + g_assert(replay_mode =3D=3D REPLAY_MODE_PLAY); + return false; } in_checkpoint =3D true; =20