qemu-discuss
[Top][All Lists]
Advanced

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

Re: qemu_plugin_insn_disas() versus -cpu


From: Alex Bennée
Subject: Re: qemu_plugin_insn_disas() versus -cpu
Date: Wed, 01 Apr 2020 09:06:39 +0100
User-agent: mu4e 1.3.10; emacs 28.0.50

Marc Hacin <address@hidden> writes:

> Le 31/03/2020 à 16:52, Peter Maydell a écrit :
>> On Tue, 31 Mar 2020 at 14:35, Marc Hacin <address@hidden> wrote:
>>> I am using qemu_plugin_insn_disas() in a TCG plugin.
>>> Some floating point instructions are properly translated to host code,
>>> as it works in the emulator, but are translated to ".byte " by
>>> qemu_plugin_insn_disas().
>>>
>>> It seems that the capstone library behind qemu_plugin_insn_disas does
>>> not support that PowerPC core.
>>>
>>> But as the emulator translates right the guest code, I wonder why
>>> capstone is required.
>> The code for emulation does "take these bytes, and generate
>> QEMU TCG intermediate representation opcodes that implement
>> the meaning of the insns". The code for disassembly does
>> "take these bytes, and generate a human-readable string".
>
> OK, seen from my couch I though it was nearly the same tasks.

FWIW I did write a RFC that re-purposed decodetree for this purpose a
few years ago:

  https://patchew.org/QEMU/address@hidden/

Not all our front ends are converted to using decodetree but for those
that do it was an idea...

>> Plus as a bonus, having the disassembly be from 3rd party code
>> means you don't get confused by having a bug in the translator
>> which mis-decodes something but looks correct in the dissasembly
>> because it has the identical bug.

Of course the above approach would still suffer from this problem.

-- 
Alex Bennée



reply via email to

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