From: Mikhail Tyutin <m.tyutin@yadro.com>
To: Richard Henderson <richard.henderson@linaro.org>,
"alex.bennee@linaro.org" <alex.bennee@linaro.org>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "pbonzini@redhat.com" <pbonzini@redhat.com>,
Aleksandr Anenkov <a.anenkov@yadro.com>
Subject: RE: [PATCH] Add support of callbacks after instructions to plugin api
Date: Tue, 8 Aug 2023 15:48:21 +0000 [thread overview]
Message-ID: <7561dee652b94712bfe73643d23ec345@yadro.com> (raw)
In-Reply-To: <2cdaf4c5-2151-0acf-8bc9-55ab719e874f@linaro.org>
> On 8/8/23 06:44, Mikhail Tyutin wrote:
> > Initially, we can only call the callback BEFORE instructions. This commit adds the ability to insert the callback AFTER instructions.
> >
> > No callback call for control-flow instructions.
>
> You're going to miss whole categories of instructions, not just control-flow. You're
> going to miss anything that raises an exception. The list goes on and on. This is why we
> didn't implement this "after" hook in the first place.
>
To be fair it works quite well for code translations in user-mode and baremetal applications. At least we can intercept a set of instructions that have registers as operands and even syscall-like instructions. Logically it had to work identically to memory 'store' callbacks, but we had to add a shortcut to fix problem when some of code translators inserts exit_tb operation explicitly. Maybe there is better way to do it.
We use such AFTER callback in plugins to capture CPU state changes in generic way (using registers API patch I posted earlier). Without it, BEFORE callback has to be added to 'current' and 'following' instructions to achieve the same effect. Having callbacks on different instructions adds complexity to the callbacks itself to performs state dumps at appropriate conditions (e.g. was 'previous' instruction the one we instrumented or it was some jump).
next prev parent reply other threads:[~2023-08-08 15:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-08 13:44 [PATCH] Add support of callbacks after instructions to plugin api Mikhail Tyutin
2023-08-08 14:47 ` Richard Henderson
2023-08-08 15:48 ` Mikhail Tyutin [this message]
2023-08-08 15:15 ` Alex Bennée
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=7561dee652b94712bfe73643d23ec345@yadro.com \
--to=m.tyutin@yadro.com \
--cc=a.anenkov@yadro.com \
--cc=alex.bennee@linaro.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.