From patchwork Tue Sep 19 15:03:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 113024 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp5050065qgf; Tue, 19 Sep 2017 08:27:09 -0700 (PDT) X-Received: by 10.55.127.7 with SMTP id a7mr2561470qkd.45.1505834829816; Tue, 19 Sep 2017 08:27:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505834829; cv=none; d=google.com; s=arc-20160816; b=rFeADFgfb1CN3utTjksvSzaC2Xn1yOjH8Dd8W6bClDtCL4nxwwi1yfjV05oFKUm8lU Es63X32LWYmJVGZ0z9K9CfgTM7gv2hsUrfiDRbsfDuEYv79bfYCVt5rHTWOd5mEpuDJ7 Pc79LA96MBtV8Hfcbt5Lt6w2OUrenSFseNmYmJ1LxvGfZMYoZkNqCZieoMT+B2Q2DvES FONeHtfZ+YHvtRwWH81DM+iw5QihudlnD0itPrSo+W8jzGXzNrZbAAM8/1NSwmptxxL8 gzOEdVYs8Ko7IbMuhn0ZIw9FQqCP/Z2jM4BLu8mrVyE07Xoq/NogxFJHtW7ODOAng8zw wimA== 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=ygeqOpTfZFCnhCXegyyE1f5mqPMjYhHF20LooLbbfOw=; b=cPYgYBwEnk37/y1ncfOH9iJMetAss81/IVfdSK86VbbloK23ZQivG/1FRFbT4o4tdS lATr3lT0quKgNe7OXV7ut304rucEtL0VLlZ8NjTxk3nMNtOnF30cxQTCtvXalFEaSpYA qX3MFDmf1H5D64G/uZR8iCANEUnRtVBZRip8KbBOfRnfPf6CMRfeqrjPIFPvV1HhCmXX p8sfQHHrDrHe3g108jxzkr4IyaxfdHNfxOO80D4d7DE+3mvz/K+PjVTzfhVgbm38gS4f 4Ea99XmhncEocXerywcwhAKXtHV8y+XXgtMuZ5atOppp5wZB6a9OE6Fw2yE0LTlCnDR+ yvFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Dn18l4d6; 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 v11si9686753qti.530.2017.09.19.08.27.09 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 19 Sep 2017 08:27:09 -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=Dn18l4d6; 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]:43532 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duKQV-0003UM-KQ for patch@linaro.org; Tue, 19 Sep 2017 11:27:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48988) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duK3Z-0007zx-8M for qemu-devel@nongnu.org; Tue, 19 Sep 2017 11:03:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duK3V-0003bi-80 for qemu-devel@nongnu.org; Tue, 19 Sep 2017 11:03:25 -0400 Received: from mail-io0-x236.google.com ([2607:f8b0:4001:c06::236]:57289) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1duK3V-0003Yf-4J for qemu-devel@nongnu.org; Tue, 19 Sep 2017 11:03:21 -0400 Received: by mail-io0-x236.google.com with SMTP id m103so681256iod.13 for ; Tue, 19 Sep 2017 08:03:19 -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=ygeqOpTfZFCnhCXegyyE1f5mqPMjYhHF20LooLbbfOw=; b=Dn18l4d6KH4glc9Ji5+jHj7vskBMndSdStff7wVN8XaPHnuEEE2kAOicONaPB1vRa8 jMHQfM0Sv3qDbJkkV5+Xy8BrGpYsaGVTyES8b82CYH5eEkXnsHKGA3lRfCc8UzMb9o0A UkhQ7foGUaUftdooU+FsYHLoIPyNifVYj1fME= 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=ygeqOpTfZFCnhCXegyyE1f5mqPMjYhHF20LooLbbfOw=; b=RzlHgMf995Gd0DTgoJ68CMhPwc9ZzjMXvOVSxgu5SJ6UOgHbhptW13wCmBQRYKQ2xr OyxGXWmMa01gDy4uPMFq3nItXRjPG2z1Jo7cepthOXmopFunh6cyaHngvg1JHPOKXK9r T/7nAxOdLFFCZxcxLoCDvIsa0jKz4LXbIEBt5TVsYwhpRqB4Bt75DKIYKtNOIFYXc9L/ KTvT0Bptg+WIljMsxaZu/9Sr27F9UzeC8xtxoF6rjakR8KJJiHHonvQ4sBjn9x4Jzy7K XvYSWxSHnVhJEiZK9Iz3nZ2aTTKm15bbLpFCFMCv8/4a7GlX2Ar3zMCCdLEEPlAjw7XA tO0w== X-Gm-Message-State: AHPjjUiqFDI0TcbLvyXUPeQrNE+la7tRDh+F1szRjVJTvuWHI6sZMqcq MGtm8PRG9DbDVc5jgMR6tnuBcWev9G0= X-Google-Smtp-Source: AOwi7QCZvPZfn9eYMUrY1PhUbpSr4wK8Hq0t3VPjkjZqFLVIMvI73hWbXLmDzykHXU+p+JPGvfunkg== X-Received: by 10.202.72.20 with SMTP id v20mr1725903oia.195.1505833398446; Tue, 19 Sep 2017 08:03:18 -0700 (PDT) Received: from bigtime.twiddle.net (162.189-204-159.bestel.com.mx. [189.204.159.162]) by smtp.gmail.com with ESMTPSA id h63sm360621otb.59.2017.09.19.08.03.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Sep 2017 08:03:17 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 19 Sep 2017 10:03:05 -0500 Message-Id: <20170919150313.10833-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:4001:c06::236 Subject: [Qemu-devel] [PATCH v2 0/8] 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: Christian Borntraeger , Alexander Graf Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Changes since v1: * Don't silently ignore unknown insns. * Don't copy memory when dumping host insns. * More properly handle dumping from the monitor. * Drop enabling for s390x, sparc, mips. The s390x and sparc support in capstone is pretty poor. It seems to only handle userland instructions -- at least that's the impression I get from the hordes of insns rendered as ".byte" within the first few TB of booting each machine. I dropped the mips patch simply because there are too many capstone options and it probably needs more testing than I've given it. If there are any IBM folk paying attention, it would be awesome if some time could be found somewhere to improve capstone for zSeries. You're in the same boat that i386 is in -- namely that our ancient binutils gplv2 code is neigh useless for modern systems. It would be really really nice to have a better disassembler for qemu. r~ Cc: Christian Borntraeger Cc: Alexander Graf Richard Henderson (8): 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 include/disas/bfd.h | 4 + include/disas/capstone.h | 38 ++++++ include/disas/disas.h | 4 +- include/exec/log.h | 4 +- disas.c | 310 ++++++++++++++++++++++++++++++------------ 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 +- configure | 26 ++++ 29 files changed, 380 insertions(+), 152 deletions(-) create mode 100644 include/disas/capstone.h -- 2.13.5