All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/2] Update capstone module
@ 2019-05-23 20:49 Richard Henderson
  2019-05-23 20:49 ` [Qemu-devel] [PATCH v2 1/2] capstone: Update to master Richard Henderson
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Richard Henderson @ 2019-05-23 20:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee, david

There has recently been some good progress in the upstream
capstone repository, syncing the instruction sets from the
(further) upstream llvm.

In particular, there are Power9 and System z13 instructions.
Both of which were missing from our current snapshot and from
our (ancient) binutils opcodes snapshots.

Changes for v2:
  * Drop the installed directory change.  This does force a
    different include change when building from git.
  * Drop the s390 skipdata callback for now.


r~


Richard Henderson (2):
  capstone: Update to master
  capstone: Enable disassembly for s390x

 Makefile           | 1 +
 disas.c            | 3 +++
 target/s390x/cpu.c | 4 ++++
 capstone           | 2 +-
 configure          | 2 +-
 5 files changed, 10 insertions(+), 2 deletions(-)

-- 
2.17.1



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

* [Qemu-devel] [PATCH v2 1/2] capstone: Update to master
  2019-05-23 20:49 [Qemu-devel] [PATCH v2 0/2] Update capstone module Richard Henderson
@ 2019-05-23 20:49 ` Richard Henderson
  2019-05-23 20:49 ` [Qemu-devel] [PATCH v2 2/2] capstone: Enable disassembly for s390x Richard Henderson
       [not found] ` <155865586800.24.17673050455759130330@549697c9ad12>
  2 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2019-05-23 20:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee, david

Update to fbb20ea83c5a.  Choose this over the 4.0.1 tag because
master now includes the s390x z13 vector opcodes.

Acked-by: David Hildenbrand <david@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 capstone  | 2 +-
 configure | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/capstone b/capstone
index 22ead3e0bf..fbb20ea83c 160000
--- a/capstone
+++ b/capstone
@@ -1 +1 @@
-Subproject commit 22ead3e0bfdb87516656453336160e0a37b066bf
+Subproject commit fbb20ea83c5af4f29b40c17fbadb1f71b0a08fae
diff --git a/configure b/configure
index 528b9ff705..d3cbdd595c 100755
--- a/configure
+++ b/configure
@@ -5022,7 +5022,7 @@ case "$capstone" in
       git_submodules="${git_submodules} capstone"
     fi
     mkdir -p capstone
-    QEMU_CFLAGS="$QEMU_CFLAGS -I\$(SRC_PATH)/capstone/include"
+    QEMU_CFLAGS="$QEMU_CFLAGS -I\$(SRC_PATH)/capstone/include/capstone"
     if test "$mingw32" = "yes"; then
       LIBCAPSTONE=capstone.lib
     else
-- 
2.17.1



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

* [Qemu-devel] [PATCH v2 2/2] capstone: Enable disassembly for s390x
  2019-05-23 20:49 [Qemu-devel] [PATCH v2 0/2] Update capstone module Richard Henderson
  2019-05-23 20:49 ` [Qemu-devel] [PATCH v2 1/2] capstone: Update to master Richard Henderson
@ 2019-05-23 20:49 ` Richard Henderson
       [not found] ` <155865586800.24.17673050455759130330@549697c9ad12>
  2 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2019-05-23 20:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee, david

Enable s390x, aka SYSZ, in the git submodule build.
Set the capstone parameters for both s390x host and guest.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 Makefile           | 1 +
 disas.c            | 3 +++
 target/s390x/cpu.c | 4 ++++
 3 files changed, 8 insertions(+)

diff --git a/Makefile b/Makefile
index e02b88bcb1..3b49eed664 100644
--- a/Makefile
+++ b/Makefile
@@ -478,6 +478,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
 
 subdir-capstone: .git-submodule-status
diff --git a/disas.c b/disas.c
index 41ad0102e2..4a63586af0 100644
--- a/disas.c
+++ b/disas.c
@@ -551,6 +551,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 b1df63d82c..553571d86b 100644
--- a/target/s390x/cpu.c
+++ b/target/s390x/cpu.c
@@ -41,6 +41,7 @@
 #include "sysemu/sysemu.h"
 #endif
 #include "fpu/softfloat.h"
+#include "disas/capstone.h"
 
 #define CR0_RESET       0xE0UL
 #define CR14_RESET      0xC2000000UL;
@@ -175,6 +176,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)
-- 
2.17.1



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

* Re: [Qemu-devel] [PATCH v2 0/2] Update capstone module
       [not found] ` <155865586800.24.17673050455759130330@549697c9ad12>
@ 2019-05-31  8:20   ` Alex Bennée
  2019-05-31  8:46     ` Richard Henderson
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Bennée @ 2019-05-31  8:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: richard.henderson, david


no-reply@patchew.org writes:

> Patchew URL: https://patchew.org/QEMU/20190523204954.13122-1-richard.henderson@linaro.org/
>
>
>
> Hi,
>
> This series failed build test on s390x host. Please find the details below.
>
> === TEST SCRIPT BEGIN ===
> #!/bin/bash
> # Testing script will be invoked under the git checkout with
> # HEAD pointing to a commit that has the patches applied on top of "base"
> # branch
> set -e
> CC=$HOME/bin/cc
> INSTALL=$PWD/install
> BUILD=$PWD/build
> mkdir -p $BUILD $INSTALL
> SRC=$PWD
> cd $BUILD
> $SRC/configure --cc=$CC --prefix=$INSTALL
> make -j4
> # XXX: we need reliable clean up
> # make check -j4 V=1
> make install
>
> echo
> echo "=== ENV ==="
> env
>
> echo
> echo "=== PACKAGES ==="
> rpm -qa
> === TEST SCRIPT END ===
>
>   GEN     ui/input-keymap-qcode-to-atset1.c
>   CC      cs.o
>   CC      utils.o
> cs.c:17:10: fatal error: capstone/capstone.h: No such file or directory
>    17 | #include <capstone/capstone.h>
>       |          ^~~~~~~~~~~~~~~~~~~~~
> compilation terminated.
> ---
>   CC      /var/tmp/patchew-tester-tmp-c6t41dq_/src/build/slirp/src/socket.o
> In file included from utils.h:13,
>                  from utils.c:12:
> cs_priv.h:7:10: fatal error: capstone/capstone.h: No such file or directory
>     7 | #include <capstone/capstone.h>
>       |          ^~~~~~~~~~~~~~~~~~~~~
> compilation terminated.
>
>
> The full log is available at
> http://patchew.org/logs/20190523204954.13122-1-richard.henderson@linaro.org/testing.s390x/?type=message.

I saw this on my laptop (which doesn't have system capstone installed)
as well. Did I imagine there was a patch floating around to deal with
the captone/capstone inconsistency?

--
Alex Bennée


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

* Re: [Qemu-devel] [PATCH v2 0/2] Update capstone module
  2019-05-31  8:20   ` [Qemu-devel] [PATCH v2 0/2] Update capstone module Alex Bennée
@ 2019-05-31  8:46     ` Richard Henderson
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2019-05-31  8:46 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel; +Cc: david

On 5/31/19 3:20 AM, Alex Bennée wrote:
> 
> no-reply@patchew.org writes:
> 
>> Patchew URL: https://patchew.org/QEMU/20190523204954.13122-1-richard.henderson@linaro.org/
>>
>>
>>
>> Hi,
>>
>> This series failed build test on s390x host. Please find the details below.
>>
>> === TEST SCRIPT BEGIN ===
>> #!/bin/bash
>> # Testing script will be invoked under the git checkout with
>> # HEAD pointing to a commit that has the patches applied on top of "base"
>> # branch
>> set -e
>> CC=$HOME/bin/cc
>> INSTALL=$PWD/install
>> BUILD=$PWD/build
>> mkdir -p $BUILD $INSTALL
>> SRC=$PWD
>> cd $BUILD
>> $SRC/configure --cc=$CC --prefix=$INSTALL
>> make -j4
>> # XXX: we need reliable clean up
>> # make check -j4 V=1
>> make install
>>
>> echo
>> echo "=== ENV ==="
>> env
>>
>> echo
>> echo "=== PACKAGES ==="
>> rpm -qa
>> === TEST SCRIPT END ===
>>
>>   GEN     ui/input-keymap-qcode-to-atset1.c
>>   CC      cs.o
>>   CC      utils.o
>> cs.c:17:10: fatal error: capstone/capstone.h: No such file or directory
>>    17 | #include <capstone/capstone.h>
>>       |          ^~~~~~~~~~~~~~~~~~~~~
>> compilation terminated.
>> ---
>>   CC      /var/tmp/patchew-tester-tmp-c6t41dq_/src/build/slirp/src/socket.o
>> In file included from utils.h:13,
>>                  from utils.c:12:
>> cs_priv.h:7:10: fatal error: capstone/capstone.h: No such file or directory
>>     7 | #include <capstone/capstone.h>
>>       |          ^~~~~~~~~~~~~~~~~~~~~
>> compilation terminated.
>>
>>
>> The full log is available at
>> http://patchew.org/logs/20190523204954.13122-1-richard.henderson@linaro.org/testing.s390x/?type=message.
> 
> I saw this on my laptop (which doesn't have system capstone installed)
> as well. Did I imagine there was a patch floating around to deal with
> the captone/capstone inconsistency?

You did see one, but that was for users of capstone.
This is while building capstone itself.

This means that something changed in capstone's own build system that I failed
to replicate while pulling it into ours, and I failed to notice because the
build here found the system header instead.

Ho hum.


r~


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

end of thread, other threads:[~2019-05-31  8:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-23 20:49 [Qemu-devel] [PATCH v2 0/2] Update capstone module Richard Henderson
2019-05-23 20:49 ` [Qemu-devel] [PATCH v2 1/2] capstone: Update to master Richard Henderson
2019-05-23 20:49 ` [Qemu-devel] [PATCH v2 2/2] capstone: Enable disassembly for s390x Richard Henderson
     [not found] ` <155865586800.24.17673050455759130330@549697c9ad12>
2019-05-31  8:20   ` [Qemu-devel] [PATCH v2 0/2] Update capstone module Alex Bennée
2019-05-31  8:46     ` Richard Henderson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.