From patchwork Tue Dec 5 20:41:01 2023 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: 750393 Delivered-To: patch@linaro.org Received: by 2002:adf:9b9d:0:b0:333:3a04:f257 with SMTP id d29csp1897048wrc; Tue, 5 Dec 2023 12:42:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IGg0EsM9VRK2MrI4Z/W1XAQPOdru8mCA8miYDpNxdHSAl354CpQKVifq5F63hf2dj5g6QTu X-Received: by 2002:a05:620a:19a5:b0:77d:8999:100c with SMTP id bm37-20020a05620a19a500b0077d8999100cmr2275349qkb.56.1701808978933; Tue, 05 Dec 2023 12:42:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701808978; cv=none; d=google.com; s=arc-20160816; b=OwpcJIEbVrzo6kENZEmUQEA3kro7JlVTxSvPKUe5TYuPEiVxIJei0Ni6rjSrlP8GVC YhOgOLQBhm8YPhwMBCm0uJQLGHm93evgiJvSlwSSkfnvoeospqo22WMOpSaDWUIM79RN TXapiWZspIEOnkj7skXnS1LPsUxWvPNU+egBT3ZXLPMtcFyUydMHg45vxvLgCxTO6tOL rcRSytnIi2h7B5T2wyfC5I9Auh78Ddh6HrSQmKmhzZIQDJrutpIy2jZUYBik+RHyIaYK CcVqaZk5xbiLuT8OI1dIX46Q3BmUOMnjq/Zp5j3ktqJCZDYhpZSYhQEymU+/R5tNVsvz GsSw== 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=WUlXUbQdrj2zN2x2QSDq9TzSC9U/EAD4vSnBXQIoxM8=; fh=WQskExECjOtS2oBrq9x2ue7OeVr6ye1r4N0aDOSz0G8=; b=0KpZDdSP6yU/BZpd9boM2EoH/ZCHgmPin4ZCS6z1PLKwNEmjz91Gq4x1rQrCjdasNN 5J+3Yhp1kr14fnsQcGw6t2HiWUV5ekCXnJX7kr4VwmUfIzLrUvcNVIu87+qO4ZPeEXLQ uPfB8GBG3FYvI0w0UcIA4F8CfNDarNT2oKXl52bXoCaQQvWIGOSilGvyxazWpqbO83+f eRC8Y/CaaIXXiH3K/JtWlPQG21flfaZtsFk3QEE2d0IVZPHgRJbQRNKx6DLNYVCDi4cl pmJY5ttAH/4rTmnyR3CDxe+P9lNZ2C9wpw5XzcbJVUoT0uY5CPJ0YhwjIFnVZAg5CQmk qnVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r77Z25BZ; 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 bm13-20020a05620a198d00b0077dc67402easi13653385qkb.338.2023.12.05.12.42.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Dec 2023 12:42:58 -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=r77Z25BZ; 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 1rAcEO-0007Sg-NB; Tue, 05 Dec 2023 15:41:24 -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 1rAcEG-0007Qz-Sw for qemu-devel@nongnu.org; Tue, 05 Dec 2023 15:41:16 -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 1rAcEF-0002Fg-4b for qemu-devel@nongnu.org; Tue, 05 Dec 2023 15:41:16 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-40c0a11a914so28309695e9.2 for ; Tue, 05 Dec 2023 12:41:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701808872; x=1702413672; 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=WUlXUbQdrj2zN2x2QSDq9TzSC9U/EAD4vSnBXQIoxM8=; b=r77Z25BZR/RG/lIOQIOMsUAymqpIYr6ziT1zA6OZEUrLkyiOYDPQ/QZgzoNXIEh/T6 6YdagoaDAabwxNBsxDzW4O37g4Q6Wew1PGOT5w61optK27JHr/jWPmgiXEXIANVL9oSA NGYHGpLE6x5BoBrmBZgrbgO6TC/RMR5GwZvYLeW3Heaq64+QYT/VY6sC68VNNQ2PvToR CXP9JsJnAubodX2eddVvDvL+30dbjJDlgN1ITSUKMA7wg6yvAs3Y+jKqgfVvIOnj7tHs TEfr3y9CcVAMOxiGdxkalU39Zi6aLOGb5bUwd0f2wwrjXcvTKtr80SKeoRy9yHhdOGxU I4JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701808872; x=1702413672; 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=WUlXUbQdrj2zN2x2QSDq9TzSC9U/EAD4vSnBXQIoxM8=; b=RrjivUoEpTxFjaedxKzx44pZcOFHBt3DBUTKJw6dnO4GCn2mCrY20d7qg2KqUW3v4l VDSMz0ugy0UPVqdd73Abhzm9yCJrFXiTNRG0NRnzcEXRKpClpld0L8Tg3muoQnNGRgUu BzNUqQdkN5qLeZODd6viuBzqkl3OKh3hirz0Q9Hb6OVGE6fKwvu70SLGdLLyjnIKGtgS clSmRlGVKsmQyfqx0l4tVET3bQD37cOVq1W4nLeE9qb72dsN3+YaZS3SO8+0zO9lPRGV O6L1VrfjQ5nDkLGSFVjsRz4dCJl6jf1xvRpLxDRO21YrBPLyUoUaqT5qMjzPmOIdK2WM 5kQw== X-Gm-Message-State: AOJu0YwxHKLF3Qg9Mm4OySJkqlpQcrj2i5X6AaBnTOQDfwbiEJPL74XL K/dS79QR674P6tz37lPhrgZXjw== X-Received: by 2002:a05:600c:3512:b0:40b:5e1e:b3b6 with SMTP id h18-20020a05600c351200b0040b5e1eb3b6mr975084wmq.52.1701808872704; Tue, 05 Dec 2023 12:41:12 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id i1-20020a05600c354100b0040588d85b3asm23273563wmq.15.2023.12.05.12.41.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 12:41:09 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 81A585FBC4; Tue, 5 Dec 2023 20:41:06 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Cleber Rosa , Beraldo Leal , Eduardo Habkost , Richard Henderson , Wainer dos Santos Moschetta , Paolo Bonzini , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Pavel Dovgalyuk , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 06/11] replay: add proper kdoc for ReplayState Date: Tue, 5 Dec 2023 20:41:01 +0000 Message-Id: <20231205204106.95531-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231205204106.95531-1-alex.bennee@linaro.org> References: <20231205204106.95531-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=alex.bennee@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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Remove the non-standard comment formatting and move the descriptions into a proper kdoc comment. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Pavel Dovgalyuk --- replay/replay-internal.h | 27 ++++++++++++++++---------- roms/SLOF | 2 +- tests/tcg/i386/Makefile.softmmu-target | 19 ++++++++++++++++++ 3 files changed, 37 insertions(+), 11 deletions(-) diff --git a/replay/replay-internal.h b/replay/replay-internal.h index 516147ddbc..98ca3748ed 100644 --- a/replay/replay-internal.h +++ b/replay/replay-internal.h @@ -63,24 +63,31 @@ enum ReplayEvents { EVENT_COUNT }; +/** + * typedef ReplayState - global tracking Replay state + * + * This structure tracks where we are in the current ReplayState + * including the logged events from the recorded replay stream. Some + * of the data is also stored/restored from VMStateDescription when VM + * save/restore events take place. + * + * @cached_clock: Cached clocks values + * @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 + * @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 + */ typedef struct ReplayState { - /*! Cached clock values. */ int64_t cached_clock[REPLAY_CLOCK_COUNT]; - /*! Current icount - number of processed instructions. */ uint64_t current_icount; - /*! Number of instructions to be executed before other events happen. */ int instruction_count; - /*! Type of the currently executed event. */ unsigned int data_kind; - /*! Flag which indicates that event is not processed yet. */ unsigned int has_unread_data; - /*! Temporary variable for saving current log offset. */ uint64_t file_offset; - /*! Next block operation id. - This counter is global, because requests from different - block devices should not get overlapping ids. */ uint64_t block_request_id; - /*! Asynchronous event id read from the log */ uint64_t read_event_id; } ReplayState; extern ReplayState replay_state; diff --git a/roms/SLOF b/roms/SLOF index 3a259df244..6b6c16b4b4 160000 --- a/roms/SLOF +++ b/roms/SLOF @@ -1 +1 @@ -Subproject commit 3a259df2449fc4a4e43ab5f33f0b2c66484b4bc3 +Subproject commit 6b6c16b4b40763507cf1f518096f3c3883c5cf2d diff --git a/tests/tcg/i386/Makefile.softmmu-target b/tests/tcg/i386/Makefile.softmmu-target index 5266f2335a..b9bef72dcf 100644 --- a/tests/tcg/i386/Makefile.softmmu-target +++ b/tests/tcg/i386/Makefile.softmmu-target @@ -33,5 +33,24 @@ EXTRA_RUNS+=$(MULTIARCH_RUNS) memory: CFLAGS+=-DCHECK_UNALIGNED=1 +# Simple Record/Replay Test +.PHONY: memory-record +run-memory-record: memory-record memory + $(call run-test, $<, \ + $(QEMU) -monitor none -display none \ + -chardev file$(COMMA)path=$<.out$(COMMA)id=output \ + -icount shift=5$(COMMA)rr=record$(COMMA)rrfile=record.bin \ + $(QEMU_OPTS) memory) + +.PHONY: memory-replay +run-memory-replay: memory-replay run-memory-record + $(call run-test, $<, \ + $(QEMU) -monitor none -display none \ + -chardev file$(COMMA)path=$<.out$(COMMA)id=output \ + -icount shift=5$(COMMA)rr=replay$(COMMA)rrfile=record.bin \ + $(QEMU_OPTS) memory) + +EXTRA_RUNS+=run-memory-replay + # Running QEMU_OPTS+=-device isa-debugcon,chardev=output -device isa-debug-exit,iobase=0xf4,iosize=0x4 -kernel