From nobody Tue Feb 10 14:32:23 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 150893509129041.001667563059186; Wed, 25 Oct 2017 05:38:11 -0700 (PDT) Received: from localhost ([::1]:48108 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e7Kwf-0004FI-Ee for importer@patchew.org; Wed, 25 Oct 2017 08:38:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42916) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e7Kq3-0007WX-AT for qemu-devel@nongnu.org; Wed, 25 Oct 2017 08:31:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e7Kq2-00083R-7x for qemu-devel@nongnu.org; Wed, 25 Oct 2017 08:31:15 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:54239) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e7Kq2-00082r-15 for qemu-devel@nongnu.org; Wed, 25 Oct 2017 08:31:14 -0400 Received: by mail-wm0-x244.google.com with SMTP id r196so1625100wmf.2 for ; Wed, 25 Oct 2017 05:31:13 -0700 (PDT) Received: from cloudburst.twiddle.net ([62.168.35.105]) by smtp.gmail.com with ESMTPSA id 61sm2263446wrg.58.2017.10.25.05.31.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Oct 2017 05:31:11 -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=2iMMn6n97w6gqxrsVza5ry/hdw0ZDWk0Pu8fMUSHJVI=; b=Gi9JZfboic5UNxlfFtai6qzCa52j4vdTKGy0aZ9xeP8nk/SAVE8Zo2B41B96UhtzEC jb41aLo2CVdV96Y3wzhej+ZZ2JDY39FTyRYS3J8a86gls6wcxn494uVuP2ckfdJM/Aut eEazcof43oTUM5oSJFEcd1kJ/SQ9ohGsFvWns= 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=2iMMn6n97w6gqxrsVza5ry/hdw0ZDWk0Pu8fMUSHJVI=; b=H5esWvuHARWVMYph1b540JeDUPUeppwc7Rsr94KoTNjgZw3gXs5Iqo5krawHsrU3Oz MjVJ3X+tFDkC5A4teLwf1BNKsKc4NSg+0LKF+SwKIxpdYaXeKtfbZMg3W+1pMQENq3p1 knAtKPPTg0TS0dLWHXmqeLpDlaH9klKK+k4i/SuQdQf8alHLYzEQBJXqUen0rhdqRqtm kB1+xRwqTikkLgCi5E32TJlKzIBKq+Zyxwm+9hAC2XHLnUXhlPnau/vkAGZcv6VulYae cec5iEXndhkqCGy6VKSnTmtzm7iFIidLr28wf4JmmeiborXGVLPSljh0fL+YgXtcXHye Ed7A== X-Gm-Message-State: AMCzsaWUYm3hf5KMuCH2UILeuW74PnAn7nYiuZSToLUFke8iNNvtJk9s Ra6ZVOSTJmF0IDc1hR0nHEUdLndRPhk= X-Google-Smtp-Source: ABhQp+T9hZ8pDm0euagDd9qOEwwVjjyliac+RFES3nyhuPWYQi+DLRHPOeM2QU3I2v0ec3I3tmAYIQ== X-Received: by 10.28.55.2 with SMTP id e2mr1774896wma.60.1508934672832; Wed, 25 Oct 2017 05:31:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 25 Oct 2017 14:30:52 +0200 Message-Id: <20171025123056.3165-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171025123056.3165-1-richard.henderson@linaro.org> References: <20171025123056.3165-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 07/11] i386: Support Capstone in disas_set_info 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: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Tested-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Richard Henderson --- disas.c | 4 ++++ target/i386/cpu.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/disas.c b/disas.c index e392a2926e..63dc573e9f 100644 --- a/disas.c +++ b/disas.c @@ -438,9 +438,13 @@ void disas(FILE *out, void *code, unsigned long size) #elif defined(__i386__) s.info.mach =3D bfd_mach_i386_i386; print_insn =3D print_insn_i386; + s.info.cap_arch =3D CS_ARCH_X86; + s.info.cap_mode =3D CS_MODE_32; #elif defined(__x86_64__) s.info.mach =3D bfd_mach_x86_64; print_insn =3D print_insn_i386; + s.info.cap_arch =3D CS_ARCH_X86; + s.info.cap_mode =3D CS_MODE_64; #elif defined(_ARCH_PPC) s.info.disassembler_options =3D (char *)"any"; print_insn =3D print_insn_ppc; diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 13b2f8fbc5..cf890b763b 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -51,6 +51,8 @@ #include "hw/i386/apic_internal.h" #endif =20 +#include "disas/capstone.h" + =20 /* Cache topology CPUID constants: */ =20 @@ -4106,6 +4108,11 @@ static void x86_disas_set_info(CPUState *cs, disasse= mble_info *info) : env->hflags & HF_CS32_MASK ? bfd_mach_i386_i386 : bfd_mach_i386_i8086); info->print_insn =3D print_insn_i386; + + info->cap_arch =3D CS_ARCH_X86; + info->cap_mode =3D (env->hflags & HF_CS64_MASK ? CS_MODE_64 + : env->hflags & HF_CS32_MASK ? CS_MODE_32 + : CS_MODE_16); } =20 static Property x86_cpu_properties[] =3D { --=20 2.13.6