From patchwork Sun Jun 20 22:10:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 464358 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp2002904jao; Sun, 20 Jun 2021 15:14:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJze7+jA3dj+wB2ct2GRisTy8ULbOujtSnDkYZZtkDuxpLkiaVtMnvUHnESvRyyyqyJG2sDe X-Received: by 2002:a92:dc48:: with SMTP id x8mr2471361ilq.213.1624227282447; Sun, 20 Jun 2021 15:14:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624227282; cv=none; d=google.com; s=arc-20160816; b=B5nGuz8WgX4GI4tbla/8f8lEekD4yfUsHVGPoKagpqX7/ozdZLNzL1Q2EmR0+KC4i0 1o4RKjoZRTxvbwOaERG4S+whaU+RWef13CfUuF3gz9cwShLNZkK2FllAwGCbLdOuc62z WK24VelTrfTYAKl8K0sAwDdHjePp3GLDEuzWBVrwOPTIrT2DMbArqgnqKx9ta2bRU1r8 7HD9Zh98CX345H5MgoL/MCwsVSEbHVcEV/y3/Meb+TL6c4xdSCUNON6/fc/1+OcJtn86 1HwwORqmOpzXEY9ab36rsrJxlha/W7y90szq7jb+WvmINJ4oN8YVheYvCLRaWbNgiRcq OJhA== 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=yw4nXpsUXP/IcY+QkLFOYlqRS4uebEjEIFpOqCI8OKc=; b=O/JmV7uSWCM9jzDN/iQhm89ou380NIz+6wX+U7hO3F1Rwa6lpa5DMWNV8GTiFA3rxv 8Q6eSHLpaBSWunbxNAWzjTYakPtB6tpAff3PgSrfZ29grjovfPLJZ7W7ZooFJkwaie8p hUlAN0xqfh3u2UcW+iR+UuiQicNB46jqrEQVQsHwuZCijhFjgj4lKiTin1IuP3CZkQV3 13Tm3lHWbDrzxBow6C0BHzOMSgQeBdDIszAZGrq+Uu7Mt0YRnW7vBtiJ6VToL4QCI6oM hed1tjM7HqrHmnQGjiPV233Egj1PG+HPMTeaCuIMPfix/0mJxpyu5yizG2p0WfcNTUuT /bVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=gkZzBwRE; 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 s11si5518402ioo.1.2021.06.20.15.14.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Jun 2021 15:14:42 -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=gkZzBwRE; 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]:60950 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lv5iD-0007MY-TV for patch@linaro.org; Sun, 20 Jun 2021 18:14:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46258) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lv5eY-0001co-Uk for qemu-devel@nongnu.org; Sun, 20 Jun 2021 18:10:54 -0400 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]:40708) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lv5eW-0007sw-9E for qemu-devel@nongnu.org; Sun, 20 Jun 2021 18:10:54 -0400 Received: by mail-pg1-x52e.google.com with SMTP id m2so12557001pgk.7 for ; Sun, 20 Jun 2021 15:10:51 -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=yw4nXpsUXP/IcY+QkLFOYlqRS4uebEjEIFpOqCI8OKc=; b=gkZzBwREd7t0VrFYbEpVxo0bfctP2rWz6YAzFS7EMwEQqrQvdGW81MXcqG9t9bV9Dg tnObhQWonDsKXk+ioNcaGDT8bJGQgneiXRJOkXynqix07ozOcM+CcEYEf3w4v00kyA/i dsNj2yZEqoLXPyVK4kUlygZd/p1xem+KS9es1ADJMfr8BYjIlH9vKWfKifvir3PTCnbs JZLTNawv2c23UCiX2uYv2a0TyDtsNmS7vemOP+IyMpXdUO/fEg9qShh0G5pwqKCERNib JmSa41CSpjRzI9m4cti3kalWYNCvuAngWGx/giH3/xtx6B261jTI7G7GeSfo/cERZ1Xq 1E5w== 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=yw4nXpsUXP/IcY+QkLFOYlqRS4uebEjEIFpOqCI8OKc=; b=qPH8+qlT+WXApE24E+zIhGEhirce2hh9jt22UVDAY5MFr/Jgy5DBUrvo3qMfMOMbjQ /JUEdQTDr+imzDhjxour1+kbxZaLrNectA0ZrP3l4g4FT0g9w4l8fKWFnW0c3Hx4W4gV CxpH1GetwN/jjiO89d+WmJU1vhv/2gR76BX9AQaVjCtaG2B0oXkkaTqoegZemUHZ1KIJ BzutbK4WIq0W2I5a1d0Xy8t3mXjEAWxMtQWeFMtxND531NPVfjzDFmAYNIcHjG4OT7Bt GY5/W6MmrDx4XHGbZqFJ195f0dP99IFiq987Gz8yXfUVAaFbif+H/M03n4s3Dc+GDDmk lcCw== X-Gm-Message-State: AOAM5313n6uWYK9MNy5U6gt4j3RNnCb4jIbUbnHSfs4QpZrKuzMcHiLa F91UtQsAgrudCMnqlUxNg/8VsLQpyTy3xw== X-Received: by 2002:a62:7848:0:b029:2f7:4ecc:f14 with SMTP id t69-20020a6278480000b02902f74ecc0f14mr16081777pfc.77.1624227050998; Sun, 20 Jun 2021 15:10:50 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id 135sm11122961pgf.20.2021.06.20.15.10.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jun 2021 15:10:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 6/7] target/nios2: Remove assignment to env in handle_instruction Date: Sun, 20 Jun 2021 15:10:45 -0700 Message-Id: <20210620221046.1526418-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620221046.1526418-1-richard.henderson@linaro.org> References: <20210620221046.1526418-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52e; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: marex@denx.de, crwulff@gmail.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Direct assignments to env during translation do not work. As it happens, the only way we can get here is if env->pc is already set to dc->pc. We will trap on the first insn we execute anywhere on the page. Signed-off-by: Richard Henderson --- target/nios2/translate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.25.1 Reviewed-by: Peter Maydell diff --git a/target/nios2/translate.c b/target/nios2/translate.c index 06705c894d..31f63d9faa 100644 --- a/target/nios2/translate.c +++ b/target/nios2/translate.c @@ -740,14 +740,15 @@ static void handle_instruction(DisasContext *dc, CPUNios2State *env) uint32_t code; uint8_t op; const Nios2Instruction *instr; + #if defined(CONFIG_USER_ONLY) /* FIXME: Is this needed ? */ if (dc->pc >= 0x1000 && dc->pc < 0x2000) { - env->regs[R_PC] = dc->pc; t_gen_helper_raise_exception(dc, 0xaa); return; } #endif + code = cpu_ldl_code(env, dc->pc); op = get_opcode(code);