From: Mikhail Tyutin <m.tyutin@yadro.com>
To: Richard Henderson <richard.henderson@linaro.org>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"alex.bennee@linaro.org" <alex.bennee@linaro.org>
Cc: "erdnaxe@crans.org" <erdnaxe@crans.org>,
"ma.mandourr@gmail.com" <ma.mandourr@gmail.com>
Subject: RE: [PATCH] Adding ability to change disassembler syntax in TCG plugins
Date: Thu, 16 Feb 2023 05:04:14 +0000 [thread overview]
Message-ID: <1a19cfd11fd94e658224144d94663330@yadro.com> (raw)
In-Reply-To: <4d474968-dce8-0d69-3e52-2c42a6398e4c@linaro.org>
> On 2/15/23 18:17, Mikhail Tyutin wrote:
> > ping
> >
> > patchew link:
> > https://patchew.org/QEMU/7d17f0cbb5ed4c90bbadd3992429006f@yadro.com/
> >
> > 10.02.2023 18:24, Mikhail Tyutin wrote:
> >> This patch adds new function qemu_plugin_insn_disas_with_syntax() that allows TCG
> >> plugins to get disassembler string with non-default syntax if it wants to.
> >>
> >> Signed-off-by: Mikhail Tyutin <m.tyutin@yadro.com>
>
> Why?
>
> It's certainly not very generic, exposing a disassembly quirk for exactly one guest
> architecture. I mean, you could just as easily link your plugin directly to libcapstone
> via qemu_plugin_insn_data().
>
>
> r~
I agree it can be done outside of Qemu using another disassembler library. However,
there are few reasons to do it in Qemu from architecture standpoint:
1. To have a single place of instruction decoding logic. TCG has to decode guest instructions
anyway. If plugins add another decoder, it causes double work and prone to errors (however
current implementation does double decode work anyway). For example, TCG might support
new instruction which is not available in external decoder yet.
2. Under the hood Qemu uses different implementations of decoder (in addition to capstone)
which is not exposed in public interface. If there is a need to configure its output, proposed
API allows that as well.
3. If multiple plugins want to use another disassembler syntax, they have to share
implementation as utility function.
next prev parent reply other threads:[~2023-02-16 5:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-10 15:24 [PATCH] Adding ability to change disassembler syntax in TCG plugins Mikhail Tyutin
2023-02-16 4:17 ` Mikhail Tyutin
2023-02-16 4:24 ` Richard Henderson
2023-02-16 5:04 ` Mikhail Tyutin [this message]
2023-02-16 5:47 ` Richard Henderson
2023-02-16 5:57 ` Mikhail Tyutin
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=1a19cfd11fd94e658224144d94663330@yadro.com \
--to=m.tyutin@yadro.com \
--cc=alex.bennee@linaro.org \
--cc=erdnaxe@crans.org \
--cc=ma.mandourr@gmail.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 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).