qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Adding ability to change disassembler syntax in TCG plugins


From: Richard Henderson
Subject: Re: [PATCH] Adding ability to change disassembler syntax in TCG plugins
Date: Wed, 15 Feb 2023 19:47:33 -1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1

On 2/15/23 19:04, Mikhail Tyutin wrote:
On 2/15/23 18:17, Mikhail Tyutin wrote:
ping

patchew link:
7d17f0cbb5ed4c90bbadd3992429006f@yadro.com/">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 via email to

[Prev in Thread] Current Thread [Next in Thread]