From patchwork Tue Oct 15 17:51:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 176397 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp6252498ill; Tue, 15 Oct 2019 11:05:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqxc4Avgq5IEUqMXgamz8tgSXypMR2kWfm9jJxBdYacFR2ccRpo83TvtkBnkDhAVd1ZEoPBs X-Received: by 2002:ae9:e20c:: with SMTP id c12mr37254881qkc.149.1571162738095; Tue, 15 Oct 2019 11:05:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571162738; cv=none; d=google.com; s=arc-20160816; b=KYBqosdkdWOOXnxfpQQlLs2TV5yvlxxHL6VJtZG2mHrNgndYZV1z334A1rD+v+GnQr SmKkDeLGmETWtOx+uW4mQz+azio6CnVBhloOCvFRB+K79RRrX827qWEPTrGFAh/A4Wqm LWj6PnIBheCNNTsPsYeOpIqCxQuuV7lGu1ovO4u0Ek/AibA1Fd/XJqofoRB64Duut9pK U74gAKG+6LXDA2tIY3Q/ct6WaP/UbwS5xt2deC2CL3mPcQd1K5aO13U6sLOa6mFJrxb1 IADHKgFNpLPv4KOMEKqP6VoUblmScm1d8tNM8sK+cpb7lVB2vTh29S0okBitu7t5AftD sXJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=JPcXbUefVYp1/DZorpkAXAFcmm1X6SF54kxYkRBFIog=; b=E11R/ZxFyaZQVhgpsi9owd2lN3n9517fHuLRmg+oAem57ItmE+zyRRelrr7jOgYutF njMC0C487CiDSaNH7LOyjGyoKrstY9dcXTFwKRNtXi4cS/KmKQl8SiHJmY2BCRolFjdF OijPU4yOioAYdQ+uZtH54NTF6PUHeD31K78ZMcPvIt1xDWqYkDlPn1DKVhEG7KmHxoNu h1R6LJW6ZesF+72Zxfy1fvXTEMCNQF/zkeQHvIOOuWDSdMtZzykBN/XW8d1ur2fZi5cA RX5VzuF4SqUlJ1Bhl2b814f72b7BWpCtPAQyOnzDkA97yx1TyBoyfyDDhKOiUI1biWvv 7DCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jE0orpGF; 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=pass (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 x14si20107170qvo.118.2019.10.15.11.05.38 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 Oct 2019 11:05:38 -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=pass header.i=@linaro.org header.s=google header.b=jE0orpGF; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:55482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iKRCT-00075o-KL for patch@linaro.org; Tue, 15 Oct 2019 14:05:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54601) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iKQyy-0004x0-Ss for qemu-devel@nongnu.org; Tue, 15 Oct 2019 13:51:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iKQyx-0003Qs-Ow for qemu-devel@nongnu.org; Tue, 15 Oct 2019 13:51:40 -0400 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:41721) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iKQyx-0003Pl-JL for qemu-devel@nongnu.org; Tue, 15 Oct 2019 13:51:39 -0400 Received: by mail-pl1-x641.google.com with SMTP id t10so9936531plr.8 for ; Tue, 15 Oct 2019 10:51:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=JPcXbUefVYp1/DZorpkAXAFcmm1X6SF54kxYkRBFIog=; b=jE0orpGFix6/Su5bS8NmnWMrRSuZHytmrxj+wzSa7qmgsoAmjutVGhK/6TUvJcAPu6 GVGF30gwVg/sk3zPasO9WkUNlE/H0hvgsO/2OfCiVmXtfloUX+6Npr75yxO19YY6vgIV ZHo++387ZEeNPW2SEJ6AKFfA7d+EDDsCjTNeFdyQMaZS7E0M++8+Mm9KFTYFDnZIhEs4 R2Hyx2cXdRiLqv6lPtei3/Xczq/NZIMYxM6N81UGuUKIL/i0DZGxjk9xQNv+L8GUeIWF yINR8dakDUa4I4ZKuwkDcg7V/2HAPTOzFU2aUHd1UNBqmt49koxLeMjs2qomDge3FxP+ Zuig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=JPcXbUefVYp1/DZorpkAXAFcmm1X6SF54kxYkRBFIog=; b=cWjBs+EFhSB/IrYTG7O8tR7HhHZg7k4xqnCnr0JAHC5xK72sOGo5RWnRglxs++RXsv Y3M6cXfWSP2qb5uJfXQ7OZCbKdqa1JIeg0/Kq3OjrEbDr1FNCG5BjhCrzDugtOSBb35Y dE1c9icHpML8KBNUZ5seaDaPWrxc7Ba2PRpomQiBypUoS3ArefxOSDd23Z9LLy6iqv5f 8uYY71hN8USscYxWNgU/CRzHpckq1dT2kge77MesEVfWXJtRHEcervlkKw0izgGiDA5V wFzPfYXUK+vSHpMJJVfJzcQ82UYxDZY3CFaAEm0o0sV68qMeSH439f0wcZRpixgm1vUz FoVA== X-Gm-Message-State: APjAAAV5eN01hvC8CIlAJ0CQknQv1ARlRdigVxhMhN1/kSVobHRVxKdS mqH0OreHI6bXTFfZIk60GoPt2jzo4I4= X-Received: by 2002:a17:902:7e4e:: with SMTP id a14mr37242068pln.68.1571161898200; Tue, 15 Oct 2019 10:51:38 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id t68sm20867845pgt.61.2019.10.15.10.51.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2019 10:51:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 2/3] capstone: Enable disassembly for s390x Date: Tue, 15 Oct 2019 10:51:32 -0700 Message-Id: <20191015175133.16598-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191015175133.16598-1-richard.henderson@linaro.org> References: <20191015175133.16598-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::641 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: , 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. Signed-off-by: Richard Henderson --- Makefile | 1 + disas.c | 3 +++ target/s390x/cpu.c | 4 ++++ 3 files changed, 8 insertions(+) -- 2.17.1 diff --git a/Makefile b/Makefile index 8ce48e0342..97e34be162 100644 --- a/Makefile +++ b/Makefile @@ -503,6 +503,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 .PHONY: capstone/all diff --git a/disas.c b/disas.c index 3e2bfa572b..51c71534a3 100644 --- a/disas.c +++ b/disas.c @@ -550,6 +550,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 3abe7e80fd..44f40f1f8c 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -43,6 +43,7 @@ #include "sysemu/tcg.h" #endif #include "fpu/softfloat-helpers.h" +#include "disas/capstone.h" #define CR0_RESET 0xE0UL #define CR14_RESET 0xC2000000UL; @@ -180,6 +181,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)