From patchwork Thu Oct 17 13:15:46 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: 176653 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp979990ill; Thu, 17 Oct 2019 07:08:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXcLlVdWUeg4yemQF7vrd5nUHVZqszbYXrQomc6xlSuiCxhZFVz2u9p8Gv+5OydgCPHfqL X-Received: by 2002:ac8:74c9:: with SMTP id j9mr3985304qtr.126.1571321290579; Thu, 17 Oct 2019 07:08:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571321290; cv=none; d=google.com; s=arc-20160816; b=cd7UjdL8UpGe7FkUFPptnAV5PCCLY5YOwD2OJFQmOdnHeFz1o0rejzt6ELGyE6It8G p6yCuDfKIdPl9XF+AvI6Q8gtM/mNBltETCKxmGbfJ0PA96D00TZ4KDotL68SRmuL99T5 2nGp1gF1rVe87BU1TmCOeCSJesuMDoLJEcEuW6tN0nKG9lyHdEpCIgNjZ2YbAYK8Xbai UuovCXag0upG2iYUlPya6lYAN9Jkh5YIER7Hl5YzjqycVQbw0v6WAZPfLH5UdQ3cSZbC 4RkFCHVhcuXPiuRJ5L1Scrj8+cUfBvCqMx5C19/2fMEEPEJmm1lf/FV2i6nckRHGEN05 irBQ== 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=LYziuWTaDyCvsXZWL+7dYTQAPkm19wADCHnlP8tL2bI=; b=udBNqYEiT7pvfe1FOQazFmNabdE+HKaNUIagY7d+I6NYcxSmYNY2M+5zEKSp8Bq0Pw MZUhd9OSPldJloNOtOg9TunINYSPTIC/6ijikHDAib4Xe3gpHMuDEQ/y/tkqSeO+3Nvc yiBoFxtltl3avNNrXrwCSzxjqqNc20cSSJY0Dd6OfSyhGdtrn3Chmm/H/AAOIwVDGcvx jGO7bFEgRk6f53QDJFMsePR9voM0d0AfLNxHbljrCh/bNUIe3IezL98Z8LaoHlwinSPM gJ+dgMuvZqw7pis0KOEx2qkoLY51X0U+hzDb04izmdrOr2M4T6NTjGcW406STGAMWKhJ vuKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=uvwIHcJV; 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 n10si2225562qtl.331.2019.10.17.07.08.10 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 Oct 2019 07:08:10 -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=uvwIHcJV; 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]:48785 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iL6Rl-0002V0-8e for patch@linaro.org; Thu, 17 Oct 2019 10:08:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35624) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iL5mY-0002N7-IJ for qemu-devel@nongnu.org; Thu, 17 Oct 2019 09:25:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iL5mX-0001JI-EF for qemu-devel@nongnu.org; Thu, 17 Oct 2019 09:25:34 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:55504) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iL5mX-0001Ir-58 for qemu-devel@nongnu.org; Thu, 17 Oct 2019 09:25:33 -0400 Received: by mail-wm1-x342.google.com with SMTP id a6so2548808wma.5 for ; Thu, 17 Oct 2019 06:25:33 -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=LYziuWTaDyCvsXZWL+7dYTQAPkm19wADCHnlP8tL2bI=; b=uvwIHcJVTMPxqYoN2aLnZ1NxqBojTuMg/mGUCpXG86IZunIwoRh+AquVopd4zJF4Qe dcKhCqu9ogf5ehBxPpHFMUOYRLHL4PMW9putiUXq9TfNayI+V+DroIEL+jLI5/iV0ss4 wjl5WHMOR2MIdKuVKgVHQklpcbAnR/rSiKVq6LnPmMG0tGRw9YcfYqHS5z4JNjz8jAWB sZEF9kbJTRrAyx8qV0Fcov7B91pYIc599zbCNVh+fyvdRjzh+8bz3/5t789N1McrNVPy ssRB71E2CxyIanQ6W96540iIKbWuaDaKZKlwBfl7iHKfmeQPNHYdGtPXWS+/+sin1vqu 0fiQ== 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=LYziuWTaDyCvsXZWL+7dYTQAPkm19wADCHnlP8tL2bI=; b=jeDnOHizWEq1Vq5VU41h/h7LAb3lTs+zFqOQ1VtGdyDspRpn+2bL0dzt9SP1RLrk2C TEvYGxWLiuo33wAwjChkWGvnSWM8GlP//CTjc4VjSNmu/Lk11Ml9oETM7/QOKziX56iw WLuWEe31ollQLma0fv1G5qd676nmT2Y8lcO7Iz7M+TiKvgFeseH+Qn24Q5XtgY4f1lLn kcYxASq64sEvQdPWDi0fRG7EzKX2fRnZQy1olmq647Y17bpRCOS21os0UPfDlH10USwK rjcbFg5enDm7CMbazKt4peo+YAJx43nzcMtd/7idFizdp35oE7OYPxSBklPt22qoZlBW SH5A== X-Gm-Message-State: APjAAAX6atEM6XLe+73Ykx9BIZ+8AyUMXVmy0HP6DZND7R2Sb/CAu19X utWKLTXDOcNyx/H6qsnT/gnFRw== X-Received: by 2002:a7b:caa9:: with SMTP id r9mr2822057wml.58.1571318732081; Thu, 17 Oct 2019 06:25:32 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id u1sm2041089wmc.38.2019.10.17.06.25.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 06:25:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4A0841FFAE; Thu, 17 Oct 2019 14:16:18 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v6 25/54] target/sh4: fetch code with translator_ld Date: Thu, 17 Oct 2019 14:15:46 +0100 Message-Id: <20191017131615.19660-26-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191017131615.19660-1-alex.bennee@linaro.org> References: <20191017131615.19660-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::342 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: robert.foley@futurewei.com, Richard Henderson , peter.puhov@futurewei.com, aaron@os.amperecomputing.com, cota@braap.org, =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , 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 Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée --- target/sh4/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.20.1 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; }