From patchwork Mon Jan 8 15:13:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 760774 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e02:0:b0:337:62d3:c6d5 with SMTP id h2csp936159wrz; Mon, 8 Jan 2024 07:15:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IHXk96NdMO7J8gweUlpG4J5eFlUA5n0olMloXW3UMTvVGKk54mdCSc5T16KXkDrWhhoV0oq X-Received: by 2002:ae9:f114:0:b0:783:783:1ded with SMTP id k20-20020ae9f114000000b0078307831dedmr4398164qkg.152.1704726959334; Mon, 08 Jan 2024 07:15:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704726959; cv=none; d=google.com; s=arc-20160816; b=qliD0uMdlk7rh7yRVipLUgFoYM00h8FugYYKYJ7dnuRSwtSma4PvvoUv96ahItxVzQ XisNi3LxokVx8qdpzlCrBZ5ygtymz8vfqb+f4yrQdmSp0epzDYDo8UEuOZZOmyZabT6P r8dfNU/ugz+gT6u1GtgROJ4FDx89c8nBd16niNNQ1hPRq02KdnZ2sSgIhRvyKFOowbeq tLvkem3ftbfevrlNOmpt7BDt2AfxS7io9/fRoVNA/49Yc4ySZpS+SU1liTJF/qSgBSWg KTX8rYCuQrdDcVsnj+6yR04xBJ0WWsAu/ezg/lPm48RnLv1/e58cTEJmNe8Nf9xm7ALP 2fuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SPOk6AJuTFsbsY/JbpngsdrxHBBFNIYVyd4S9YTkZ9o=; fh=4tnIo1nwYqKXRyJrm3zCLHpat1pd+2G19fIpj41A82g=; b=0obH9LvRykDEkTiCPu8ZUF0A7tPIp8xYO06gE0gOeZSvQcCrAzq/p1LoOflVHulkks RnqUlq0Vt2MnikkpTw+9CIQCW6zXPf2ZGGc7azADxJ4/NahxtHsrzdHslR9mTTGG476i O6sduf+17FDx+kTmAg9ElOPhZArqwSyCJhKyMLt12KTlKMjkJRHlWhqrtqMwpTmc+AyB fVYjUGnUQsBgyc/8lcxHU2xXMo17LKvS+hnrZZw5IXS7rj4owMcrY21cfqk3MehGqztp Hj2Yon8bscCcFGxs1T07You8k3pd3JhHxanf9ZqZ78x71U6mK+JxqQAIIJu3aOqBPfXc iOQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=elbBRmRy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v3-20020ae9e303000000b0078192520d69si7755438qkf.544.2024.01.08.07.15.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Jan 2024 07:15:59 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=elbBRmRy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMrKI-0004FK-Oj; Mon, 08 Jan 2024 10:14:06 -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 1rMrKG-0004EK-W9 for qemu-devel@nongnu.org; Mon, 08 Jan 2024 10:14:05 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rMrKE-0001ai-HF for qemu-devel@nongnu.org; Mon, 08 Jan 2024 10:14:04 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40d89446895so11540495e9.0 for ; Mon, 08 Jan 2024 07:14:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704726840; x=1705331640; 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=SPOk6AJuTFsbsY/JbpngsdrxHBBFNIYVyd4S9YTkZ9o=; b=elbBRmRyT5xCIwaPYLGpbkkLhHL1pETurwbivmsWFxxAYyaCKJhGsmcVYT+Sprr0ip zJUnGMEg6K+WRtgaIxmF5Nx3prqfSjr4I6nHOhEF+gC0UXAgKLZY7ebhxWKuczS2f+Bk R2726ECtzNvRvooOr2iO2fa9JNqQrbqExWF12O0fNuWCF9CZNqigUl8GaHQU6WQQUh4z JkLh1gL4OVPYbr3npcRPVO77AG3k2wkvz+EZZ+0KEokO0rXwqtUQSmMn8Ahv9tGKv5UN ba2L+HyFSAvG0iEzCs3UQ7pbYfIXEEaOPeV2DDrh44OFQowe3VMoohLWLP2q8glxH24H SxHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704726840; x=1705331640; 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=SPOk6AJuTFsbsY/JbpngsdrxHBBFNIYVyd4S9YTkZ9o=; b=XvGpXpGjsCJ+OL9sdf04acm+JmAgfly9Ak+snMtQnsBZQQYHT7oyaw7JJ1kjOS9zkr NPhVlTyhQUpaEYQ54p0nBN6SEKoD7uXOSIJEDyy3y+XyyJutNuvvrLrpq5/Q5At0qdxl qbj0Xs/toPNBJL2bgDJCHhLZfV/gzV7VZ+sxOkhFAc6jtGqYVR3MHHL2hRyDnvneWnXU N3u2EtEXgx+4lPkfKa3tg8s41JiNQl76zQBpQsWsn98ga/It6nN2LLAh7eBKQcUqe4lu c0hImG7W5VPvs3FghRSzCusqtA//Bhz+jqN7Nq3b+Btvy4mE4xeddFevMuWkDJBBJBjW zZrA== X-Gm-Message-State: AOJu0Yz8n2sJaCfofbIY3Hvzz+SNXNYw+6syt0O0f0Ao8q9x1WGBIsMp cBRATUUxILY06dXDqCIzeucpv0fx299Tmg== X-Received: by 2002:a05:600c:35d1:b0:40d:887e:fc85 with SMTP id r17-20020a05600c35d100b0040d887efc85mr1906231wmq.32.1704726839847; Mon, 08 Jan 2024 07:13:59 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id j8-20020a05600c190800b0040d6d755c90sm119705wmq.42.2024.01.08.07.13.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 07:13:56 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 8D7FD5F94A; Mon, 8 Jan 2024 15:13:53 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Pavel Dovgalyuk , Richard Henderson , Pavel Dovgalyuk , Paolo Bonzini Subject: [PULL 08/13] replay: make has_unread_data a bool Date: Mon, 8 Jan 2024 15:13:47 +0000 Message-Id: <20240108151352.2199097-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240108151352.2199097-1-alex.bennee@linaro.org> References: <20240108151352.2199097-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x331.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org For clarity given it only has two states. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Pavel Dovgalyuk Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20231211091346.14616-9-alex.bennee@linaro.org> diff --git a/replay/replay-internal.h b/replay/replay-internal.h index 98ca3748edb..1bc8fd50868 100644 --- a/replay/replay-internal.h +++ b/replay/replay-internal.h @@ -75,7 +75,7 @@ enum ReplayEvents { * @current_icount: number of processed instructions * @instruction_count: number of instructions until next event * @data_kind: current event - * @has_unread_data: 1 if event not yet processed + * @has_unread_data: true if event not yet processed * @file_offset: offset into replay log at replay snapshot * @block_request_id: current serialised block request id * @read_event_id: current async read event id @@ -85,7 +85,7 @@ typedef struct ReplayState { uint64_t current_icount; int instruction_count; unsigned int data_kind; - unsigned int has_unread_data; + bool has_unread_data; uint64_t file_offset; uint64_t block_request_id; uint64_t read_event_id; diff --git a/replay/replay-internal.c b/replay/replay-internal.c index 77d0c82327e..634025096ef 100644 --- a/replay/replay-internal.c +++ b/replay/replay-internal.c @@ -179,7 +179,7 @@ void replay_fetch_data_kind(void) replay_state.instruction_count = replay_get_dword(); } replay_check_error(); - replay_state.has_unread_data = 1; + replay_state.has_unread_data = true; if (replay_state.data_kind >= EVENT_COUNT) { error_report("Replay: unknown event kind %d", replay_state.data_kind); @@ -191,7 +191,7 @@ void replay_fetch_data_kind(void) void replay_finish_event(void) { - replay_state.has_unread_data = 0; + replay_state.has_unread_data = false; replay_fetch_data_kind(); } diff --git a/replay/replay-snapshot.c b/replay/replay-snapshot.c index e5e39161e33..d4f6cb7cda8 100644 --- a/replay/replay-snapshot.c +++ b/replay/replay-snapshot.c @@ -47,8 +47,8 @@ static int replay_post_load(void *opaque, int version_id) static const VMStateDescription vmstate_replay = { .name = "replay", - .version_id = 2, - .minimum_version_id = 2, + .version_id = 3, + .minimum_version_id = 3, .pre_save = replay_pre_save, .post_load = replay_post_load, .fields = (const VMStateField[]) { @@ -56,7 +56,7 @@ static const VMStateDescription vmstate_replay = { VMSTATE_UINT64(current_icount, ReplayState), VMSTATE_INT32(instruction_count, ReplayState), VMSTATE_UINT32(data_kind, ReplayState), - VMSTATE_UINT32(has_unread_data, ReplayState), + VMSTATE_BOOL(has_unread_data, ReplayState), VMSTATE_UINT64(file_offset, ReplayState), VMSTATE_UINT64(block_request_id, ReplayState), VMSTATE_UINT64(read_event_id, ReplayState),