qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH 0/4] add hand-rolled fallback when capstone fails
@ 2018-08-08 12:39 Alex Bennée
  2018-08-08 12:39 ` [Qemu-devel] [RFC PATCH 1/4] scripts/decodetree.py: add a disassembly generator (HACK!) Alex Bennée
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Alex Bennée @ 2018-08-08 12:39 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm, richard.henderson, Alex Bennée

Hi,

While capstone is actively maintained it hasn't managed to keep up to
date with newer instructions as they have been added. While these
should eventually be supported we need something in the meantime.

This proof-of-concept series takes advantage of the fact we already
have a parser for SVE instructions. By tweaking the output of
decodetree.py a little we can generate something we can plug into the
assembly dump when capstone fails. Currently it is just the
instruction name (as encoded in sve.decode) but extending it to
include the parameters shouldn't be too hard.

The plumbing into disas is a little ugly and perhaps that can be
solved later with some re-factoring.

So what do you think? Worth pursing or adding to the pile of cute but
not ultimately mergable hacks?

Alex Bennée (4):
  scripts/decodetree.py: add a disassembly generator (HACK!)
  target/arm: move decoder helpers into header
  target/arm: add a fallback disassemble function
  disas: allow capstone to defer to a fallback function on failure

 disas.c                    | 30 +++++++++++++++++++++-
 include/disas/bfd.h        | 11 +++++++-
 scripts/decodetree.py      | 52 +++++++++++++++++++++++++++++++++-----
 target/arm/Makefile.objs   |  8 ++++++
 target/arm/cpu.c           |  4 +++
 target/arm/decoder.h       | 50 ++++++++++++++++++++++++++++++++++++
 target/arm/disassemble.c   | 22 ++++++++++++++++
 target/arm/internals.h     |  2 ++
 target/arm/translate-sve.c | 50 +-----------------------------------
 9 files changed, 172 insertions(+), 57 deletions(-)
 create mode 100644 target/arm/decoder.h
 create mode 100644 target/arm/disassemble.c

-- 
2.17.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-08-15 14:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-08 12:39 [Qemu-devel] [RFC PATCH 0/4] add hand-rolled fallback when capstone fails Alex Bennée
2018-08-08 12:39 ` [Qemu-devel] [RFC PATCH 1/4] scripts/decodetree.py: add a disassembly generator (HACK!) Alex Bennée
2018-08-10  3:32   ` Eduardo Habkost
2018-08-10  8:55     ` Alex Bennée
2018-08-10 12:21       ` Eduardo Habkost
2018-08-08 12:39 ` [Qemu-devel] [RFC PATCH 2/4] target/arm: move decoder helpers into header Alex Bennée
2018-08-08 12:39 ` [Qemu-devel] [RFC PATCH 3/4] target/arm: add a fallback disassemble function Alex Bennée
2018-08-08 12:39 ` [Qemu-devel] [RFC PATCH 4/4] disas: allow capstone to defer to a fallback function on failure Alex Bennée
2018-08-08 16:09   ` Alex Bennée
2018-08-15 10:15 ` [Qemu-devel] [RFC PATCH 0/4] add hand-rolled fallback when capstone fails no-reply

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).