From patchwork Wed Nov 8 20:47:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 742245 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:110f:b0:32d:baff:b0ca with SMTP id z15csp511139wrw; Wed, 8 Nov 2023 12:48:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IE3SIo/3mT6zV3lwgN00Aj6x3Cpy2fAl6DmL7k5oGHeKZrXCuhLOJnXkdexiQZ2kJXpH9FJ X-Received: by 2002:a05:6214:1c45:b0:675:4b15:5840 with SMTP id if5-20020a0562141c4500b006754b155840mr2869779qvb.60.1699476523227; Wed, 08 Nov 2023 12:48:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699476523; cv=none; d=google.com; s=arc-20160816; b=Gk8OdBZcm+SIcJzpb7Pe291MNNrTlYainumJpyzU0Trnr+cIEzqwYB/4B77eJZAA4G 3S84CMDGirsIeL5dvECypHHiBb6bqEFY+UNVG50tGDJFX9A8TG7znmqEik9xtDt8GF5S WyJcmOP/rMtiTuR0gUV0MuXjmfRWK5QmWaVjwhZMX5gNevXv19+4nnLAyughQvScgSHR FRWBgYoHJa7tNe3tfY0r6Ymk4wBP91nMwBqaBW0VHR9jZo7l9ilggnsubJ+TO4/yu1Jk A4zwH7kivc/ughW1NVGVM13z77RRjCFCe3Bc3/MTK/153QcICFJEM2kfLzH5NyVbcDe2 jPSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=scT+sRR1RlfBaEkZGKgXcul/nvcA1boNQHmxmdbMth4=; fh=rYI8DiHAAFX3O5g969KmOAQ7d45Sb8OxQX1+DywGDk4=; b=AF3IiFKHxV/krcmeNFQX6bZPacF1k5gMcc7ee40AQRX/yOm5J1jejrKK91EjYZJkrt 4M914BU7+jgEaesM/R3ln6W+pGALFxS7gZOTitg11DB5E9poEFw9EvI/tNfM9GH4OPbW 4R/f5ruUZEuS7kaSF/x6Ljda/nU/yM94BuRiHuH1VkOVP16mmePkR/G1UYNKQKpi+kPf V8vgNFuzwV7nrWTrfpVUfUxI7mDEMLsZdC67vjnTSIAVM21gVBzahbt84dsAZuptnjcT wIc0JzsGTvWoI1Fz8Z+MlRphGY1jj6EV1xDKBr07dGM0GtAaolHrPHlaLKyh6Ira9ESB ZmfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I2LqSYPe; 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=pass (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 u17-20020a0cf891000000b0066d113e536fsi1945337qvn.300.2023.11.08.12.48.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Nov 2023 12:48:43 -0800 (PST) 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=pass header.i=@linaro.org header.s=google header.b=I2LqSYPe; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0pSy-00087w-69; Wed, 08 Nov 2023 15:48:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r0pSv-00087j-TN for qemu-devel@nongnu.org; Wed, 08 Nov 2023 15:47:58 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r0pSh-0001qS-EK for qemu-devel@nongnu.org; Wed, 08 Nov 2023 15:47:56 -0500 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1cc5b6d6228so559175ad.2 for ; Wed, 08 Nov 2023 12:47:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699476460; x=1700081260; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=scT+sRR1RlfBaEkZGKgXcul/nvcA1boNQHmxmdbMth4=; b=I2LqSYPe6X5oVONGfGDuOm7X8wrZgP9TKVKz4tUKCIxhNHW3nqfVwwubkgccsqLueD jtc0NE6xOhINfz1htUuJgScyKb8i1I5Y6GZMH62ADLZNMmX/H+BLj15xF4E/e8YT99kZ 2XBIiR9suAWHzXLX9V6DIO5NH7Js5KAhMGy+fR4qQ595I4jxhfFvdXa9UBUu/PzR9bH+ sukoYbrYXSAOlmmRyrCir1NpSrizpA0QELK2sgJlYSeRJQC3FA9zXfTRm2Dzn7L5oY/2 rPhMjZEn42jdFXFdIqrhjaoDOCL4mm99QY8gHvmICPKjDM6YPT9Gf3AemGf2nTnESIIS Ihqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699476460; x=1700081260; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=scT+sRR1RlfBaEkZGKgXcul/nvcA1boNQHmxmdbMth4=; b=JuV8em2OCvVFQ+3xi0jECl+ADoIjq9EZKsA+WmWmLxKGxcX0dKlDJ4bQXmigO8tkR/ 2GrVa0stqlS8Wb253TKHKmhvi0KNn91SSQeoAgLV6COqACZLdHtwz9zkFWJOaGt8Gqch oQq7vn4bhSPDo6lw/A1v5c/2X7+RKQ80czeYDpxNbyC4+rbNZhKWZ479uAGHq2FDG1cz AALWuAQBLth2xwOodcGENsA8gGDJIysF0/OS9pE4wA2cBXakuGztF1eXgr+eVCCVgXdp mcysiSniqXeMixZOzqOtquziKhPvKkFB1vmzSJEeAjhXnh9hkqmtFXRHsc1Yk5WhSbTi bm9Q== X-Gm-Message-State: AOJu0Ywyw7Wg5RcyzxWSQpNCDBYjn3OXFj3rWk0HxbONJOb/385af191 EcU7EemhA7W4MtGsihJQvv40PG6KJtW9YZC+ZQc= X-Received: by 2002:a17:902:ea05:b0:1c9:e4f2:a39d with SMTP id s5-20020a170902ea0500b001c9e4f2a39dmr4002341plg.49.1699476460374; Wed, 08 Nov 2023 12:47:40 -0800 (PST) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id s16-20020a170902ea1000b001bb0eebd90asm2113527plg.245.2023.11.08.12.47.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 12:47:39 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland Subject: [PATCH for-8.2] target/sparc: Fix RETURN Date: Wed, 8 Nov 2023 12:47:39 -0800 Message-Id: <20231108204739.279972-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Perform window restore before pc update. Required in order to recognize any window underflow trap with the current pc. Fixes: 86b82fe021f4 ("target/sparc: Move JMPL, RETT, RETURN to decodetree") Reported-by: Mark Cave-Ayland Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Tested-by: Mark Cave-Ayland Acked-by: Mark Cave-Ayland --- target/sparc/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 6fc333a6b8..9387299559 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -4096,12 +4096,12 @@ TRANS(RETT, 32, do_add_special, a, do_rett) static bool do_return(DisasContext *dc, int rd, TCGv src) { gen_check_align(dc, src, 3); + gen_helper_restore(tcg_env); gen_mov_pc_npc(dc); tcg_gen_mov_tl(cpu_npc, src); gen_address_mask(dc, cpu_npc); - gen_helper_restore(tcg_env); dc->npc = DYNAMIC_PC_LOOKUP; return true; }