qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Thomas Huth <thuth@redhat.com>, Stefan Weil <sw@weilnetz.de>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Richard Henderson" <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH] tcg/tci: do not use ldst label (never implemented)
Date: Tue, 12 Sep 2017 17:13:56 +0200	[thread overview]
Message-ID: <2a90999d-6f79-cbd4-aaba-a6cd425980c6@redhat.com> (raw)
In-Reply-To: <abc99a4a-1386-2757-e605-f10d0afe6b3e@redhat.com>

On 12/09/2017 16:56, Thomas Huth wrote:
> The problem is that the SLOF firmware just performs very badly with TCG
> (it's fine on real hardware). It executes a lot of Forth code, and the
> Forth interpreter uses things like computed gotos or other tricks that
> basically prevent proper JIT operation here. I've done quite a bit of
> optimizations in SLOF in the past already, but I've got hardly any ideas
> left how to fix that further.

Two ideas for QEMU based on a quick "perf record" test:

- 25% of the time is spent in cpu_exec.  PPC doesn't use
tcg_gen_lookup_and_goto_ptr.  The main thing to be careful about is
that, whenever an interrupt is pending (e.g. after enabling them) you
need to force an exit to the loop.  See for example commits b29fd33db5
("target/arm: use DISAS_EXIT for eret handling", 2017-07-17) and
b74cddcbf6 ("target/mips: Use BS_EXCP where interrupts are expected",
2017-08-02).  On PPC this mostly means SPRs and env->msr writes.  Apart
from this, however, it shouldn't be hard to do.

- 8% of the time is spend in cpu_exec's call to
object_class_dynamic_cast_assert aka this line

    CPUClass *cc = CPU_GET_CLASS(cpu);

This maybe could avoid the dynamic cast.  But it's also possible that
fixing the first gets rid of this one too.

Thanks,

Paolo

  reply	other threads:[~2017-09-12 15:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-11  2:28 [Qemu-devel] [PATCH] tcg/tci: do not use ldst label (never implemented) Philippe Mathieu-Daudé
2017-09-11  5:18 ` Stefan Weil
2017-09-11 18:01 ` Richard Henderson
2017-09-11 18:24   ` Peter Maydell
2017-09-11 19:39     ` Stefan Weil
2017-09-11 19:47       ` Philippe Mathieu-Daudé
2017-09-11 19:54         ` Stefan Weil
2017-09-11 20:26     ` Stefan Weil
2017-09-11 21:06       ` Philippe Mathieu-Daudé
2017-09-12  8:52     ` Stefan Weil
2017-09-12  9:20       ` Stefan Weil
2017-09-12 14:56         ` Thomas Huth
2017-09-12 15:13           ` Paolo Bonzini [this message]
2017-09-21  9:59             ` Thomas Huth
2017-09-22 13:31               ` Richard Henderson
2017-09-11 18:13 ` Philippe Mathieu-Daudé
2017-09-11 18:14   ` Peter Maydell

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=2a90999d-6f79-cbd4-aaba-a6cd425980c6@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=rth@twiddle.net \
    --cc=sw@weilnetz.de \
    --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).