From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCA1FC43461 for ; Thu, 1 Apr 2021 11:24:43 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3899360BD3 for ; Thu, 1 Apr 2021 11:24:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3899360BD3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:35470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRvRK-0002Un-8J for qemu-devel@archiver.kernel.org; Thu, 01 Apr 2021 07:24:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34154) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRvPF-0000ju-Aw for qemu-devel@nongnu.org; Thu, 01 Apr 2021 07:22:33 -0400 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]:44905) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lRvPD-0006gh-My for qemu-devel@nongnu.org; Thu, 01 Apr 2021 07:22:33 -0400 Received: by mail-ej1-x62d.google.com with SMTP id e14so2301608ejz.11 for ; Thu, 01 Apr 2021 04:22:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BQ2k06TKvkRak3oJkOP50HBxN0KuGNiuSPZNaP9RB5o=; b=NjLQXYtswEi83ijiKTbBVcTBY4ZXaRs8AS31QtE3M2lA2+51v02UqCBtT7u/2KNEhG Z8e80FHf/qC7ZmDXhDWQjM86OPZvm7SYTC3q4u8itKdxiEH/EPqC19EiTFzpkVduUhH/ z84xKyA8x0tth3kNs4peDateGw++qIiOGmnW69faB+w001g1yR6XXF1/bc6vRPxU1rgT iEw4SSYy1EW12R4Qi9/pUFrVPTW1k0jbUULq8nRQ8SqCu2MZB4AerumSExyyWkg91pr6 wiklxzsVw2AOhyiJTOzCMgswZBMk0UkP4EFtVABcUs6SmrPc3IKL2haC+ZbKsDlugh9h XLxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=BQ2k06TKvkRak3oJkOP50HBxN0KuGNiuSPZNaP9RB5o=; b=glz/CYeE97RuCoKV/RbyW42dRTUDn9VFnRr3eDdU4DF+JhkuX18DFjs+DAvQxtuokG AeASqhrB/UWfcZ19tQ6+IS56EtqbGQaNJwvo/gcXHnPqOwfNj+gIM8SHTQcQ7+z0C/vx MYVl0Gqtoj3dyGMlhPBaaPK0DLaIc0UZpt48KwXGx5ylSRWwZoGd9cJheYZzaiDls4Xp xe91v+Td1Rj2AHVPvswnDgktbUtAEiqC5MKVpfHeAxkyIeXZn/osC8VxIXg7FuQXCVJj ug6Xpii83v4kVhEE+m4pX+0FbkWXM2R+J8/+yh+5mwEGk2RxJPUeFYwgDW7yh29onxuM E0VQ== X-Gm-Message-State: AOAM532keCvR/1/6DLB1zpNBwcuk/HOp0wBBW/AVoyk6nksUxY3lsWXs e3NxfoMcvgbvQbWUUijS2jzvXmvaOVU= X-Google-Smtp-Source: ABdhPJwbTN5MafkBHpewYcQ2iZsliIy+EW3jo4GKIAHYmJIwpiy8oUVZw5waxSn4cYXiUp0W1S+s+A== X-Received: by 2002:a17:906:9442:: with SMTP id z2mr8992610ejx.79.1617276147636; Thu, 01 Apr 2021 04:22:27 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id d15sm3383516edx.62.2021.04.01.04.22.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Apr 2021 04:22:27 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 04/12] replay: fix recursive checkpoints Date: Thu, 1 Apr 2021 13:22:15 +0200 Message-Id: <20210401112223.55711-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210401112223.55711-1-pbonzini@redhat.com> References: <20210401112223.55711-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x62d.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: Pavel Dovgalyuk Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Pavel Dovgalyuk 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 Message-Id: <161700476500.1140362.10108444973730452257.stgit@pasha-ThinkPad-X280> Signed-off-by: Paolo Bonzini --- 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) } 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 == REPLAY_MODE_PLAY); + return false; } in_checkpoint = true; -- 2.30.1