qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Steffen Liebergeld <usenet@gmx.eu>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: branches are expensive
Date: Tue, 17 Mar 2009 12:31:24 +0000 (UTC)	[thread overview]
Message-ID: <gpo56s$o1f$1@ger.gmane.org> (raw)
In-Reply-To: 49BF8A5B.7070706@siemens.com

Hi,

Jan Kiszka <jan.kiszka@siemens.com> schrieb:
> Avi Kivity wrote:
>> Steffen Liebergeld wrote:
>>> Hi,
>>>
>>> while measuring the execution of an ARM guest, I encountered that
>>> branches are
>>> extremely expensive in terms of executed host instructions. A single ARM
>>> branch takes 148 to 152 host instructions. In my setup host and guest
>>> use the
>>> ARM instruction set architecture.
>>>
>>> My question is what makes branches so expensive? What code is run when
>>> executing a branch? Other instructions are translated to 14 to 40
>>> instructions.
>>>   
>> 
>> I'm no tcg guru, but if branches are not chained, you'd need an
>> expensive lookup to find the next translation block.  If branches are
>> chained they'll probably be much faster.
>
> That is probably the reason.
>
> You can check to generated host code and compare it to the guest code
> via -d in_asm,out_asm (or via the monitor: log in_asm,out_asm), logs
> will be written /tmp/qemu.log by default. The ratio of direct (chained)
> jumps is given via "info jit".

The radio is quite bad. Do you have any documentation on when Qemu does the
chaining and more important, when it does not. For example are unconditional
jumps always chained, or only in one direction (forward or backward).

Many thanks.
Steffen 

  reply	other threads:[~2009-03-17 12:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-17 11:05 [Qemu-devel] branches are expensive Steffen Liebergeld
2009-03-17 11:18 ` Avi Kivity
2009-03-17 11:32   ` [Qemu-devel] " Jan Kiszka
2009-03-17 12:31     ` Steffen Liebergeld [this message]
2009-03-17 12:51       ` Paul Brook
2009-03-17 13:24         ` Avi Kivity
2009-03-19 10:07         ` Steffen Liebergeld
2009-03-19 10:30           ` Laurent Desnogues
2009-03-19 10:39             ` Steffen Liebergeld
2009-03-19 11:06               ` Laurent Desnogues
2009-03-19 10:52           ` Avi Kivity
2009-03-19 11:34           ` Paul Brook
2009-03-17 11:36   ` Steffen Liebergeld
2009-03-17 13:30 ` [Qemu-devel] " Laurent Desnogues

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='gpo56s$o1f$1@ger.gmane.org' \
    --to=usenet@gmx.eu \
    --cc=qemu-devel@nongnu.org \
    /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).