From patchwork Mon Sep 14 00:01:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 249750 Delivered-To: patch@linaro.org Received: by 2002:a92:5ad1:0:0:0:0:0 with SMTP id b78csp1201024ilg; Sun, 13 Sep 2020 17:05:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgJmWJWFKQbejKA6t7ok088sh89ulsEmBkZLtLTy4qeXmf1L9EPuulfsEopQ/nicq52PoL X-Received: by 2002:a25:6902:: with SMTP id e2mr15782749ybc.30.1600041909333; Sun, 13 Sep 2020 17:05:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600041909; cv=none; d=google.com; s=arc-20160816; b=KpfrVXui+N2ttXws1YtusxEQmfSrIFQ8Iswh8D6Sd3olhotArUqSLIyyC9OcOtaEju rgWVBa8y5Wx4A0fFtYd2JtuZiEog19Vkg4Rw+fmkHl1zhyGczC68uF+LmvsoGNsJ7Vi4 nCrx/ysIdiRjMVIHZOHn+DvmCtOP2qd6r8GMtCuqM/X4SeII91swTy92l2IyVCodbHFI gh80c+WWl6hUTdzXMVSmAHYM07/imXbtVIjkYhKRyAITHgiehkhFmwchDR+eN665/fRO /gIzzZOrG97XNmtyd82eTxD+aOHpjwY+qrPlzVfCYTTmweg2N4DcDRfS4IPv2pjQYCDt KkGw== 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:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=LokPjQNyghrgWvJ1kJqbWazyHqKRlOm6HdtdDxRh6d4=; b=CvZaMQM8Dm+3wNaCeFJO5K3kxIj+nATfUg3jfO/PZthL2bG2OhUfyMHXbuo2ye0Z/K huVS9/Rs028dpPwq8u5ePKlC2LLq6a0FMZlHV2VbOrmS/P5Iil0dJVtn8wJ10arROXvE LETg8bIdA4pqgKZlfrixtejVXjRvOqbNbImCh0lU52KWSpiT7NYIHShyfAQrJOfxwnuU QSCJ3lxJYMM4IFUaQ3zZnAa7mJ8Hlp49sABWvuqhhf2Q2gBWjXWPljka+13s96uX/SQ5 4Z45QSrBZ71+H6mkxPZwzkyrj9hKSZueNGc+ItV35xxcdbfSQZ9gJBk+zefyp+ky1ouK KyUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Gt1ubhlq; 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 e14si8852021ybk.391.2020.09.13.17.05.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 13 Sep 2020 17:05:09 -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=Gt1ubhlq; 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]:41506 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kHbzY-0007tZ-QM for patch@linaro.org; Sun, 13 Sep 2020 20:05:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43612) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHbwf-0002nO-Vw for qemu-devel@nongnu.org; Sun, 13 Sep 2020 20:02:10 -0400 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:35911) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kHbwe-0004Ce-3O for qemu-devel@nongnu.org; Sun, 13 Sep 2020 20:02:09 -0400 Received: by mail-pg1-x543.google.com with SMTP id f2so8059451pgd.3 for ; Sun, 13 Sep 2020 17:02:07 -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 :mime-version:content-transfer-encoding; bh=LokPjQNyghrgWvJ1kJqbWazyHqKRlOm6HdtdDxRh6d4=; b=Gt1ubhlqQj/dgrQHS3dAMAJVgPNkILwwnw6vl1cIccdKZtEaMiAnNsrazKoZ3jo7nL pT1sUWK13y+qE1bfexEO7t88PDk5G91WDrbbLr9alPpwuAH6+7dkgWizAsG2IEDFTJ+8 GOVW6Q/bkwzYdeFwLh5Q1VIpOp4xsYP06DCDv/FI9RRkurcbaaQsCkl8RBxdsglUJ3sh 6hjppK3xr43PMXFwSyXFTwIUaawSNQpzHJMqSlmt95dFBtXdZbq+txRhROUwg1Qphq56 uqwbku1rZLef6Aku1w7wqYHcr/QVYQW8Dnp6PeV4pOFLAcfv0kjgKKug3I5nZvD3sbDo /F4g== 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:mime-version:content-transfer-encoding; bh=LokPjQNyghrgWvJ1kJqbWazyHqKRlOm6HdtdDxRh6d4=; b=Fp6SUoLCHTe42rjbMXZ30oDW5bz+O4Yg8f7qTP2vD6nSvVrFG5q9jNpCs7JAIJtd9C goTYG3ed9PPgbqOgXN3Mvyce3uPCFey6URjNgi1QLdQcMWDCpc9I1wSmUR7Rl2o6kIMK O8Uj/6+M9NyHgz9gF0ZxMJitE0CV3AZvSGAzUBkqCqOuhhNNHQS7OvKFOr8EVa+6lKRY j06JlwO3iEIgtQOBFhlwvQ3c6nVEwaYM2XiYWy86A2gIKei/FnAN4p+syOwKh6/GhC3G xW6q6GkBr/5jQxQmqZfc8mjnBhW08KCxL6Yi3odMULG2AURO/qMKj97b/mrmZKb6Nxnw xaHw== X-Gm-Message-State: AOAM532guhP0TURl3VpzWk1Sg+z5rp+uGM0Hn4bA289Pk13KpVLYb26n 3YHRiSwRSSKTG6wYbPKOeFrBE75tSgOFOg== X-Received: by 2002:a17:902:758b:b029:d1:bb0f:25fc with SMTP id j11-20020a170902758bb02900d1bb0f25fcmr8301573pll.40.1600041726466; Sun, 13 Sep 2020 17:02:06 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id 31sm6538252pgs.59.2020.09.13.17.02.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2020 17:02:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 09/11] disas: Enable capstone disassembly for s390x Date: Sun, 13 Sep 2020 17:01:51 -0700 Message-Id: <20200914000153.1725632-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200914000153.1725632-1-richard.henderson@linaro.org> References: <20200914000153.1725632-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::543; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x543.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" Enable s390x, aka SYSZ, in the git submodule build. Set the capstone parameters for both s390x host and guest. Signed-off-by: Richard Henderson --- disas.c | 3 +++ target/s390x/cpu.c | 4 ++++ meson.build | 11 +++++++++++ 3 files changed, 18 insertions(+) -- 2.25.1 diff --git a/disas.c b/disas.c index 7fb85bbfa8..5e943181d8 100644 --- a/disas.c +++ b/disas.c @@ -208,6 +208,9 @@ static void initialize_debug_host(CPUDebug *s) s->info.print_insn = print_insn_m68k; #elif defined(__s390__) s->info.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__) s->info.print_insn = print_insn_hppa; #endif diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 749cd548f0..2a96692691 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -44,6 +44,7 @@ #include "sysemu/tcg.h" #endif #include "fpu/softfloat-helpers.h" +#include "disas/capstone.h" #define CR0_RESET 0xE0UL #define CR14_RESET 0xC2000000UL; @@ -182,6 +183,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) diff --git a/meson.build b/meson.build index 4839bdabab..82cf4a9258 100644 --- a/meson.build +++ b/meson.build @@ -661,6 +661,17 @@ else ) endif + if 'CONFIG_S390_DIS' in config_all_disas + capstone_data.set('CAPSTONE_HAS_SYSZ', '1') + capstone_files += files( + 'capstone/arch/SystemZ/SystemZDisassembler.c', + 'capstone/arch/SystemZ/SystemZInstPrinter.c', + 'capstone/arch/SystemZ/SystemZMapping.c', + 'capstone/arch/SystemZ/SystemZModule.c', + 'capstone/arch/SystemZ/SystemZMCTargetDesc.c' + ) + endif + if 'CONFIG_I386_DIS' in config_all_disas capstone_data.set('CAPSTONE_HAS_X86', 1) capstone_files += files(