From nobody Wed Nov 12 05:26:18 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.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=1568714096; cv=none; d=zoho.com; s=zohoarc; b=aAkWd4XsnbIDo5Vaw/0zzhc4ySKJ/AGFN6qTFMps8lCKVpKNqQ05KwucynefnVi270S493rEUpmCBJ9Pr5/s499RAz1rpDFVsvbmFTtwbADQAIFk5wHIW4E3e4kJdD8hjcDslCFg4ipXEJsWu+XllBMiilK10C3j7FgEBiq7mqI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568714096; 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:ARC-Authentication-Results; bh=zdyKvrvBoJUzil6tRYI+rdjokJCwlCkHwHwGdu/NHF8=; b=GL1wv91fHImzRWh2Kihc1F4U5C2sVyoJ2Snw2oFCesSoXHER+vTul6Cl6ODq7Wd2mY02MS4WZQg3u0DzQeFQRzNfvZH/3O97LpfzBSwZpjqFszS3ulebqdKhpYfip2i5nsjDzIyDASnZCJQYK1hHb9RyTvFoEPLxydOUxcvgvVQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 1568714096968744.9385354694093; Tue, 17 Sep 2019 02:54:56 -0700 (PDT) Received: from localhost ([::1]:43432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAACF-0001Sv-PW for importer@patchew.org; Tue, 17 Sep 2019 05:54:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39255) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAABW-0000yi-By for qemu-devel@nongnu.org; Tue, 17 Sep 2019 05:54:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iAABV-0006uQ-5j for qemu-devel@nongnu.org; Tue, 17 Sep 2019 05:54:10 -0400 Received: from mail.ispras.ru ([83.149.199.45]:52182) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iAABU-0006ta-To for qemu-devel@nongnu.org; Tue, 17 Sep 2019 05:54:09 -0400 Received: from [127.0.1.1] (unknown [85.142.117.226]) by mail.ispras.ru (Postfix) with ESMTPSA id E416E5400C2; Tue, 17 Sep 2019 12:54:06 +0300 (MSK) From: Pavel Dovgalyuk To: qemu-devel@nongnu.org Date: Tue, 17 Sep 2019 12:54:06 +0300 Message-ID: <156871404669.31913.13609976778909645749.stgit@pasha-Precision-3630-Tower> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 83.149.199.45 Subject: [Qemu-devel] [PATCH] replay: don't synchronize memory operations in replay mode 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, richard.henderson@linaro.org, pavel.dovgaluk@ispras.ru, dovgaluk@ispras.ru Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Commit 9458a9a1df1a4c719e24512394d548c1fc7abd22 added synchronization of vCPU and migration operations through calling run_on_cpu operation. However, in replay mode this synchronization is unneeded, because I/O and vCPU threads are already synchronized. This patch disables such synchronization for record/replay mode. Signed-off-by: Pavel Dovgalyuk --- exec.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/exec.c b/exec.c index be8b2b7c06..a69745811f 100644 --- a/exec.c +++ b/exec.c @@ -3177,8 +3177,17 @@ static void tcg_log_global_after_sync(MemoryListener= *listener) * by pushing the migration thread's memory read after the vCPU thread= has * written the memory. */ - cpuas =3D container_of(listener, CPUAddressSpace, tcg_as_listener); - run_on_cpu(cpuas->cpu, do_nothing, RUN_ON_CPU_NULL); + if (replay_mode =3D=3D REPLAY_MODE_NONE) { + /* + * VGA can make calls to this function while updating the screen. + * In record/replay mode this causes a deadlock, because + * run_on_cpu waits for rr mutex. Therefore no races are possible + * in this case and no need for making run_on_cpu when + * record/replay is not enabled. + */ + cpuas =3D container_of(listener, CPUAddressSpace, tcg_as_listener); + run_on_cpu(cpuas->cpu, do_nothing, RUN_ON_CPU_NULL); + } } =20 static void tcg_commit(MemoryListener *listener)