From patchwork Fri Jun 14 17:11:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 166906 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp2359996ilk; Fri, 14 Jun 2019 11:02:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0EcnhsbGI4bVSLGfBJeotBsRAGJysCh21fP3NbwT4fiS7AUDmjzBdiKSkny0Vdirok/zr X-Received: by 2002:a0c:d01b:: with SMTP id u27mr9513178qvg.88.1560535341469; Fri, 14 Jun 2019 11:02:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560535341; cv=none; d=google.com; s=arc-20160816; b=uJkkKiU3NlreqnjtMzhmgFXFEmn4fgAnnxENHccK5WQ2Rqv6LB909H4bNV76oKs5ze cHoPeOzou2AvTo+1uWddtTaS9LV1xVM3wCGGjirDb+0KGNRPIMzx/dLkEdfm7V6bRHoI jXzMVIdWIUDdojXAlsOcOkXEM4cSaYNw0ma+oRRsX3HLKXAGSoEzrnTsfBMqZGpFKdWP bM0VDV0Hks+XodDoZX0KR9e8mQQPfgFfeQkJtP90TU0MXzyzMmTcFvyhPBZOVZmXeG8I 5sRGx5V9XUBLDtK4r3ESTOuxJrulZA2Ck1UT3eXTCbfOqFYZSPXB8rqi8xVaXm+KYPcQ sogA== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=2raPXKCjQecpuTN9hXy4UgLzVxLUbna9Nio0I94YsC8=; b=oB3F9Dc3yWMgeHMqzt75B8sbLn3Bx4+qQ29pNP3IguKC2n6Sx2lTpZ9cBfx4IMToed odtDYCxIIoh5MhNUgLhBEYbO4OjW3E1qtecw6ApdjnsBS7OCkhKIr9f7tmiWkaQFIc81 qZIjChXvOGqxxj2RNFi3mDFSBiTMpt7OuVOKZDG7AA/O3bi6+gCyqAeIXtyJqPKtI9w3 gxU8TRE0djvUpKvU8daPECV5AjFajZ0sRCgW7TCg9GQXqjB9xs+mt1QLBlIcvS6swAZb PEz+gyCH/+UJcCtA2/UshB6Zch8gOy8O0K9ZkaZfjHpScwqGiX2tBKzaQMYGY1VFuCKd /LGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=fHIEQqOl; 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 p37si2019594qvc.125.2019.06.14.11.02.21 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Jun 2019 11:02:21 -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=fHIEQqOl; 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]:53952 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbqWr-0005Mu-2T for patch@linaro.org; Fri, 14 Jun 2019 14:02:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34066) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbq0J-00076Y-QM for qemu-devel@nongnu.org; Fri, 14 Jun 2019 13:28:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hbq0H-0003ys-2l for qemu-devel@nongnu.org; Fri, 14 Jun 2019 13:28:42 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:33823) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hbq0F-0003jW-Ks for qemu-devel@nongnu.org; Fri, 14 Jun 2019 13:28:40 -0400 Received: by mail-wr1-x432.google.com with SMTP id k11so3378355wrl.1 for ; Fri, 14 Jun 2019 10:28:29 -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=2raPXKCjQecpuTN9hXy4UgLzVxLUbna9Nio0I94YsC8=; b=fHIEQqOlAsL5rWVjXzym6dN6zDbrXls9Ad0tWpiamMdIHCeBDhehwQM/onGIjLq4m2 YNC6nufwMJcnOj4D5dH+sMeN4GMK7j7mQol6WPeniyBIg7z1so8YsgGTrzJNrMpYbrYN lexy/IINpQf58DDF9AGoWrkwpZXoFwfOGgiS1RL2C1vUutiH9zVuf8MfIrbQVzLmqeIB F4l1x5FZ1EfLFPtSIvdfUBQ/LMHu8/CPngMfbIZN1rZ/6/HgJPsSEP15mMpmVqR2vagX gdn7PN1qZRHGge7SlAXuvEBpmVIAJxjLa+aiB/LkiYjCnGyFEMAQe6p+xupGvFbh7t9L /7ug== 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=2raPXKCjQecpuTN9hXy4UgLzVxLUbna9Nio0I94YsC8=; b=D6/sKpDvjVHJFLLTH7qqY4vSD6JxF0SBNJf78jREg1ysbV/8H+8QybItuic2yO7fTL GB0g/4bIDB8M04MsuUkHRf8dUNh7uJlrZDYBEVP9a58GSDsPF03DvmIRmm5BRr+hibZj Awk9w4MGTtYexmGSTEtHJkw8jgCV+MUKWRcHhsZMGsufckumu5s9EcgRrRz8tn/DXuws UiVOCElY/twah3K6PTybAqXnmhPP5XWZnVvbFWG7IY5hvhKoLqOEOWUawwxHRjF1Q2lR jotzOq6nl5rrDTkvDXKjz5FOMgTNf7lkbbWTMlVumHpB5KiGlO+YIHAodd80gh63kILw 6QxQ== X-Gm-Message-State: APjAAAWInd5rF/X8/6UUrpm1u5Ef0nu/t83k2TDK7yMan5fj19szNmpl 8532ipT+bTUKoIevuhqBy1jBvA== X-Received: by 2002:adf:a201:: with SMTP id p1mr33627107wra.113.1560533307829; Fri, 14 Jun 2019 10:28:27 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id l19sm2196683wmj.33.2019.06.14.10.28.26 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 14 Jun 2019 10:28:27 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D06BC1FFAF; Fri, 14 Jun 2019 18:12:02 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Fri, 14 Jun 2019 18:11:36 +0100 Message-Id: <20190614171200.21078-27-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190614171200.21078-1-alex.bennee@linaro.org> References: <20190614171200.21078-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::432 Subject: [Qemu-devel] [PATCH v3 26/50] target/arm: call qemu_plugin_insn_append 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: Peter Maydell , "Emilio G. Cota" , "open list:ARM TCG CPUs" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" I considered using translator_ld* from arm_ldl_code et al. However, note that there's a helper that also calls arm_ldl_code, so we'd have to change that caller. In thumb's case I'm also calling plugin_insn_append directly, since we can't assume that all instructions are 16 bits long. Signed-off-by: Emilio G. Cota --- target/arm/translate-a64.c | 2 ++ target/arm/translate.c | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index ae739f6575..25dd34a745 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -39,6 +39,7 @@ #include "trace-tcg.h" #include "translate-a64.h" #include "qemu/atomic128.h" +#include "qemu/plugin.h" static TCGv_i64 cpu_X[32]; static TCGv_i64 cpu_pc; @@ -14205,6 +14206,7 @@ static void disas_a64_insn(CPUARMState *env, DisasContext *s) uint32_t insn; insn = arm_ldl_code(env, s->pc, s->sctlr_b); + plugin_insn_append(&insn, sizeof(insn)); s->insn = insn; s->pc += 4; diff --git a/target/arm/translate.c b/target/arm/translate.c index c274c8b460..d049844b4a 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -12122,6 +12122,7 @@ static void arm_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) } insn = arm_ldl_code(env, dc->pc, dc->sctlr_b); + plugin_insn_append(&insn, sizeof(insn)); dc->insn = insn; dc->pc += 4; disas_arm_insn(dc, insn); @@ -12192,11 +12193,16 @@ static void thumb_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) insn = arm_lduw_code(env, dc->pc, dc->sctlr_b); is_16bit = thumb_insn_is_16bit(dc, insn); dc->pc += 2; - if (!is_16bit) { + if (is_16bit) { + uint16_t insn16 = insn; + + plugin_insn_append(&insn16, sizeof(insn16)); + } else { uint32_t insn2 = arm_lduw_code(env, dc->pc, dc->sctlr_b); insn = insn << 16 | insn2; dc->pc += 2; + plugin_insn_append(&insn, sizeof(insn)); } dc->insn = insn;