From patchwork Mon Sep 14 00:01:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 249744 Delivered-To: patch@linaro.org Received: by 2002:a92:5ad1:0:0:0:0:0 with SMTP id b78csp1199112ilg; Sun, 13 Sep 2020 17:02:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyd9uNCWx84wGs0D0rpCDlkoC345NRKV63JUlk1gBejQNpaWQO3n+DIA6/2+tynDnLZ0zj1 X-Received: by 2002:a25:d8b:: with SMTP id 133mr17466782ybn.294.1600041733897; Sun, 13 Sep 2020 17:02:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600041733; cv=none; d=google.com; s=arc-20160816; b=oLIqO7hy2NUcb6IhXILYT2yMoxru3XFwGlmYbS2vstbKb7lC2yJGLC0twV/b5w+jXS 3EWlpGSB4UYgsXVVrHloa5SSFwhIkio6josYnPpl0v5KUrs9U64nB/HUVjuZ5iSDhDjO wpicFNXdAZWsovhxLKuNl2DYFkHSPQVKsKZxMJ2B5UD2nZMLrYwOnLsrVMHHdL7c+FnA Vm/PFQ9XsQH7xREAbXQByyTCyxmgEPooJxqfNZ8QIdOLlUoFDJaGzpXgEy8HJkynWgfj UfiwaIk7Fagu8rmtNzc84U98dJhpLLohBeCitTHrhNhvzUIgUqBkYgeVhyDRi245xi4u 3yjQ== 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:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature; bh=INOIZZ1UU6wjUvExIBY5xZEUID/bFlB32HgebiDeLvo=; b=1KKF1maKVIDdvztvEr5zmU5a8qzjR+KfxxG3jGqioyzGy2Dr8up0kt+GEtWO3Fl3E8 3PpP1UgmefcX0jsdkzD/M/dhsvNPRDYt8IINDi8BZjN87ajwYb006O5c3ZtmD6UvsDYy TsC59RmZnqOT41UEQ7cbrgm58VmrkUNvWoBy11Eij6Rk858I7fNt7SYpEPX9IvWZjOYW 0yWhDtD8Qw2uE7KBHZEM0QFvubF3CwVwN8ZV4h2/xhXiEWzVjBPPtyRvtX5cPZAGR1Wc lrdSYyu8Zz3J2SGWOovmWjsp/bvauhDxqE3DKn+lWcShLzl9TCaRWKZCNYAttsU705iP KZew== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RZUqFLex; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id e18si9033113ybp.450.2020.09.13.17.02.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 13 Sep 2020 17:02:13 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RZUqFLex; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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]:56302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kHbwh-0002Ug-5h for patch@linaro.org; Sun, 13 Sep 2020 20:02:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHbwV-0002UT-BJ for qemu-devel@nongnu.org; Sun, 13 Sep 2020 20:01:59 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]:35225) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kHbwT-0004BR-Gb for qemu-devel@nongnu.org; Sun, 13 Sep 2020 20:01:59 -0400 Received: by mail-pf1-x434.google.com with SMTP id o68so11179403pfg.2 for ; Sun, 13 Sep 2020 17:01:56 -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=INOIZZ1UU6wjUvExIBY5xZEUID/bFlB32HgebiDeLvo=; b=RZUqFLexb/mvoAA1++MJGs1AUjxM/wRxFM/AbTSd3aRw3UitS7Wz1BYn3AnkCZVEnj FDuum2D71e0SKqKqBlb8NTZmAnrkeiheu9UO7SPdqZQb37ucVgOE6siCuwhhpYIYeC60 xIgRRa2XnosMabb04VA4FGuNTIg5OiHaBjNoDhD/B56KnEf5jqX6Bh+Eo4Gyt7WRBp8e eE8VmSAALc2pNsLCifm2UxLTQnCDhjRZmxkGGWITXxRhy3a46yRU3qeUE35hiCqHasvI L9avhW4dAVETwPDdpt600M93VQnRrYXoLzcOc8DblQ7oouXhwAooGAjUON20Qsen+mP/ B5oQ== 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=INOIZZ1UU6wjUvExIBY5xZEUID/bFlB32HgebiDeLvo=; b=p1gymoVhfCixWy6H75hSQnAwCl5iVbLrSdZ9JInHCmbToGLb8P/FourOBFPAsZt/WF abSRL6WcJNUN1p5YtGexrDCCmbIyORQRM7Pn1vM6wI8GQ9zS06jgu2Hftc+wkG8Nfm7b 1HmNH+BQRUmXgrBnaBMDgs/2QchXUXCzJSCJ5NVfwhNssjTVU8U6s1g+53MoGDPj4PNU nOCdWaPPty8uZc+4tXw/z8W+tkxAJJw2PVai4nE7e+6jYyekfjHrYCBojkObPA59xQ+M YnWkTBBSD1rApRZ45FQpsWtXJuaGFHzxnLlZj8ogIbLTDHs8o81dSPZpVEO8megBc9it MroQ== X-Gm-Message-State: AOAM53116Xz24VTxDOx0xNVjzpauIOjn/h64arAZcCQWKglIbBo2AANj fw4frw5gdl87ATgkTKK02lI0sBF0xlKaEA== X-Received: by 2002:a17:902:b586:b029:d1:bb0f:2644 with SMTP id a6-20020a170902b586b02900d1bb0f2644mr8292015pls.34.1600041715069; Sun, 13 Sep 2020 17:01:55 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id 31sm6538252pgs.59.2020.09.13.17.01.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2020 17:01:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 00/11] capstone + disassembler patches Date: Sun, 13 Sep 2020 17:01:42 -0700 Message-Id: <20200914000153.1725632-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: luoyonggang@gmail.com, alex.bennee@linaro.org, thuth@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The primary change here is the update for capstone to meson. This bypasses capstone's build system entirely. There's more commentary on that subject with the first patch. Plus a collection of other fixes and cleanups in the area. There are a couple of other targets that could use capstone: The current capstone branch has a fatal bug affecting RISC-V. I have submitted a fix upstream for that, and have the minimal patches required to enable it here. There is capstone support for m68k, but it doesn't look like there's coldfire support. So capstone is a subset of what we have in disas/m68k.c. There's probably no point changing here. There is capstone support for mips, which might be good enough to replace disas/mips.c. It wouldn't replace disas/nanomips.c, and there's no support at all for the micromips isa. r~ Richard Henderson (11): capstone: Convert Makefile bits to meson bits capstone: Update to upstream "next" branch disas: Move host asm annotations to tb_gen_code disas: Clean up CPUDebug initialization disas: Use qemu/bswap.h for bfd endian loads disas: Cleanup plugin_disas disas: Configure capstone for aarch64 host without libvixl disas: Split out capstone code to disas/capstone.c disas: Enable capstone disassembly for s390x disas/capstone: Add skipdata hook for s390x disas: Enable capstone disassembly for sparc configure | 24 +- Makefile | 16 - include/disas/dis-asm.h | 102 +++--- include/disas/disas.h | 2 +- include/exec/log.h | 4 +- accel/tcg/translate-all.c | 24 +- disas.c | 702 +++++++++----------------------------- disas/capstone.c | 326 ++++++++++++++++++ target/s390x/cpu.c | 4 + target/sparc/cpu.c | 4 + tcg/tcg.c | 4 +- capstone | 2 +- disas/meson.build | 1 + meson.build | 112 +++++- meson_options.txt | 3 + 15 files changed, 672 insertions(+), 658 deletions(-) create mode 100644 disas/capstone.c -- 2.25.1