From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1apzIm-00057r-IF for qemu-devel@nongnu.org; Tue, 12 Apr 2016 10:28:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1apzIf-0003AF-2m for qemu-devel@nongnu.org; Tue, 12 Apr 2016 10:28:20 -0400 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]:36472) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1apzIe-0003AB-MO for qemu-devel@nongnu.org; Tue, 12 Apr 2016 10:28:17 -0400 Received: by mail-wm0-x232.google.com with SMTP id v188so129529355wme.1 for ; Tue, 12 Apr 2016 07:28:16 -0700 (PDT) References: <1459870344-16773-1-git-send-email-alex.bennee@linaro.org> <1459870344-16773-9-git-send-email-alex.bennee@linaro.org> <570CF6BC.2030409@gmail.com> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <570CF6BC.2030409@gmail.com> Date: Tue, 12 Apr 2016 15:28:25 +0100 Message-ID: <87k2k2zyt2.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [RFC v2 08/11] tcg: add options for enabling MTTCG List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sergey Fedorov Cc: mttcg@listserver.greensocs.com, fred.konrad@greensocs.com, a.rigo@virtualopensystems.com, cota@braap.org, qemu-devel@nongnu.org, mark.burton@greensocs.com, pbonzini@redhat.com, jan.kiszka@siemens.com, rth@twiddle.net, peter.maydell@linaro.org, claudio.fontana@huawei.com, Peter Crosthwaite , Andreas =?utf-8?Q?F?= =?utf-8?Q?=C3=A4rber?= Sergey Fedorov writes: > On 05/04/16 18:32, Alex Bennée wrote: >> diff --git a/cpus.c b/cpus.c >> index 46732a5..8d27fb0 100644 >> --- a/cpus.c >> +++ b/cpus.c > > (snip) > >> @@ -146,6 +147,48 @@ typedef struct TimersState { >> } TimersState; >> >> static TimersState timers_state; >> +static bool mttcg_enabled; >> + >> +static QemuOptsList qemu_tcg_opts = { >> + .name = "tcg", >> + .head = QTAILQ_HEAD_INITIALIZER(qemu_tcg_opts.head), >> + .desc = { >> + { >> + .name = "mttcg", >> + .type = QEMU_OPT_BOOL, >> + .help = "Enable/disable multi-threaded TCG", >> + }, >> + { /* end of list */ } >> + }, >> +}; >> + >> +static void tcg_register_config(void) >> +{ >> + qemu_add_opts(&qemu_tcg_opts); >> +} >> + >> +opts_init(tcg_register_config); >> + >> +static bool default_mttcg_enabled(void) >> +{ >> + /* >> + * TODO: Check if we have a chance to have MTTCG working on this guest/host. >> + * Basically is the atomic instruction implemented? Is there any >> + * memory ordering issue? >> + */ > > I think this could be decided in configure/makefiles. I was think we might have other interactions, like if the user enabled replay/playback mode. There is also an argument that by having the logic in the code it's easier for developers to see the logic as people don't generally grok Makefiles. > >> + return false; >> +} >> + >> +void qemu_tcg_configure(QemuOpts *opts) >> +{ >> + mttcg_enabled = qemu_opt_get_bool(opts, "mttcg", default_mttcg_enabled()); >> +} >> + >> +bool qemu_tcg_mttcg_enabled(void) >> +{ >> + return mttcg_enabled; >> +} >> + >> >> int64_t cpu_get_icount_raw(void) >> { >> diff --git a/include/qom/cpu.h b/include/qom/cpu.h >> index 13eeaae..5e3826c 100644 >> --- a/include/qom/cpu.h >> +++ b/include/qom/cpu.h >> @@ -369,6 +369,20 @@ extern struct CPUTailQ cpus; >> extern __thread CPUState *current_cpu; >> >> /** >> + * qemu_tcg_enable_mttcg: >> + * Enable the MultiThread TCG support. >> + */ >> +void qemu_tcg_enable_mttcg(void); > > Seems to be an orphaned declaration. > > Kind regards, > Sergey -- Alex Bennée