From nobody Wed Nov 27 02:45:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1701944867; cv=none; d=zohomail.com; s=zohoarc; b=FRumTFqQRh3hnRqHfabnY26rCywcTkLawrBuXE1Rkpev7bvHw64A13CMoK15ygo7g/ujyOpRRtTHsVspqS9Sj4UGXkq0/oURzdjfq62zPFYnUd/cESgkSgbcZtPGe5rw9m+l1iKA/n36NhGIORW5W/gcpB0MXofLV6GMO7mhqxg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1701944867; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=k3NowGfQ+Uh8kFkQHiDEgo2KSzDvk36tqOsqfMg+nHw=; b=kaEXNkNzVgiX7VChyGfE7Q27klvQndDtJAUuX8NX+Vmlo8y3oa6lGhrh9ylzOwuJMup09gRNro02OJ+JtrTkZDCHzkJzGbi4PwvBFEUVOc6/QeI4yJJOk/zR53EtcDXiGP8dIg/j0pwTLHoafI/mrpMWjrQm1jMqS1j3fLEDEAU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1701944867092839.7394737402896; Thu, 7 Dec 2023 02:27:47 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBBap-0004fq-Dh; Thu, 07 Dec 2023 05:26:55 -0500 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 1rBBaj-0004eV-Tk for qemu-devel@nongnu.org; Thu, 07 Dec 2023 05:26:51 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rBBag-0001Yw-Ti for qemu-devel@nongnu.org; Thu, 07 Dec 2023 05:26:49 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-40c09f5a7cfso9051495e9.0 for ; Thu, 07 Dec 2023 02:26:46 -0800 (PST) Received: from m1x-phil.lan ([176.187.202.111]) by smtp.gmail.com with ESMTPSA id j15-20020a05600c1c0f00b0040b4c59f133sm1435364wms.1.2023.12.07.02.26.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 07 Dec 2023 02:26:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701944805; x=1702549605; 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=k3NowGfQ+Uh8kFkQHiDEgo2KSzDvk36tqOsqfMg+nHw=; b=UHoUid5OxExp9gtgboFVFjy7u1FGS9SNgaEowrG2YGoOMFq7LJdqrvqvauTlcwENoJ 1oujlxOmVc+f+5IUOYF8V6Y+rH2Zb+3QoibqRstehXhmwY7pCi/cxWTJml11NR77NbJX zs3WgBN8Bfy98X87Z5z87lBP2+YgYQw31Z+aFQO4hcr8AVgoZAVYF9/cykNAyKzZtoQf kHt2fQTL5P6nLpqfZhw5MX9Jj9J/00APZVYmBZ+q79on6Nnu2iEPvhtFS9g+gAu6DOjd yTwYMuV+Zqj+t8/fRZM+Rs0Nszrg91loWM8ZllbyxjBzXYUQSWHcptXY5b2v0vmqdXyz fKgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701944805; x=1702549605; 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=k3NowGfQ+Uh8kFkQHiDEgo2KSzDvk36tqOsqfMg+nHw=; b=KVbsv4jA5O9oZUadxFGqjLCGNL8vjB3maVp5nZkydxm38F683tjMdiX2zph8H2ag8T eO1CZP0Tt810ueuERicaoK/Fp39D9tDxqhdoRBlkUGooX9eKC3r1tQLj4CfvfvkrCZL5 D9lz5NpsGd9uJrwRE76v9XTM6ULTR+YKQR/VMdZK7uhC8qJGEJQXj52W8hy2kG2lylfu G5p+DAruTFPzlC/fWNhpcSyFFlOaD40adfw7lsA75dg08l041vrl6upotXv3u3JJ1JLR smNGYpcKLoDBmFwtdet+QHUosxan5jQhgiGNKYwJRkfx5truIkD2F0cNsJSe4aSVCL6H 25vQ== X-Gm-Message-State: AOJu0Yw6hhVsXtOa8fNGUvUd8sMCh+F5tQu563WbJHcu0VjDG8+h0nRy Jattft05raVe6zhbsOyMJ7UwUquxjAW7UWjIzJw= X-Google-Smtp-Source: AGHT+IFSftCQ1iP3Uhw/vSbJ/eUpyDSByqITy/z+dX4EczDmrMmon7AHlzQh52UxTFVyJrnS4tISBA== X-Received: by 2002:a05:600c:4512:b0:40b:383a:ebc7 with SMTP id t18-20020a05600c451200b0040b383aebc7mr1351527wmo.34.1701944805241; Thu, 07 Dec 2023 02:26:45 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , Fam Zheng , qemu-block@nongnu.org, Paolo Bonzini , Pavel Dovgalyuk , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 2/3] sysemu/replay: Restrict icount to TCG emulation Date: Thu, 7 Dec 2023 11:26:30 +0100 Message-ID: <20231207102632.33634-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231207102632.33634-1-philmd@linaro.org> References: <20231207102632.33634-1-philmd@linaro.org> 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=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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=ham 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1701944870056100006 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/sysemu/replay.h | 2 ++ stubs/icount.c | 6 ------ system/vl.c | 6 +++++- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h index 08aae5869f..02fa75c783 100644 --- a/include/sysemu/replay.h +++ b/include/sysemu/replay.h @@ -79,12 +79,14 @@ int64_t replay_save_clock(ReplayClockKind kind, int64_t= clock, int64_t replay_read_clock(ReplayClockKind kind, int64_t raw_icount); /*! Saves or reads the clock depending on the current replay mode. */ #define REPLAY_CLOCK(clock, value) \ + !icount_enabled() ? (value) : \ (replay_mode =3D=3D REPLAY_MODE_PLAY = \ ? replay_read_clock((clock), icount_get_raw()) \ : replay_mode =3D=3D REPLAY_MODE_RECORD = \ ? replay_save_clock((clock), (value), icount_get_raw()) \ : (value)) #define REPLAY_CLOCK_LOCKED(clock, value) \ + !icount_enabled() ? (value) : \ (replay_mode =3D=3D REPLAY_MODE_PLAY = \ ? replay_read_clock((clock), icount_get_raw_locked()) \ : replay_mode =3D=3D REPLAY_MODE_RECORD = \ diff --git a/stubs/icount.c b/stubs/icount.c index fc3beac003..c39a65da92 100644 --- a/stubs/icount.c +++ b/stubs/icount.c @@ -1,5 +1,4 @@ #include "qemu/osdep.h" -#include "qapi/error.h" #include "sysemu/cpu-timers.h" =20 /* icount - Instruction Counter API */ @@ -10,11 +9,6 @@ void icount_update(CPUState *cpu) { abort(); } -void icount_configure(QemuOpts *opts, Error **errp) -{ - /* signal error */ - error_setg(errp, "cannot configure icount, TCG support not available"); -} int64_t icount_get_raw(void) { abort(); diff --git a/system/vl.c b/system/vl.c index 2bcd9efb9a..8c99c5f681 100644 --- a/system/vl.c +++ b/system/vl.c @@ -2270,7 +2270,11 @@ static void user_register_global_props(void) =20 static int do_configure_icount(void *opaque, QemuOpts *opts, Error **errp) { - icount_configure(opts, errp); + if (tcg_enabled()) { + icount_configure(opts, errp); + } else { + error_setg(errp, "cannot configure icount, TCG support not availab= le"); + } return 0; } =20 --=20 2.41.0