From patchwork Fri Oct 25 06:36:42 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: 177682 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3289678ill; Fri, 25 Oct 2019 00:37:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqwG78LpFQnPHmV0F48XTWI8WDQJIFcOIqPz8enyJUlbhD2VC8DeAKRTTgvHvIZ1deaDqJg9 X-Received: by 2002:a37:b981:: with SMTP id j123mr1621058qkf.205.1571989061441; Fri, 25 Oct 2019 00:37:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571989061; cv=none; d=google.com; s=arc-20160816; b=NaUS+f+n7VQmZcAWBu71dYuqMfAnKXuOKdmwInNZroKj15D0cEZMAJcqn1p2guuoDR vD8eJ0bXkjIK4LC3VtJCmhWvADeQPfCtf9JX2ae2u1w1BEzy3sYYAnAoZH5i93ili6+O GnXeyD5cY0fsGuShOBe/4sDRdb53h4YnXbibhRRSrvR/BLczjke/iIpdCUjJ49zSEnjm X2uHUZwq6Jff8M1CJHDCSvOJBSNeg1pAmWV5RbGtcsq18mLYVh7filgxHdSj09zjmJut TgoitYCRwSWkoDl/X4EOvJRWjogsD5nGG2O/15F+awJfg1kDQNCJCZ6EbzlKPmOBonSW YX/A== 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=xEhoj1zEJpx/eHbcjzF4pAJZUeLviMrjuMQMfk2ktQM=; b=Bs/OUlkdNplY+Jbco+l7Xa4ZqKpkT/tPBZ0SpBoCp9KLOLuHaJyNQm3adtgUU+2Pj5 Q7/jOrHDrlRwXw90bASkQctyjmw4DVpE72T+PZgobHWETx2NeqxiFrtyuRpnLx04Blvo xjyxaZuHWCpG0l303eHQSl4ewBBabVrLw7ifuDVDPGQy+NE8fFVH4wH1mW5d6BVLDOtP iPh9nqVXd3JPdkykG4UFJmAGY/aKeznfAYL8f/3FvrQC7XhXoazzq2jj4kepPmgseNCH 6gn+DjBIMjOttNGBnXahgxCxPVJivBtYzOuynBAayUBkR+iI0lPJTSgrqr4eAPrfFzrL VcVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=hJdUnxpf; 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 b6si853169qke.255.2019.10.25.00.37.41 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:37:41 -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=hJdUnxpf; 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]:56946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNuAG-0001ZL-K4 for patch@linaro.org; Fri, 25 Oct 2019 03:37:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40308) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtps-0004S8-Gu for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtpr-00077d-7X for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:36 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:39309) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtpr-000772-0R for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:35 -0400 Received: by mail-wr1-x42f.google.com with SMTP id a11so1027781wra.6 for ; Fri, 25 Oct 2019 00:16:34 -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=xEhoj1zEJpx/eHbcjzF4pAJZUeLviMrjuMQMfk2ktQM=; b=hJdUnxpfVzARh68uiyeBFQXhq+SfZO6AlM4JXKZchVWq+pfDS/LHnsILQoERXChkX9 GzBbzaa3+AmSHWqSTL66K+WTmtgCGS01EgpPmbwwv5rmOlV61sPVJqrRoUIm+dudlg97 OrTeuRFAf2bYVKtUCBy3O3QrD1Rpm4mLMXh/P7mlhLqRwxmcE8wlX2qJHBQc95+rb/2M NPkSlC5HAx/xAy3KqAGT0ainFgBVWtFPzrqjBDfy6CpJmgPy5NPwqx4+TjlbdklpZ5wC 75KIopEIN5+z2Jusjol+afxJ1XEmL90Fzi3XTjgrNDcT4szOm2LnS9SYEtFPtsOnCdsu 2UoQ== 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=xEhoj1zEJpx/eHbcjzF4pAJZUeLviMrjuMQMfk2ktQM=; b=YBQzX4ARso4o5GC+hNg1chPlTfYpkmNUazoo+jgyT22NLUWEgxlDc0hSYUGiqd514P F4g59tUKg41acT1pwGK4No9yZV7ap2Sb4ACd/NU2o4N8cJ9dc+4bgzCq/FZpkeVXeYxT 8lhG7E/OvCVnew9FBcoVzd9aCnqqt9F7JVtpS7y3reId08Xxt8oywHf6v9U6clr4XUVH VEHttAl+MAQFvrnrAijxo17bX4SAu8eZqKShc66rH6HX9FbXczVHTGrrEW7Cswsly1dg jhI39cIaGp+d3IPQm1HPx6Qr2siDP/qUZJsP8iwzb8vlVmLlIhVfEMkU80Ny/JYjdGKT 3lVQ== X-Gm-Message-State: APjAAAVtj62ueo8h3KLd25Ti6nI7JHi/qh75Pn+GCFuleLpv40ReG//D rIRHCX80iDOkjPONXh6hj3veLg== X-Received: by 2002:adf:e28f:: with SMTP id v15mr1387314wri.130.1571987793415; Fri, 25 Oct 2019 00:16:33 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id k1sm315914wru.10.2019.10.25.00.16.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 00:16:32 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BB3BA1FFC2; Fri, 25 Oct 2019 07:37:17 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 42/73] target/sh4: fetch code with translator_ld Date: Fri, 25 Oct 2019 07:36:42 +0100 Message-Id: <20191025063713.23374-43-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-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::42f 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: =?utf-8?q?Alex_Benn=C3=A9e?= , "Emilio G. Cota" , Richard Henderson , qemu-devel@nongnu.org, 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 -- 2.20.1 diff --git a/target/sh4/translate.c b/target/sh4/translate.c index 5a7d8c45355..922785e225e 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; }