qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "felix.matenaar@rwth-aachen" <felix.matenaar@rwth-aachen.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] BBL execution hooking
Date: Wed, 23 Mar 2011 03:44:53 +0100	[thread overview]
Message-ID: <4D895EA5.6030302@rwth-aachen.de> (raw)

Hello everyone,

I started implementing BBL execution hooking. Requirements were that two
callbacks (bbl_start and bbl_stop) are called when a BBL is executed.
Since bbl_start is called through a gen_helper in
gen_intermediate_code_internal, that is not a problem.

But I saw that modifying gen_eob() so that gen_helper_bbl_stop() is
called does not trigger all ends of a BBL.

Some sample output:

BBL start at 0x1002a12
BBL stop with 5 instructions
BBL start at 0x1002a1b
BBL start at 0x10029b3
BBL start at 0x10029cc
BBL start at 0x10029e4
BBL stop with 4 instructions


here you see that on the first and the last BBL the stop callback is
called properly but not for the other three.
Disassembly:

 1002a1b:   85 c0                   test   %eax,%eax
 1002a1d:   75 94                   jne    0x10029b3

 10029b3:   83 7d e4 50         cmpl   $0x50,-0x1c(%ebp)
 10029b7:   75 13                   jne    0x10029cc

 10029cc:   a1 3c 98 00 01     mov    0x100983c,%eax
 10029d1:   3b c6                   cmp    %esi,%eax
 10029d3:   74 0f                    je     0x10029e4

The two working BBLs end up in a call instruction. Is gen_eob() not used
on conditional jump instructions? Since I were not able to find how you
handle je/jne my question is where you handle that.

Regards,
    Felix

                 reply	other threads:[~2011-03-23  2:44 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=4D895EA5.6030302@rwth-aachen.de \
    --to=felix.matenaar@rwth-aachen.de \
    --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).