From nobody Fri Nov 14 15:23:46 2025 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1588753093; cv=none; d=zohomail.com; s=zohoarc; b=Wv8gjI+Z2cOLEHCoQQKAHbTJqRGyOqn+QIuPXTPaz8a7Gk9Yv0X6RlOMw1TK/6tIgX2g86VcSvRp/g9yXIy/gpFvrWHk3J2XzMDmk7qW84Gnby3JI5xrr+OyCXLq+BAMnUolYOdad25VY3BgU96GYf73gfR5avHQFBCSVBq8ipA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588753093; 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=Oa7lHNff7ctDUTwtJ6tE1qehxAATTJj0AGt+qCf6MFs=; b=ZdIgfO7sTsZGVbCG0AyPGC5KNJn/pR/Tab9Y00bcu7Hj7LoudlCJSoMCeTg//WlVyyMhds6hMs9m7THzGtmVKKS+cNSOdlm4VjjMFT5IEv8Zf+Sf+fI5bouxOGWVXPx6W6lp6D+QIJ/GEzmdgPpDVj7v6tY8awSGyW2T9ojt8FI= 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 1588753093709818.1182686028302; Wed, 6 May 2020 01:18:13 -0700 (PDT) Received: from localhost ([::1]:53760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWFFs-00066Q-ET for importer@patchew.org; Wed, 06 May 2020 04:18:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37020) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWFF8-0005JI-Qk for qemu-devel@nongnu.org; Wed, 06 May 2020 04:17:27 -0400 Received: from mail.ispras.ru ([83.149.199.45]:41424) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWFF7-0005JD-G9 for qemu-devel@nongnu.org; Wed, 06 May 2020 04:17:26 -0400 Received: from [127.0.1.1] (unknown [62.118.151.149]) by mail.ispras.ru (Postfix) with ESMTPSA id 0C679CD460; Wed, 6 May 2020 11:17:22 +0300 (MSK) Subject: [PATCH] replay: synchronize on every virtual timer callback From: Pavel Dovgalyuk To: qemu-devel@nongnu.org Date: Wed, 06 May 2020 11:17:22 +0300 Message-ID: <158875304273.3986.105601155554744438.stgit@pasha-ThinkPad-X280> User-Agent: StGit/0.17.1-dirty 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: softfail client-ip=83.149.199.45; envelope-from=Pavel.Dovgaluk@gmail.com; helo=mail.ispras.ru X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/06 03:52:27 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: 7 X-Spam_score: 0.7 X-Spam_bar: / X-Spam_report: (0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=0.9, SPF_SOFTFAIL=0.665, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: pbonzini@redhat.com, dovgaluk@ispras.ru, pavel.dovgaluk@ispras.ru Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Sometimes virtual timer callbacks depend on order of virtual timer processing and warping of virtual clock. Therefore every callback should be logged to make replay deterministic. This patch creates a checkpoint before every virtual timer callback. With these checkpoints virtual timers processing and clock warping events order is completely deterministic. Signed-off-by: Pavel Dovgalyuk Acked-by: Alex Benn=C3=A9e --- util/qemu-timer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/util/qemu-timer.c b/util/qemu-timer.c index d548d3c1ad..47833f338f 100644 --- a/util/qemu-timer.c +++ b/util/qemu-timer.c @@ -588,6 +588,11 @@ bool timerlist_run_timers(QEMUTimerList *timer_list) qemu_mutex_lock(&timer_list->active_timers_lock); =20 progress =3D true; + /* + * Callback may insert new checkpoints, therefore add new checkpoi= nt + * for the virtual timers. + */ + need_replay_checkpoint =3D timer_list->clock->type =3D=3D QEMU_CLO= CK_VIRTUAL; } qemu_mutex_unlock(&timer_list->active_timers_lock); =20