mbox series

[RFC,0/3] Remove some of the old libopcode based disassemblers

Message ID 20220412165836.355850-1-thuth@redhat.com (mailing list archive)
Headers show
Series Remove some of the old libopcode based disassemblers | expand

Message

Thomas Huth April 12, 2022, 4:58 p.m. UTC
Many of the disassemblers in the disas folder are based on old
versions from the GNU tools (libopcode, GDB, ...) that were still
licensed under the GPL v2. The GNU tools switched to GPL v3 at one
point in time, so QEMU is stuck with the old versions, i.e. these
files did not see much updates for new processors anymore. But
for most architectures, we're preferring the Capstone disassembler
now anyway, so the old libopcode disassemblers are also hardly
used anymore.

I'm not 100% sure (thus this is marked as RFC), but I think we could
simply drop the old disassemblers nowadays, and hardly anybody would
miss them, since we now always embed capstone as a submodule anyway.
Or is there still an advantage in keeping these old files around?

This RFC series tackles with s390, arm (32-bit) and i386 ... I wanted
to get some feedback first, but if we agree that these can be removed,
the sparc, mips and ppc disassemblers likely can be removed, too.
(I think we should keep m68k.c since Capstone does not have support
for Coldfire CPUs yet).

Thomas Huth (3):
  disas: Remove old libopcode s390 disassembler
  disas: Remove old libopcode arm disassembler
  disas: Remove old libopcode i386 disassembler

 include/disas/dis-asm.h |    3 -
 disas.c                 |    3 -
 disas/arm.c             | 4012 -----------------------
 disas/i386.c            | 6771 ---------------------------------------
 disas/s390.c            | 1892 -----------
 target/arm/cpu.c        |    8 -
 target/i386/cpu.c       |    1 -
 target/s390x/cpu.c      |    1 -
 MAINTAINERS             |    6 -
 disas/meson.build       |    3 -
 10 files changed, 12700 deletions(-)
 delete mode 100644 disas/arm.c
 delete mode 100644 disas/i386.c
 delete mode 100644 disas/s390.c

Comments

Richard Henderson April 21, 2022, 6:35 p.m. UTC | #1
On 4/12/22 09:58, Thomas Huth wrote:
> Many of the disassemblers in the disas folder are based on old
> versions from the GNU tools (libopcode, GDB, ...) that were still
> licensed under the GPL v2. The GNU tools switched to GPL v3 at one
> point in time, so QEMU is stuck with the old versions, i.e. these
> files did not see much updates for new processors anymore. But
> for most architectures, we're preferring the Capstone disassembler
> now anyway, so the old libopcode disassemblers are also hardly
> used anymore.
> 
> I'm not 100% sure (thus this is marked as RFC), but I think we could
> simply drop the old disassemblers nowadays, and hardly anybody would
> miss them, since we now always embed capstone as a submodule anyway.
> Or is there still an advantage in keeping these old files around?
> 
> This RFC series tackles with s390, arm (32-bit) and i386 ... I wanted
> to get some feedback first, but if we agree that these can be removed,
> the sparc, mips and ppc disassemblers likely can be removed, too.
> (I think we should keep m68k.c since Capstone does not have support
> for Coldfire CPUs yet).
> 
> Thomas Huth (3):
>    disas: Remove old libopcode s390 disassembler
>    disas: Remove old libopcode arm disassembler
>    disas: Remove old libopcode i386 disassembler
> 

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
Philippe Mathieu-Daudé May 9, 2022, 12:20 p.m. UTC | #2
On 12/4/22 18:58, Thomas Huth wrote:
> Many of the disassemblers in the disas folder are based on old
> versions from the GNU tools (libopcode, GDB, ...) that were still
> licensed under the GPL v2. The GNU tools switched to GPL v3 at one
> point in time, so QEMU is stuck with the old versions, i.e. these
> files did not see much updates for new processors anymore. But
> for most architectures, we're preferring the Capstone disassembler
> now anyway, so the old libopcode disassemblers are also hardly
> used anymore.
> 
> I'm not 100% sure (thus this is marked as RFC), but I think we could
> simply drop the old disassemblers nowadays, and hardly anybody would
> miss them, since we now always embed capstone as a submodule anyway.
> Or is there still an advantage in keeping these old files around?
> 
> This RFC series tackles with s390, arm (32-bit) and i386 ... I wanted
> to get some feedback first, but if we agree that these can be removed,
> the sparc, mips and ppc disassemblers likely can be removed, too.
> (I think we should keep m68k.c since Capstone does not have support
> for Coldfire CPUs yet).
> 
> Thomas Huth (3):
>    disas: Remove old libopcode s390 disassembler
>    disas: Remove old libopcode arm disassembler
>    disas: Remove old libopcode i386 disassembler

>   disas/arm.c             | 4012 -----------------------
>   disas/i386.c            | 6771 ---------------------------------------
>   disas/s390.c            | 1892 -----------

>   10 files changed, 12700 deletions(-)

o_O Nice!

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Thomas Huth May 9, 2022, 1:18 p.m. UTC | #3
On 09/05/2022 14.20, Philippe Mathieu-Daudé wrote:
> On 12/4/22 18:58, Thomas Huth wrote:
>> Many of the disassemblers in the disas folder are based on old
>> versions from the GNU tools (libopcode, GDB, ...) that were still
>> licensed under the GPL v2. The GNU tools switched to GPL v3 at one
>> point in time, so QEMU is stuck with the old versions, i.e. these
>> files did not see much updates for new processors anymore. But
>> for most architectures, we're preferring the Capstone disassembler
>> now anyway, so the old libopcode disassemblers are also hardly
>> used anymore.
>>
>> I'm not 100% sure (thus this is marked as RFC), but I think we could
>> simply drop the old disassemblers nowadays, and hardly anybody would
>> miss them, since we now always embed capstone as a submodule anyway.
>> Or is there still an advantage in keeping these old files around?
>>
>> This RFC series tackles with s390, arm (32-bit) and i386 ... I wanted
>> to get some feedback first, but if we agree that these can be removed,
>> the sparc, mips and ppc disassemblers likely can be removed, too.
>> (I think we should keep m68k.c since Capstone does not have support
>> for Coldfire CPUs yet).
>>
>> Thomas Huth (3):
>>    disas: Remove old libopcode s390 disassembler
>>    disas: Remove old libopcode arm disassembler
>>    disas: Remove old libopcode i386 disassembler
> 
>>   disas/arm.c             | 4012 -----------------------
>>   disas/i386.c            | 6771 ---------------------------------------
>>   disas/s390.c            | 1892 -----------
> 
>>   10 files changed, 12700 deletions(-)
> 
> o_O Nice!
> 
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Thanks, just a little bit too late - it's in my current pull request already :-)

By the way, what about MIPS? Could MIPS be switched to Capstone, too, so 
that we could finally remove disas/mips.c ? (We're not using capstone there 
yet, and MIPS has so many flavours, big and little endian, 32- and 64-bit 
... so that I'm unsure whether there was a reason for not using Capstone 
there, or whether it just hasn't been tried out yet?)

  Thomas
Philippe Mathieu-Daudé May 9, 2022, 1:42 p.m. UTC | #4
On 9/5/22 15:18, Thomas Huth wrote:
> On 09/05/2022 14.20, Philippe Mathieu-Daudé wrote:
>> On 12/4/22 18:58, Thomas Huth wrote:
>>> Many of the disassemblers in the disas folder are based on old
>>> versions from the GNU tools (libopcode, GDB, ...) that were still
>>> licensed under the GPL v2. The GNU tools switched to GPL v3 at one
>>> point in time, so QEMU is stuck with the old versions, i.e. these
>>> files did not see much updates for new processors anymore. But
>>> for most architectures, we're preferring the Capstone disassembler
>>> now anyway, so the old libopcode disassemblers are also hardly
>>> used anymore.
>>>
>>> I'm not 100% sure (thus this is marked as RFC), but I think we could
>>> simply drop the old disassemblers nowadays, and hardly anybody would
>>> miss them, since we now always embed capstone as a submodule anyway.
>>> Or is there still an advantage in keeping these old files around?
>>>
>>> This RFC series tackles with s390, arm (32-bit) and i386 ... I wanted
>>> to get some feedback first, but if we agree that these can be removed,
>>> the sparc, mips and ppc disassemblers likely can be removed, too.
>>> (I think we should keep m68k.c since Capstone does not have support
>>> for Coldfire CPUs yet).
>>>
>>> Thomas Huth (3):
>>>    disas: Remove old libopcode s390 disassembler
>>>    disas: Remove old libopcode arm disassembler
>>>    disas: Remove old libopcode i386 disassembler
>>
>>>   disas/arm.c             | 4012 -----------------------
>>>   disas/i386.c            | 6771 ---------------------------------------
>>>   disas/s390.c            | 1892 -----------
>>
>>>   10 files changed, 12700 deletions(-)
>>
>> o_O Nice!
>>
>> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> 
> Thanks, just a little bit too late - it's in my current pull request 
> already :-)

NP, trying to catch up.

> By the way, what about MIPS? Could MIPS be switched to Capstone, too, so 
> that we could finally remove disas/mips.c ? (We're not using capstone 
> there yet, and MIPS has so many flavours, big and little endian, 32- and 
> 64-bit ... so that I'm unsure whether there was a reason for not using 
> Capstone there, or whether it just hasn't been tried out yet?)

Last I remember is Richard saying "the capstone backend for mips is not
in terribly good shape":
https://lore.kernel.org/qemu-devel/0c7827df-c9d4-8dad-a38c-4881ce7dd22b@linaro.org/

My long-term hope is to switch to decodetree.
Thomas Huth May 17, 2022, 7:18 a.m. UTC | #5
On 09/05/2022 15.42, Philippe Mathieu-Daudé wrote:
> On 9/5/22 15:18, Thomas Huth wrote:
[...]
>> By the way, what about MIPS? Could MIPS be switched to Capstone, too, so 
>> that we could finally remove disas/mips.c ? (We're not using capstone 
>> there yet, and MIPS has so many flavours, big and little endian, 32- and 
>> 64-bit ... so that I'm unsure whether there was a reason for not using 
>> Capstone there, or whether it just hasn't been tried out yet?)
> 
> Last I remember is Richard saying "the capstone backend for mips is not
> in terribly good shape":
> https://lore.kernel.org/qemu-devel/0c7827df-c9d4-8dad-a38c-4881ce7dd22b@linaro.org/ 

That was in 2017, in the Capstone 3.x days ... maybe the situation has 
improved nowadays?

  Thomas
Richard Henderson May 17, 2022, 4:15 p.m. UTC | #6
On 5/17/22 00:18, Thomas Huth wrote:
> On 09/05/2022 15.42, Philippe Mathieu-Daudé wrote:
>> On 9/5/22 15:18, Thomas Huth wrote:
> [...]
>>> By the way, what about MIPS? Could MIPS be switched to Capstone, too, so that we could 
>>> finally remove disas/mips.c ? (We're not using capstone there yet, and MIPS has so many 
>>> flavours, big and little endian, 32- and 64-bit ... so that I'm unsure whether there 
>>> was a reason for not using Capstone there, or whether it just hasn't been tried out yet?)
>>
>> Last I remember is Richard saying "the capstone backend for mips is not
>> in terribly good shape":
>> https://lore.kernel.org/qemu-devel/0c7827df-c9d4-8dad-a38c-4881ce7dd22b@linaro.org/ 
> 
> That was in 2017, in the Capstone 3.x days ... maybe the situation has improved nowadays?

I don't see any substantive changes to the capstone mips backend since 2016.  Almost all 
changes to arch/Mips since then are changes to function prototypes as the internal api 
evolves.  I.e. just enough to keep it compiling.


r~