From patchwork Thu May 23 02:42:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 164930 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1623237ili; Wed, 22 May 2019 19:54:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqyTusu+vb5yyOE8qw6nUZL0/oJqM0rgRs1ecVSkabA//QAQJNyHaoUNA8M4nRsnSBXyDWvf X-Received: by 2002:a17:906:f84c:: with SMTP id ks12mr62098272ejb.270.1558580064231; Wed, 22 May 2019 19:54:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558580064; cv=none; d=google.com; s=arc-20160816; b=BJ6AXDosaUhVmLOX59ybIvSrA86+iOFIkcYq4t5nT3ZvnoBM5bGf2qf4YXb6+qQygy B5DJUt/1KXld6OYlds+5F83uqbzlXgXupaZRcFTN7p8pdcv7P5owL/UOdkTmgiRsH6jL zhF5UqStjH0KCwYXONT+bwAaTl6Orky20Mvk2qoITQmNT9hP2nX7DLsojImaO5qZE9o7 NqbPc+iL7vskf35M6XHJKVv4NCb8khTO+yU+qobGrXNj+HgqL4bOvu24pgGyruMeF9Kk i3vCeypinXdNx0Q0QVWEdUPPSJoeqkOfETtEQoZzC0RsF+hVvjbNEHip0fcWzyslhC8h Bdjw== 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:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=hJlj0a8T7befv3zY0YqLNtddqSz+Zz6qoIsCXjt90zc=; b=nZDFIrAt1cBz9EmPFpF1jvYy0bCkGUtt3irzDV4nzQSHSTvliXtrRMHIHThMKGgym9 EzZQiH07S1CqtvrDHFKsQajnUKca96Ic9zfsPPDMRrH8X9x+YG84LY1yYoLJBRsdYXzn xsa07TIdP2d17h83UN6JwLrSxiJ+Ip1SqPb1LpZkGhJCm8zgfj1V7as90XjQOVZvciK2 F4YOgO/eprc6VqvIX/ubxJgx7CWnFShjkdbqCWJzRoeVx5ghK400reOBbTatCw8SIXRO O6zg9mBMqLeSAktXl/LmzMMPjLEbJ8VzvpWuZSVUpqIeK/YTvDgcYfYOfEV7xDne7EhF sBcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KUeoFYkO; 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 s42si922781edb.341.2019.05.22.19.54.24 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 22 May 2019 19:54:24 -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=KUeoFYkO; 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 ([127.0.0.1]:56579 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTds7-0008IF-8X for patch@linaro.org; Wed, 22 May 2019 22:54:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44613) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTdoZ-0005Qx-32 for qemu-devel@nongnu.org; Wed, 22 May 2019 22:50:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTdgf-0001rV-Rt for qemu-devel@nongnu.org; Wed, 22 May 2019 22:42:34 -0400 Received: from mail-yw1-xc41.google.com ([2607:f8b0:4864:20::c41]:45837) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTdgf-0001r9-OB for qemu-devel@nongnu.org; Wed, 22 May 2019 22:42:33 -0400 Received: by mail-yw1-xc41.google.com with SMTP id w18so1672540ywa.12 for ; Wed, 22 May 2019 19:42:33 -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:in-reply-to:references; bh=hJlj0a8T7befv3zY0YqLNtddqSz+Zz6qoIsCXjt90zc=; b=KUeoFYkONNWEXXoOoL4p8rNYvG+crmpzm9fBPDSuRXJ31OPkA9RS7Ru875ij2ZtR0J HTVdmIgqEoTPBRKcVdSnv11wa6eytshy2ybGP6Dlz8QmhHEhCvOxpB/6oV0NDqIWVUGd LIqCSOOx8xYOspeVb14tsRFWmeyP1lI51w7uwXHKiioX6Qrc8CbkihMXKl0GRWQRkFTU MR9wQXxtBEgJBbpbhTj078QlpKWlrYt2ETDh2vwSqc11FaMrDAI1PdaEknsYLydtRUpk ehoejxfS2Bw8KYH050jXXO7XQYROco0MJ/nJP14P7Jwrxtzt6u1hgIbsdYVyhkebt8oM GydA== 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:in-reply-to :references; bh=hJlj0a8T7befv3zY0YqLNtddqSz+Zz6qoIsCXjt90zc=; b=RvlI+xDVPGhmtzPNrUCRbsX8hPkESQueYtGzCyyECc7pzd0smS15paHaTGzfYepRbz 8pCp18yxfTpTn47uyHDZmikCN1u6rGAwsxwOUbIhan5BzGLLlEF7BHgUkHxcIZfu61zu p2qsg0M07N6bBvkPn6hvR67rrS3c/f4m/XVil8++EesKl5EN/g2S7tA9Fd2376Fczz8Q XKhkLFttCpiTVIco5eukfDxbuu42YHq6XD1S9ATqgBUErID7+QxtpKb0u0cBW/Y7o79t 0VCLK7/CKCPh2YsMe7O8iJT5gWrZsIsjF1af9gzZKbj2/7w8X0WbKBo3s+veU3N05z+9 lFcg== X-Gm-Message-State: APjAAAW3VjhKHLTEvd7HA6myAUWr06oxybszKM85MpHNTDc6UuZUhe9l rrdkT3y2RTzPd4DDtm8RNktOVzDvfO4= X-Received: by 2002:a81:4d42:: with SMTP id a63mr27652804ywb.346.1558579352684; Wed, 22 May 2019 19:42:32 -0700 (PDT) Received: from localhost.localdomain ([71.46.56.17]) by smtp.gmail.com with ESMTPSA id n12sm7559320ywn.81.2019.05.22.19.42.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 May 2019 19:42:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 22 May 2019 22:42:27 -0400 Message-Id: <20190523024229.1158-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190523024229.1158-1-richard.henderson@linaro.org> References: <20190523024229.1158-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c41 Subject: [Qemu-devel] [PATCH 1/3] capstone: Adjust include of capstone.h 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: alex.bennee@linaro.org, david@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Since v4.0, capstone.h has moved to . Signed-off-by: Richard Henderson --- include/disas/capstone.h | 4 ++++ configure | 6 ++++++ 2 files changed, 10 insertions(+) -- 2.17.1 Reviewed-by: Alex Bennée Reviewed-by: David Hildenbrand Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé diff --git a/include/disas/capstone.h b/include/disas/capstone.h index e29068dd97..90631d84a9 100644 --- a/include/disas/capstone.h +++ b/include/disas/capstone.h @@ -3,7 +3,11 @@ #ifdef CONFIG_CAPSTONE +#ifdef CONFIG_CAPSTONE_CAPSTONE_H +#include +#else #include +#endif #else diff --git a/configure b/configure index d2fc346302..eec7f061c3 100755 --- a/configure +++ b/configure @@ -5021,6 +5021,9 @@ case "$capstone" in system) QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags capstone)" LIBS="$($pkg_config --libs capstone) $LIBS" + if check_include capstone/capstone.h; then + capstone_capstone_h=yes + fi ;; no) @@ -7197,6 +7200,9 @@ if test "$ivshmem" = "yes" ; then fi if test "$capstone" != "no" ; then echo "CONFIG_CAPSTONE=y" >> $config_host_mak + if test "$capstone_capstone_h" != "no" ; then + echo "CONFIG_CAPSTONE_CAPSTONE_H=y" >> $config_host_mak + fi fi if test "$debug_mutex" = "yes" ; then echo "CONFIG_DEBUG_MUTEX=y" >> $config_host_mak From patchwork Thu May 23 02:42:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 164927 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1620661ili; Wed, 22 May 2019 19:51:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3tvvk1KoWueROyRc0sv9nZU8EySXP3OIDpzl4O3dm1Ht50LzPKdr0YxyPDYRvE2y8+CsM X-Received: by 2002:a50:8e81:: with SMTP id w1mr93883043edw.271.1558579864863; Wed, 22 May 2019 19:51:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558579864; cv=none; d=google.com; s=arc-20160816; b=mJiey+l5u/mwecJjtMo88lhqCDl4YXdTexeNLTuTg4utsv9jMGo9XCrgZonK8tM3YW v9giGWYpanGnVcJKEvOL91LSLoY2IslUxGQVAboq+L1Wl1zNwhcUDFPWuh7gaMX+5vjX Bwet7nDMwA4feiQzQ/XmLOEi3mT6BZqf16iXkqWvLFHWNXbpmkSxSjhcwcmqsG6v2Iq5 JDfoa7Gm3cHfIhLYAwREBOYH3Kz2XeQsln9mySsrJ/yBAHL52X5LEqyspzMCq0gdRVUw zBc7QIcjCqaw/O3cf8lM+u+UAfjunYbp0hy8LUYEat5IiiM5o9gyNuU4l5CLe7FpD3/M IuNw== 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:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=8kd0zJ7pX2a58yAUvy9tQqu3+GflEz08T0/34sUM+/A=; b=jc8XYTth0U7fzn5OKzMTKSrfPI3A1JzVy/S5pcRugsrc9aeaxAmEU6uz5RWAN+EPc6 JDRvHuFlqHFx7f0JjSwk1yA4RZge941KF2k2g++2uRo4PON/el8lSOf3KPrtacUKUBvy N18jUW0aLgqq/fUlfCqDS6/0vVlcQaoXl/NBBP4/5bY2tjoEmplJkJqqPcfifyWEELEK 2wBrnTxgtwrklnW6Op5xBS+4wTadnuPwXzryarsr7e5QDkDBTpluHueZ+HRqsBppNX+3 VV695jdyTkY9TroJDeMmdiN3ynElSjgOpuVi3HFcOl9u5ePRf2dB8kFTFocnOiHUxCno ieKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="QABtF/Jp"; 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 w9si3657167edt.395.2019.05.22.19.51.04 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 22 May 2019 19:51:04 -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="QABtF/Jp"; 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 ([127.0.0.1]:56549 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTdot-0005Xa-PH for patch@linaro.org; Wed, 22 May 2019 22:51:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44613) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTdoY-0005Qx-3m for qemu-devel@nongnu.org; Wed, 22 May 2019 22:50:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTdgg-0001sF-U5 for qemu-devel@nongnu.org; Wed, 22 May 2019 22:42:35 -0400 Received: from mail-yw1-xc44.google.com ([2607:f8b0:4864:20::c44]:33722) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTdgg-0001ru-Pv for qemu-devel@nongnu.org; Wed, 22 May 2019 22:42:34 -0400 Received: by mail-yw1-xc44.google.com with SMTP id v81so1697769ywe.0 for ; Wed, 22 May 2019 19:42:34 -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:in-reply-to:references; bh=8kd0zJ7pX2a58yAUvy9tQqu3+GflEz08T0/34sUM+/A=; b=QABtF/Jp0I6Hk9ojEdIqCwJXu+R+Q+xjpgknF47zdeI4E++UWXDw/6IMIQSwcAejVi GrJN9k7lXdxbb7swTqbi5Jsm5TkspwDwq+A3PJF2qg8Zm1bIOBlxO58IZYjago7fvrVJ HB3CrNZo01H2cT7FHwKSwaYvvyjWC1kpbj1aDE20rEYMSyXBqj4WA3J++7KWCTsce83B sH/GhMlvzuWxBuCQFlicvf7aoS/f044awBIlslXHYCch19+rgIW4LawIaVwIvGGLJhgT 7HTfcr2zBDj2Z6Vew4jGXttF1igawk2wxJMWJiQlH4S80rmS/9We1C9rv0hePoMwOQzH 1Aaw== 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:in-reply-to :references; bh=8kd0zJ7pX2a58yAUvy9tQqu3+GflEz08T0/34sUM+/A=; b=ngAjCD5bIXq2x8S9U17/BMLWMtFtTSU3ix9QcCYsGABlnh0ZGSjE39G+STvCeEIIXh HR3msQEPD8sABlKHLOwsfeKBS75hvmuWy9PzD+3TqEg4JkFJpwPnfL9pvN+w4Zg83CUL NUh8oFDOn14a+ZC5xBOdXQscNKX+ixBoLLSe3E8fGONwy1sONCWsgVZjVWFXsGLPPYIB HrmT8PNqzemnsTT++hvaAQPiE7Z3QLuCPolK9lK3JiNyEmO1OosqV/DJkE0W7jaiEOf/ G4hfAjsquJ+RuqezEcV8tLv3Z2WEgLj7g+EJu+nr7AVgzw1qIZxMNXY5+v1P/1U5Oxg8 avfg== X-Gm-Message-State: APjAAAWQceOxj53ecCH0lSodOMhV0g7ogcZdWiIT+rBcQhMYhqFuzeRD S1VYHlVSqG7ObLs2CuVU9Ue5yhtKQgc= X-Received: by 2002:a81:a183:: with SMTP id y125mr46192680ywg.249.1558579353887; Wed, 22 May 2019 19:42:33 -0700 (PDT) Received: from localhost.localdomain ([71.46.56.17]) by smtp.gmail.com with ESMTPSA id n12sm7559320ywn.81.2019.05.22.19.42.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 May 2019 19:42:33 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 22 May 2019 22:42:28 -0400 Message-Id: <20190523024229.1158-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190523024229.1158-1-richard.henderson@linaro.org> References: <20190523024229.1158-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c44 Subject: [Qemu-devel] [PATCH 2/3] capstone: Update to master 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: alex.bennee@linaro.org, david@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Update to fbb20ea83c5a. Choose this over the 4.0.1 tag because master now includes the s390x z13 vector opcodes. Signed-off-by: Richard Henderson --- capstone | 2 +- configure | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) -- 2.17.1 Acked-by: David Hildenbrand Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé 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 eec7f061c3..a2e4636a34 100755 --- a/configure +++ b/configure @@ -5016,6 +5016,7 @@ case "$capstone" in LIBCAPSTONE=libcapstone.a fi LIBS="-L\$(BUILD_DIR)/capstone -lcapstone $LIBS" + capstone_capstone_h=yes ;; system) From patchwork Thu May 23 02:42:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 164929 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1622243ili; Wed, 22 May 2019 19:53:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqyG76/hso8WmuKmHVWVy7pkgUCRS4dUuQ9PIqjQPmYqdT4yw+6xc6ttIMMBB2wwe0eeC2jk X-Received: by 2002:a17:906:4d57:: with SMTP id b23mr73536273ejv.254.1558579984379; Wed, 22 May 2019 19:53:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558579984; cv=none; d=google.com; s=arc-20160816; b=luW7qcGl1o8pcduc9QsEeQ6BXvDtFBYT89Cw+2iGNfQJrPqa95s1s+32gbeBqO63S0 A5wrOJtm6NdYbu7qpdyhXrjHka7iIJ+sAXHxGflt1sCZm5X0udqeG1fOEbfpSYiB/Eke da0YwA7Blnz6iy60pWRl3AAE393lbtjY3SJqbFKOSOd8M7Ug5xpq6+ebtoEBsMa/Mya1 8u9SoatvRH6feX/VqqTbn8GlEgrn4oxdBRAPuou/L0/K4fdWLD+AEHuE+AaRyAHw0iSg 4F20K4gJ4zfp+Do44A89X2DHq5tu9v3+AA3GdM8J02Hyfegi1OJoBj8uMKZz1HCNu30T wf0Q== 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:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=L3cNq6YyAPNbUfiuj9aFVufaRYm1fCVGRTm5ygWeeXI=; b=Q6Gjq9oRe+wvjyUIordwBHSBSecyj/6e26gnNOQuImFGvdA5U6QpMkS2zNXZWzGf0J 6xrUYpELADosfzhoA1UU7z4HN6ug1xs4ZcT0/uI7H0rg4nG3fIWThKfDRHXycTqN7VxL zenH+GXRS6H1U0nU3K+VvhN3ZtEOZ0D3RREvFAJF/8gyK/g0YDTWvzVzi1fsa/jFIlmF MfNkxgemUdQ+CjqO5L+ya/KQCPvvKn7oUKXOU36476gJqcdr22v3ZaEtwo980++CTG1E GSsANlWLmSomBl7Qfg3rjm0/mZvXZqagG6r+okZmP33PHYEC+MgKOi9RicwIKXRcDXaB IZ3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Q6HrrMrN; 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 k17si10178176ejs.208.2019.05.22.19.53.04 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 22 May 2019 19:53:04 -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=Q6HrrMrN; 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 ([127.0.0.1]:56567 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTdqp-0007Zy-9n for patch@linaro.org; Wed, 22 May 2019 22:53:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44613) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTdoW-0005Qx-Ru for qemu-devel@nongnu.org; Wed, 22 May 2019 22:50:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTdgh-0001t3-PM for qemu-devel@nongnu.org; Wed, 22 May 2019 22:42:36 -0400 Received: from mail-yw1-xc41.google.com ([2607:f8b0:4864:20::c41]:34879) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTdgh-0001sk-K9 for qemu-devel@nongnu.org; Wed, 22 May 2019 22:42:35 -0400 Received: by mail-yw1-xc41.google.com with SMTP id k128so1694639ywf.2 for ; Wed, 22 May 2019 19:42:35 -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:in-reply-to:references; bh=L3cNq6YyAPNbUfiuj9aFVufaRYm1fCVGRTm5ygWeeXI=; b=Q6HrrMrNJm0cOKjwpnwqAoomARUSCbZGpMi0xgXEFi7ApLzsyuwOUpM5iBvxQVZLjx q05Nm4mxKwjOIYIVVOIHxSaIGhQ4Rh2Lw8yoLxt0Qg3mvBARtO/wr9pu8I0iqSpTP8Ar 9WIZxgf7N5p534yFFn/zq4h2cwr25/Oscq8HR/sHx/fofuiPiPrMmSmRPNR+MZ73hVJ2 +aOMghSmJihsscwxiU436jekxvCOZZJMEIBLYg/Gbd+hG7ZCqnWkBUXbUKIJepFZ7kXM 2cV5+EG/s1UUoRfg3PVawhn6SSHe2lzhcsOoj07qY1kdOo6aPtG+8Y4orAyFbCWGEkur RLLw== 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:in-reply-to :references; bh=L3cNq6YyAPNbUfiuj9aFVufaRYm1fCVGRTm5ygWeeXI=; b=Y5KofZMQaAH3oOg1mQzT+CiyQvy+yfBK8j6DuBVWO59guvWGhvymB3/MScJ8Awozr7 ymnqY/6L1DtGpCXwOGSlqWAmGMI+S15dGLxjaE8yIeUPWjbZU6biuNB0hlFnT8yTqj4B xqsab/II0wgvcVLOAmgMnTFWFxjPh796G5/y2y0MIE5JCkeKwa4zNJIbWwAaY/GtJb4C +L0NJNRsUzAeCFiWtjBBCNcmCRguUlxFmHm6XRfUJ3KB3/d5J4HFYieHJivkVmM3pojC Glx4RmZvpV7Z8vGmtiHLbLSPCfDscwE7a0d61R3lMt6EAMZyvF1aA2njZ/xu8SblubjO kUkA== X-Gm-Message-State: APjAAAWPeWN1tVZ+MB+vlDdhf4WEsVCv7U0jdO/7rFN7+l21C9xm+bvl PXrwvkAbK4wikTIFlqhlkibn6O2ZL2c= X-Received: by 2002:a81:3c83:: with SMTP id j125mr21399048ywa.226.1558579354836; Wed, 22 May 2019 19:42:34 -0700 (PDT) Received: from localhost.localdomain ([71.46.56.17]) by smtp.gmail.com with ESMTPSA id n12sm7559320ywn.81.2019.05.22.19.42.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 May 2019 19:42:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 22 May 2019 22:42:29 -0400 Message-Id: <20190523024229.1158-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190523024229.1158-1-richard.henderson@linaro.org> References: <20190523024229.1158-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c41 Subject: [Qemu-devel] [PATCH 3/3] capstone: Enable disassembly for s390x 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: alex.bennee@linaro.org, david@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Enable s390x, aka SYSZ, in the git submodule build. Set the capstone parameters for both s390x host and guest. Install a skipdata hook to keep capstone in sync with the instruction stream for unknown opcodes. Signed-off-by: Richard Henderson --- Makefile | 1 + disas.c | 40 ++++++++++++++++++++++++++++++++++++++++ target/s390x/cpu.c | 4 ++++ 3 files changed, 45 insertions(+) -- 2.17.1 diff --git a/Makefile b/Makefile index 155f066a20..a37e872825 100644 --- a/Makefile +++ b/Makefile @@ -477,6 +477,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..c1ecd2d769 100644 --- a/disas.c +++ b/disas.c @@ -179,6 +179,39 @@ static int print_insn_od_target(bfd_vma pc, disassemble_info *info) to share this across calls and across host vs target disassembly. */ static __thread cs_insn *cap_insn; +/* + * The capstone library always skips 2 bytes for S390X. + * This is less than ideal, since we can tell from the first two bits + * the size of the insn and thus stay in sync with the insn stream. + */ +static size_t CAPSTONE_API +cap_skipdata_s390x_cb(const uint8_t *code, size_t code_size, + size_t offset, void *user_data) +{ + size_t ilen; + + /* See get_ilen() in target/s390x/internal.h. */ + switch (code[offset] >> 6) { + case 0: + ilen = 2; + break; + case 1: + case 2: + ilen = 4; + break; + default: + ilen = 6; + break; + } + + return ilen; +} + +static const cs_opt_skipdata cap_skipdata_s390x = { + .mnemonic = ".byte", + .callback = cap_skipdata_s390x_cb +}; + /* Initialize the Capstone library. */ /* ??? It would be nice to cache this. We would need one handle for the host and one for the target. For most targets we can reset specific @@ -209,6 +242,10 @@ static cs_err cap_disas_start(disassemble_info *info, csh *handle) /* "Disassemble" unknown insns as ".byte W,X,Y,Z". */ cs_option(*handle, CS_OPT_SKIPDATA, CS_OPT_ON); + if (info->cap_arch == CS_ARCH_SYSZ) { + cs_option(*handle, CS_OPT_SKIPDATA_SETUP, + (uintptr_t)&cap_skipdata_s390x); + } /* Allocate temp space for cs_disasm_iter. */ if (cap_insn == NULL) { @@ -551,6 +588,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)