From patchwork Tue Sep 26 20:14:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 114285 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4237338qgf; Tue, 26 Sep 2017 13:15:07 -0700 (PDT) X-Received: by 10.55.17.156 with SMTP id 28mr16801005qkr.336.1506456907497; Tue, 26 Sep 2017 13:15:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506456907; cv=none; d=google.com; s=arc-20160816; b=epC3WsG6XHq9DcBEkITFRHwbFtpnDlwl6fdY2rHnIdccBZ7227GkOd0tAU8q6uYQqs okVOGcoYubFV2DHcl/xBVOCQf0Kri85pwl8atm5fygSy61LvWXhgeTwEgntK/CPZM1T2 2ET4BQOQXZWQJfwu0dfqQegdiaohxYB7YM8OFFt9dgs8XKN12UTgRxnpScmN7NvFKmHU Fs8cdXrQwdgoRTVTHbNPcG86JFyZdPhooXGuYvdxLd91v4+Iv6dzWDsP6FEVKE+GQlaA 1cxoj69BUjLvN5+dAaIuw52YFuTcprX7ayNyhIAVqlo6yKN0PkoizpVDXnX7aY6yBXcx 4blQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:message-id:date:to:from :dkim-signature:arc-authentication-results; bh=P/QsLBDAKZpvf90ILK6QPO+XT1yA4/qO/JNj1PSv2w0=; b=b5AliTJpIfovYDAPonsh70NYGMgPMuHdtuDDU8IUCN5FnA7BgJcO+7URY7lPqDSsu/ wHgwbftiv4fb8nFyPp2rXBfaCdaq0/ilC2/2JWFeq3CXaNgq3ab2pdHKdEV9pka/l5dk rEIInhD1mDly1Z4n75MZ/nLrQcCAbKkmwIpQaTwbD6DEeK1cQwlf9vFvDZX3DZNq8+t9 /lN7V8xiM7W5OzfyV4eKUoJn9yUks/gY4OaXC2HBHlHB7vtQu6csKU/YgqL1dD2KSxzB /DVWH4d6KFFNEgxNYCul0RmV6Qh0HXwWZEMzINsleEwJ43pJz1KbomvkFw1wlWchyo70 3SmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=I8t6eeE2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id p32si9343920qtj.143.2017.09.26.13.15.06 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 26 Sep 2017 13:15:07 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=I8t6eeE2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:50977 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwwG0-0002tE-2T for patch@linaro.org; Tue, 26 Sep 2017 16:15:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwwFW-0002sZ-RU for qemu-devel@nongnu.org; Tue, 26 Sep 2017 16:14:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dwwFT-00035r-UC for qemu-devel@nongnu.org; Tue, 26 Sep 2017 16:14:34 -0400 Received: from mail-pf0-x22b.google.com ([2607:f8b0:400e:c00::22b]:47568) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dwwFT-00035L-OV for qemu-devel@nongnu.org; Tue, 26 Sep 2017 16:14:31 -0400 Received: by mail-pf0-x22b.google.com with SMTP id u12so6083887pfl.4 for ; Tue, 26 Sep 2017 13:14:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=P/QsLBDAKZpvf90ILK6QPO+XT1yA4/qO/JNj1PSv2w0=; b=I8t6eeE2cDAuwJsGKMjSAF6OxPgw0PN3nLICj62Ivw6uXhYnCRfE6XdGHATGOupism QJbe9ZdMDm39kCZgEvK2N99zKzhddRRdIjuWp9X8Ly3XxGKxlNfBFxAD7w7wrpVZY64O wIeDlGbkegZ2pNZyvufCpHwm3PSdDkCxKXeJA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=P/QsLBDAKZpvf90ILK6QPO+XT1yA4/qO/JNj1PSv2w0=; b=DOZoQhJcA2UoWLwt1hxCwFbxbVcJJYrkTv3SvRfmmgmrDaIFmdxj0spRHOyrK+ZsCs nKTAJit25ZqwvJpQfMLkE3dECypqUQYW+dgdEcLye49Cni1eQ7WIZxOEa/B1eMq67ik3 mC21ZZWN2JUuzndEOlpTtu3Oc5Fb3mP9igHaq52SpWtbMF+ObjugVI8hg4bh3nyWc75k SdrW9hj0BF6nWqqON3sS6FRNHKnyqhOaJVPIFmoKkxYkEudfRt/Ay1RPYtIU7EboELiw No3P5Otl7aDjrLnkyMWr+VcuEl+omwrp2bxIXo4uww+bdY6C8vhWrJ9Kx/TVepWNSPGz FcXw== X-Gm-Message-State: AHPjjUhm8q9sY+MOOdEARD63uTqweqO1+le0bqB3WktRHTRc0S46sP5x 89kBXZkMEqLMvbm8+UXkAGQoZ364XC8= X-Google-Smtp-Source: AOwi7QA6miOljoQF5lY5xlX44o2SRYUZcvvvAkQfTL0wRAQ7WNil+1oXTNjuf5a4NvXH9+OX2DAgew== X-Received: by 10.98.95.1 with SMTP id t1mr11776673pfb.217.1506456870443; Tue, 26 Sep 2017 13:14:30 -0700 (PDT) Received: from bigtime.twiddle.net ([70.35.39.2]) by smtp.gmail.com with ESMTPSA id r138sm15582470pgr.12.2017.09.26.13.14.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Sep 2017 13:14:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 26 Sep 2017 13:14:18 -0700 Message-Id: <20170926201427.2833-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.5 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::22b Subject: [Qemu-devel] [PATCH v3 0/9] Support the Capstone disassembler X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, qemu-ppc@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Changes since v2: * Fix a minor buglet in the monitor disassembly * Add capstone as a submodule, preferring that when present. The submodule idea came from discussion with PMM. The idea is that we would potentially remove the old binutils code, and libvxil, and rely on capstone entirely. Which would then of course require capstone to be present in order to get reasonable debugging. I have not done the actual removal yet, but that is an easy next step. r~ PS: Comments from the ppc folk? Can I encourage you to try this and sanity check what capstone is emitting? Unlike for s390x, it doesn't look obviously wrong to me... Richard Henderson (9): 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 i386: Support Capstone in disas_set_info arm: Support Capstone in disas_set_info ppc: Support Capstone in disas_set_info disas: Remove monitor_disas_is_physical disas: Add capstone as submodule Makefile | 4 + include/disas/bfd.h | 4 + include/disas/capstone.h | 38 ++++++ include/disas/disas.h | 4 +- include/exec/log.h | 4 +- disas.c | 308 ++++++++++++++++++++++++++++++------------ monitor.c | 29 +--- target/alpha/translate.c | 2 +- target/arm/cpu.c | 21 ++- target/arm/translate-a64.c | 3 +- target/arm/translate.c | 3 +- target/cris/translate.c | 3 +- target/hppa/translate.c | 2 +- target/i386/cpu.c | 19 +++ target/i386/translate.c | 8 +- target/lm32/translate.c | 2 +- target/m68k/translate.c | 2 +- target/microblaze/translate.c | 2 +- target/mips/translate.c | 2 +- target/nios2/translate.c | 2 +- target/openrisc/translate.c | 2 +- target/ppc/translate.c | 5 +- target/ppc/translate_init.c | 27 ++++ target/s390x/translate.c | 2 +- target/sh4/translate.c | 2 +- target/sparc/translate.c | 2 +- target/tricore/translate.c | 2 +- target/unicore32/translate.c | 2 +- target/xtensa/translate.c | 2 +- .gitmodules | 3 + capstone | 1 + configure | 36 +++++ 32 files changed, 397 insertions(+), 151 deletions(-) create mode 100644 include/disas/capstone.h create mode 160000 capstone -- 2.13.5