qemu-arm
[Top][All Lists]
Advanced

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

Re: [Qemu-arm] [Qemu-devel] [PATCH 00/10] Support the Capstone disassemb


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-arm] [Qemu-devel] [PATCH 00/10] Support the Capstone disassembler
Date: Fri, 15 Sep 2017 01:53:43 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

On 09/14/2017 03:35 PM, Richard Henderson wrote:
As occasionally discussed on this list, due to licensing conflicts,
we are restricted to a version of libopcodes that pre-dates its
upstream re-licensing to gplv3.  That makes our copy rather old
and dated.

I've already seen this as problematic for s390x guest.  I'm sure
the same problem exists for Power8+, though I haven't looked.
As we go forward with vector operations we'll see this for x86 host.

An alternative is to use a BSD-licensed disassembler:

   https://www.capstone-engine.org/

This is an actively maintained project derived from llvm.  Moreover,
it is already in the major Linux distributions, which makes it easy
to phase in its use.

I've arranged the code such that we attempt to use capstone first,
and if that initialization fails, fall back to the existing code
from binutils.


r~


Richard Henderson (10):
   target/i386: Convert to disas_set_info hook
   target/ppc: Convert to disas_set_info hook
   disas: Remove unused flags arguments
   disas: Support the Capstone disassembler library
   target/i386: Support Capstone in disas_set_info
   target/arm: Support Capstone in disas_set_info
   target/ppc: Support Capstone in disas_set_info
   target/s390x: Support Capstone in disas_set_info
   target/sparc: Support Capstone in disas_set_info
   target/mips: Support Capstone in disas_set_info

At least this msg disappeared:

"Disassembler disagrees with translator over instruction decoding"

i386 comparison:

 ----------------
 IN:
 0xfffffc30:  cli
-0xfffffc31:  mov    %eax,%ebp
-0xfffffc34:  mov    $0x1,%al
-0xfffffc36:  out    %al,$0x80
-0xfffffc38:  xor    %eax,%eax
+0xfffffc31:  movl         %eax, %ebp
+0xfffffc34:  movb         $1, %al
+0xfffffc36:  outb         %al, $0x80
+0xfffffc38:  xorl         %eax, %eax

 IN:
 0x000fd5b8:  cli
 0x000fd5b9:  cld
-0x000fd5ba:  push   %ds
-0x000fd5bb:  push   %eax
+0x000fd5ba:  pushw        %ds
+0x000fd5bb:  pushl        %eax
-0x000fd5bd:  mov    $0xe000,%eax
-0x000fd5c3:  mov    %ax,%ds
-0x000fd5c5:  mov    0xf2f8,%eax
+0x000fd5bd:  movl         $0xe000, %eax
+0x000fd5c3:  movw         %ax, %ds
+0x000fd5c5:  movl         0xf2f8, %eax
+0x000fd5c9:  subl         $0x28, %eax
-0x000fd5c9:  sub    $0x28,%eax
+0x000fd5cd:  popl         0x1c(%eax)
+0x000fd5d2:  popw         (%eax)
-0x000fd5cd:  addr32 popl 0x1c(%eax)
-0x000fd5d2:  addr32 popw (%eax)

For i386, arm, mips32/64:
Tested-by: Philippe Mathieu-Daudé <address@hidden>

This series but patch 4/10:
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>

Regards,

Phil.



reply via email to

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