qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 2/3] capstone: Enable disassembly for s390x


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 2/3] capstone: Enable disassembly for s390x
Date: Sat, 4 Jan 2020 12:26:49 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2

On 1/3/20 10:24 PM, Richard Henderson wrote:
Enable s390x, aka SYSZ, in the git submodule build.
Set the capstone parameters for both s390x host and guest.

Signed-off-by: Richard Henderson <address@hidden>

I'm fine with this patch because I don't use the s390 disas often.
For the S390 experts, my previous analysis is here:
https://www.mail-archive.com/address@hidden/msg667954.html

Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Philippe Mathieu-Daudé <address@hidden>

---
  Makefile           | 1 +
  disas.c            | 3 +++
  target/s390x/cpu.c | 4 ++++
  3 files changed, 8 insertions(+)

diff --git a/Makefile b/Makefile
index 12e129ac9d..df1c692ccd 100644
--- a/Makefile
+++ b/Makefile
@@ -504,6 +504,7 @@ CAP_CFLAGS += -DCAPSTONE_USE_SYS_DYN_MEM
  CAP_CFLAGS += -DCAPSTONE_HAS_ARM
  CAP_CFLAGS += -DCAPSTONE_HAS_ARM64
  CAP_CFLAGS += -DCAPSTONE_HAS_POWERPC
+CAP_CFLAGS += -DCAPSTONE_HAS_SYSZ
  CAP_CFLAGS += -DCAPSTONE_HAS_X86
.PHONY: capstone/all
diff --git a/disas.c b/disas.c
index 3937da6157..845c40fca8 100644
--- a/disas.c
+++ b/disas.c
@@ -660,6 +660,9 @@ void disas(FILE *out, void *code, unsigned long size)
      print_insn = print_insn_m68k;
  #elif defined(__s390__)
      print_insn = print_insn_s390;
+    s.info.cap_arch = CS_ARCH_SYSZ;
+    s.info.cap_insn_unit = 2;
+    s.info.cap_insn_split = 6;
  #elif defined(__hppa__)
      print_insn = print_insn_hppa;
  #endif
diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
index 625daeedd1..1734ad9c3a 100644
--- a/target/s390x/cpu.c
+++ b/target/s390x/cpu.c
@@ -43,6 +43,7 @@
  #include "sysemu/tcg.h"
  #endif
  #include "fpu/softfloat-helpers.h"
+#include "disas/capstone.h"
#define CR0_RESET 0xE0UL
  #define CR14_RESET      0xC2000000UL;
@@ -162,6 +163,9 @@ static void s390_cpu_disas_set_info(CPUState *cpu, 
disassemble_info *info)
  {
      info->mach = bfd_mach_s390_64;
      info->print_insn = print_insn_s390;
+    info->cap_arch = CS_ARCH_SYSZ;
+    info->cap_insn_unit = 2;
+    info->cap_insn_split = 6;
  }
static void s390_cpu_realizefn(DeviceState *dev, Error **errp)





reply via email to

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