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: 815613 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Dn18l4d6"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xxRXf0wLQz9sBZ for ; Wed, 20 Sep 2017 01:25:53 +1000 (AEST) Received: from localhost ([::1]:43527 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duKPH-0002Du-Jq for incoming@patchwork.ozlabs.org; Tue, 19 Sep 2017 11:25:51 -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+incoming=patchwork.ozlabs.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