From patchwork Thu Jan 22 08:51:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Dovgalyuk X-Patchwork-Id: 431706 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4045414017A for ; Thu, 22 Jan 2015 19:52:25 +1100 (AEDT) Received: from localhost ([::1]:51716 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEDV1-00013w-Fh for incoming@patchwork.ozlabs.org; Thu, 22 Jan 2015 03:52:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEDUP-00007v-Aw for qemu-devel@nongnu.org; Thu, 22 Jan 2015 03:51:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEDUJ-0004uC-Ux for qemu-devel@nongnu.org; Thu, 22 Jan 2015 03:51:45 -0500 Received: from mail.ispras.ru ([83.149.199.45]:36278) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEDUJ-0004tk-Ic for qemu-devel@nongnu.org; Thu, 22 Jan 2015 03:51:39 -0500 Received: from PASHA-ISP.def.inno (unknown [85.142.117.224]) by mail.ispras.ru (Postfix) with ESMTPSA id AA3B754006F; Thu, 22 Jan 2015 11:51:38 +0300 (MSK) To: qemu-devel@nongnu.org From: Pavel Dovgalyuk Date: Thu, 22 Jan 2015 11:51:42 +0300 Message-ID: <20150122085142.5276.86603.stgit@PASHA-ISP.def.inno> In-Reply-To: <20150122085127.5276.53895.stgit@PASHA-ISP.def.inno> References: <20150122085127.5276.53895.stgit@PASHA-ISP.def.inno> User-Agent: StGit/0.16 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 83.149.199.45 Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, alex.bennee@linaro.org, mark.burton@greensocs.com, real@ispras.ru, batuzovk@ispras.ru, maria.klimushenkova@ispras.ru, pavel.dovgaluk@ispras.ru, pbonzini@redhat.com, afaerber@suse.de, fred.konrad@greensocs.com Subject: [Qemu-devel] [RFC PATCH v8 02/21] replay: global variables and function stubs X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This patch adds global variables, defines, functions declarations, and function stubs for deterministic VM replay used by external modules. Signed-off-by: Pavel Dovgalyuk Reviewed-by: Paolo Bonzini Reviewed-by: Eric Blake --- Makefile.target | 1 + qapi-schema.json | 18 ++++++++++++++++++ replay/Makefile.objs | 1 + replay/replay.c | 14 ++++++++++++++ replay/replay.h | 19 +++++++++++++++++++ stubs/Makefile.objs | 1 + stubs/replay.c | 3 +++ 7 files changed, 57 insertions(+), 0 deletions(-) create mode 100755 replay/Makefile.objs create mode 100755 replay/replay.c create mode 100755 replay/replay.h create mode 100755 stubs/replay.c diff --git a/Makefile.target b/Makefile.target index e9ff1ee..a45378f 100644 --- a/Makefile.target +++ b/Makefile.target @@ -83,6 +83,7 @@ all: $(PROGS) stap ######################################################### # cpu emulator library obj-y = exec.o translate-all.o cpu-exec.o +obj-y += replay/ obj-y += tcg/tcg.o tcg/optimize.o obj-$(CONFIG_TCG_INTERPRETER) += tci.o obj-$(CONFIG_TCG_INTERPRETER) += disas/tci.o diff --git a/qapi-schema.json b/qapi-schema.json index fbfc52f..7e3177f 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -3523,3 +3523,21 @@ # Since: 2.1 ## { 'command': 'rtc-reset-reinjection' } + +## +# ReplayMode: +# +# Mode of the replay subsystem. +# +# @none: normal execution mode. Replay or record are not enabled. +# +# @record: record mode. All non-deterministic data is written into the +# replay log. +# +# @play: replay mode. Non-deterministic data required for system execution +# is read from the log. +# +# Since: 2.3 +## +{ 'enum': 'ReplayMode', + 'data': [ 'none', 'record', 'play' ] } diff --git a/replay/Makefile.objs b/replay/Makefile.objs new file mode 100755 index 0000000..7ea860f --- /dev/null +++ b/replay/Makefile.objs @@ -0,0 +1 @@ +obj-y += replay.o diff --git a/replay/replay.c b/replay/replay.c new file mode 100755 index 0000000..5ce066f --- /dev/null +++ b/replay/replay.c @@ -0,0 +1,14 @@ +/* + * replay.c + * + * Copyright (c) 2010-2015 Institute for System Programming + * of the Russian Academy of Sciences. + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + */ + +#include "replay.h" + +ReplayMode replay_mode = REPLAY_MODE_NONE; diff --git a/replay/replay.h b/replay/replay.h new file mode 100755 index 0000000..d6b73c3 --- /dev/null +++ b/replay/replay.h @@ -0,0 +1,19 @@ +#ifndef REPLAY_H +#define REPLAY_H + +/* + * replay.h + * + * Copyright (c) 2010-2015 Institute for System Programming + * of the Russian Academy of Sciences. + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + */ + +#include "qapi-types.h" + +extern ReplayMode replay_mode; + +#endif diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs index 5e347d0..45a6c71 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -27,6 +27,7 @@ stub-obj-y += notify-event.o stub-obj-y += pci-drive-hot-add.o stub-obj-$(CONFIG_SPICE) += qemu-chr-open-spice.o stub-obj-y += qtest.o +stub-obj-y += replay.o stub-obj-y += reset.o stub-obj-y += runstate-check.o stub-obj-y += set-fd-handler.o diff --git a/stubs/replay.c b/stubs/replay.c new file mode 100755 index 0000000..563c777 --- /dev/null +++ b/stubs/replay.c @@ -0,0 +1,3 @@ +#include "replay/replay.h" + +ReplayMode replay_mode;