From patchwork Fri Jun 14 17:11:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 166859 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp2346540ilk; Fri, 14 Jun 2019 10:48:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqyzcpbMIXqOl99Bz/KU3yAIptQm1edxbxF1jIS7cNifk0+o+il0i2zbNoGd0gLbrg5Oway6 X-Received: by 2002:a05:620a:3da:: with SMTP id r26mr59747074qkm.279.1560534518113; Fri, 14 Jun 2019 10:48:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560534518; cv=none; d=google.com; s=arc-20160816; b=s24EwRx4d7DZwx3AiFD2rwBHFXiyYaL25LXX8iURgz2Npn78ywcJTI9bNiq6a15399 1cu0QAGM5nFL3WTlru0euk8jCXtb1Vb7AlmBa0kiqRoN5PSM2MZytEvSs3KxEsV62rNl DxwD14RR0TfyxjQqLXb4uBO4cFjijG+AcDKieU+HTZnGrQGyg8NqTVc9Al/G0Qvve5+8 N9ZgooLZbK893Pwwpx/fQpengBdIf1OCOi6CLml0yv/hZyeayvAqvw0cB/EVToc9aK0T 2n4Pd/qmZ862Dcg+htiUrAV2ftXPWozqbFLAyRC18JmQ3/8PdrAAKe4U0OffR9eGTWwB xoiw== 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=8XTuXWq+xToiDvDobeS2vNcXere9quLdtk1afgwMbsw=; b=iWUjcB0uDoh/2ygq9aW7mhlNKHCRACcbrp6f/NPHIP/cgwnICVGrfv+XtA+WYyzoqI d6e4alWZQ6tQ+8y8Eyhwe4cdN74xznLnAQW1CWhMbmsp2gqAeQwo/IGe22ccQIdmUzkq bQP9qDbIC7iMz6IP4xleIXf1e2JCsyS2U9kF595PjNEpiSnN3mS/hxQavDljV+jsXUi2 UAnNvj8r0635z0eRAmZhgBR37WKtrGwEnJvmDQXqR2GEr8YfvkBPr9CpvbCJfYBXJXvG 9YIfQt42JS/lz7tZfXgUzsHPpinCLRgwr8Y4unTNpynVFHOA6jjU3654Hu8cDcIfZs/I BxQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=eUVM8nN6; 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 q1si2289089qkd.157.2019.06.14.10.48.38 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Jun 2019 10:48: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=fail header.i=@linaro.org header.s=google header.b=eUVM8nN6; 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]:53878 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbqJZ-0004OB-Mv for patch@linaro.org; Fri, 14 Jun 2019 13:48:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58659) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbpqi-0005b1-WF for qemu-devel@nongnu.org; Fri, 14 Jun 2019 13:18:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hbpqe-00078J-Nj for qemu-devel@nongnu.org; Fri, 14 Jun 2019 13:18:47 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:36067) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hbpqe-0006qu-4Q for qemu-devel@nongnu.org; Fri, 14 Jun 2019 13:18:44 -0400 Received: by mail-wr1-x442.google.com with SMTP id n4so3355670wrs.3 for ; Fri, 14 Jun 2019 10:18:38 -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=8XTuXWq+xToiDvDobeS2vNcXere9quLdtk1afgwMbsw=; b=eUVM8nN6O/n9aKdS3bQfPIk2EUYVBkSwKKk+0eUD9ncmNkyjrkOl9EqQkQdvQcNika h4wZCvr0t20q9czaW07g3V7pE4zajKot9qW3N5J7oJBlWo0fWdz3sNe4EzGlCvr7rQa9 2qn8BmW79OrGf0NKnGKeYzSuVFM0BJSbrrZKm4fuLD2a28t5D8dxSA7k3MjOPj/uNIrq x4lY14vVitaFllD4HyhrFQW7I+uJPo7PjY7hcJJ++jedSMj67CWWbHj/ajKcDt69RSSQ IvEtWK7FqhawC/2LdSWBr2iiXY+MypOUCYfGMBWo+Z91ozh2XouWt+kQOcfmkOpR27yG ALyQ== 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=8XTuXWq+xToiDvDobeS2vNcXere9quLdtk1afgwMbsw=; b=dsWKwQQpym+QwKTCCq3KH+jaCcaMwUB/Et7nBUzfYtUTJOPwLCc4inNsNGfuEZZw+O QXRnbBqHjZTeVp0HXp2rDMK5yY9yvbiBAT3YHKf/d+oo+Fu49PwSQR6tW/19tO128XOq AyyQIKHU0u2KiBNgeP7q3Slgc/nbClO662lSGmoFIxmZ/6kUuMtYPLBu4rQblhzlf5z0 uvlwDt37+KVhY5ywAknYaVEXlvbPZQHd5MWltN1bK0/Kh+hchYlXNaoVg3bMbgcgd21R Zes5miJHWUKIPJxJ4lPzXd0BleEomGTjxrxLxf143jPx8/vdjcmSpSugna8WrWLS1z6C lWkg== X-Gm-Message-State: APjAAAXPKs750O+xGluvx1Kv3pljrry+YPhlAxmgXlsfhFsUKwCIgAP3 KUq3tRhSQTGfOGwFpRmQY+A/q7ppNdo= X-Received: by 2002:a5d:694a:: with SMTP id r10mr43467409wrw.345.1560532718017; Fri, 14 Jun 2019 10:18:38 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id x11sm5694362wmg.23.2019.06.14.10.18.29 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 14 Jun 2019 10:18:33 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 02CBF1FF8F; Fri, 14 Jun 2019 18:12:03 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Fri, 14 Jun 2019 18:11:38 +0100 Message-Id: <20190614171200.21078-29-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::442 Subject: [Qemu-devel] [PATCH v3 28/50] target/sh4: fetch code with translator_ld 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: "Emilio G. Cota" , =?utf-8?q?Alex_Benn=C3=A9e?= , Aurelien Jarno Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" There is a small wrinkle with the gUSA instruction. The translator effectively treats a (known) gUSA sequence as a single instruction. For the purposes of the plugin we end up with a long multi-instruction qemu_plugin_insn. If the known sequence isn't detected we shall never run this translation anyway. Signed-off-by: Emilio G. Cota Signed-off-by: Alex Bennée --- target/sh4/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.20.1 Reviewed-by: Richard Henderson diff --git a/target/sh4/translate.c b/target/sh4/translate.c index 5a7d8c4535..922785e225 100644 --- a/target/sh4/translate.c +++ b/target/sh4/translate.c @@ -1917,7 +1917,7 @@ static void decode_gusa(DisasContext *ctx, CPUSH4State *env) /* Read all of the insns for the region. */ for (i = 0; i < max_insns; ++i) { - insns[i] = cpu_lduw_code(env, pc + i * 2); + insns[i] = translator_lduw(env, pc + i * 2); } ld_adr = ld_dst = ld_mop = -1; @@ -2332,7 +2332,7 @@ static void sh4_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) } #endif - ctx->opcode = cpu_lduw_code(env, ctx->base.pc_next); + ctx->opcode = translator_lduw(env, ctx->base.pc_next); decode_opc(ctx); ctx->base.pc_next += 2; }