qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [Qemu-devel] [PATCH] monitor: Check whether TCG is enabled before running the "info jit" code
Date: Wed, 26 Apr 2017 09:18:17 +0100	[thread overview]
Message-ID: <20170426081816.GA2098@work-vm> (raw)
In-Reply-To: <1493179907-22516-1-git-send-email-thuth@redhat.com>

* Thomas Huth (thuth@redhat.com) wrote:
> The "info jit" command currently aborts on Mac OS X with the message
> "qemu_mutex_lock: Invalid argument" when running with "-M accel=qtest".
> We should only call into the TCG code here if TCG has really been
> enabled and initialized.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  monitor.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/monitor.c b/monitor.c
> index be282ec..3e0979d 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -1086,6 +1086,11 @@ static void hmp_info_registers(Monitor *mon, const QDict *qdict)
>  
>  static void hmp_info_jit(Monitor *mon, const QDict *qdict)
>  {
> +    if (!tcg_enabled()) {
> +        error_report("JIT information is only available with accel=tcg");
> +        return;
> +    }
> +
>      dump_exec_info((FILE *)mon, monitor_fprintf);
>      dump_drift_info((FILE *)mon, monitor_fprintf);
>  }

so tcg_enabled checks tcg_ctx.code_gen_buffer != NULL
code_gen_buffer is set by code_gen_alloc
code_gen_alloc does a qemu_mutex_init of tb_lock
and the previous problem was an uninitialised tb_lock.

So:
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>


Peter: Does this fix the hmp test for you?

Dave

> -- 
> 1.8.3.1
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

  reply	other threads:[~2017-04-26  8:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-26  4:11 [Qemu-devel] [PATCH] monitor: Check whether TCG is enabled before running the "info jit" code Thomas Huth
2017-04-26  8:18 ` Dr. David Alan Gilbert [this message]
2017-04-26  9:21   ` Peter Maydell
2017-04-26  9:27     ` Dr. David Alan Gilbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170426081816.GA2098@work-vm \
    --to=dgilbert@redhat.com \
    --cc=armbru@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).