qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Mikhail Tyutin <m.tyutin@yadro.com>,
	"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: Wed, 15 Feb 2023 19:47:33 -1000	[thread overview]
Message-ID: <1a7bd72b-d369-38d1-cdf0-de6253945a5c@linaro.org> (raw)
In-Reply-To: <1a19cfd11fd94e658224144d94663330@yadro.com>

On 2/15/23 19:04, Mikhail Tyutin wrote:
>> 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.

What's all this got to do with preferring intel over at&t syntax?
I still think it's a generally useless switch.


r~


  reply	other threads:[~2023-02-16  5:48 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
2023-02-16  5:47       ` Richard Henderson [this message]
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=1a7bd72b-d369-38d1-cdf0-de6253945a5c@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=erdnaxe@crans.org \
    --cc=m.tyutin@yadro.com \
    --cc=ma.mandourr@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).