qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: 阮安邦 <anbang.ruan@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] cpu_exit every time for a jump tb (containing only the "b" instruction)
Date: Mon, 6 Jul 2009 11:40:42 +0800	[thread overview]
Message-ID: <488ae4ca0907052040u6b0ac7cdg8a45d50e559c1e97@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1350 bytes --]

Hi, list

       I am currently profiling qemu-system-arm. I wrote a simple ARM
assembly only to add r0 infinitely:

 *   add_nums:
            add r0, r0, r1
            b add_nums*

       I forced a tb to contain only one instruction, and I got cpu_exit
every time the tb for "*b add_nums"* was executed. It exited the cpu_exec
loop every time, and then reentered it and executed it without cpu_exit.

       Following are the executing sequences. I dumped the "in_asm" for a tb
every time it was executed. And wrapped the *tcg_qemu_tb_exec*() with
qemu_log().


*IN:
0x8001000c:  b    0x80010008

before tcg_qemu_tb_exec
cpu_exit
after tcg_qemu_tb_exec*


*IN:
0x8001000c:  b    0x80010008

before tcg_qemu_tb_exec
after tcg_qemu_tb_exec

IN:
0x80010008:  add    r0, r0, r1

before tcg_qemu_tb_exec
after tcg_qemu_tb_exec


IN:
0x8001000c:  b    0x80010008

before tcg_qemu_tb_exec
cpu_exit
after tcg_qemu_tb_exec

*
      It seems like the cpu_exit was called when * tcg_qemu_tb_exec *was
executing. However,  * tcg_qemu_tb_exec* is only to execute the translated
native code (am i right?), how can it call the qemu func (cpu_exit)? Or it
is called by other func executing simultaneously with  * tcg_qemu_tb_exec*?*
* And why cpu_exit is called everytime, it really comsumes lots of ticks.~

      Any suggestions? Great thanks!


Regards,
Ryan

[-- Attachment #2: Type: text/html, Size: 1669 bytes --]

                 reply	other threads:[~2009-07-06  3:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=488ae4ca0907052040u6b0ac7cdg8a45d50e559c1e97@mail.gmail.com \
    --to=anbang.ruan@gmail.com \
    --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).