From patchwork Tue Nov 14 19:26:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 743795 Delivered-To: patch@linaro.org Received: by 2002:a5d:67cf:0:b0:32d:baff:b0ca with SMTP id n15csp2364118wrw; Tue, 14 Nov 2023 11:27:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IFzjVbCOilRxxTMqED0NBh9WbRPOV5eW2FAyGUBFWkv9jzoxjIKpqGocmmMYe20/Bx0c98L X-Received: by 2002:a05:6358:8a6:b0:168:d0d4:d8e6 with SMTP id m38-20020a05635808a600b00168d0d4d8e6mr4846920rwj.16.1699990050363; Tue, 14 Nov 2023 11:27:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699990050; cv=none; d=google.com; s=arc-20160816; b=HSKyiDoBLmLv+5KfMjqIwe1hAdk18R10rzjactkMINtggDXwj/g7NrEInZ/vvE6qTn CNbbgP4qiA12v5Ij5We1LV0BzeHRe+gzIxVQuLBIPlgmbVs51ruEaTnihN/lnGSKXsO1 jjTZ+R5RxzgBqa+EQX9gnqKC8j82YFCe0kzbp4pC7JEomPu6zoc9zbC3ysXFlSZc9GWL IQMnczqHakV3Mzn524oUpEgE5WMDOIh1YlIa5UqqxKDtQI9QmTwpfSdvaPYaYFOB09m1 /zcPueZECAielPv1qa5DE3WKgedAApgwpaCRkd3WSwjD6/8itWrFUOm3q/AMc3cDAckg 2GJw== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YU1go63PndchrVnK6DHWLmkVnDCLAEuAU/t//fUCSL8=; fh=J4M4Z4TZxvAT8lkmK1LtxqMjpO7Qiod4IMBL2bk0hxA=; b=wqMaJcWZ4twwXuTf3sbSDUJMyy9CzpxCsLwP8/9pGfwtiySS6W7wuYBBsOH+xBD3Nn l2YXleSINDVj+zMXRyg5LYUel8iTVn/xvYIMJFX767fPHdE5nLL8W8mTqWCaMR+BN6OT CpGpTrJJR5N0HFUsJIKCj5D8owrGBPw3YnUTlozwp06Rg519S7tu9RRq7CzEg6i5x+En Pv+HUjXcHxKkZ1jRkvG9Ud24RKTUCEb1TG4xldUFGO0EK5TIisTk0ZI8CljDyM074L47 Pz+ROjghKNfL+l6u7OKegQeLCh5/mgrBp8nVYvx+lN4USodULaJSD/Z0GsZY3+odPEsF ho2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=apjY9uTQ; 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 g13-20020ac87d0d000000b004069f6c1ec7si7554904qtb.668.2023.11.14.11.27.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 Nov 2023 11:27:30 -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=apjY9uTQ; 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 1r2z3x-0003ts-JD; Tue, 14 Nov 2023 14:27:05 -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 1r2z3v-0003tW-RS for qemu-devel@nongnu.org; Tue, 14 Nov 2023 14:27:03 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r2z3u-00070e-Ac for qemu-devel@nongnu.org; Tue, 14 Nov 2023 14:27:03 -0500 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1cc3542e328so45124915ad.1 for ; Tue, 14 Nov 2023 11:27:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699990020; x=1700594820; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YU1go63PndchrVnK6DHWLmkVnDCLAEuAU/t//fUCSL8=; b=apjY9uTQYnXdfj26MSngIfqL69GokTmwPbrjmLKVROSwvxol9MihKQNgrGalLVuRn8 crsTkfgh/tiZq12b0C6qmc6kyuCTpVdfV1eLtaJOUmeCNXPJ0nySum5cN6utoA+m/SGx +rf5YqHY7rcZJuv8F++XiCHDZp+rJA3DkWWBsq0vBAxY4uAlwu1ecNVRBAmINZoioA6D OixZqXZYPMVDEUvMbpHOCAZ6t/9MIaFck88Gst/D3TmxaQNa55vGcmnHa2wKTscOizV7 J4jDayVPpMWN3OQ9n4WwJzh9pJomWte0aoTRiQ6p6X1ciJCV476g+N+UWONZvFybrQLO FNNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699990020; x=1700594820; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YU1go63PndchrVnK6DHWLmkVnDCLAEuAU/t//fUCSL8=; b=DeSS9kjvQQIIpqWTs2+/GZQvlcB6JWZGglNk6UPdil3xNzuGeWTdRJpFEbo71is4gJ nl3z1XHQPdnakcEhoheV+lOhX+CFBxqwXxWniPOaPdhOoIVEcCTXyAupVjuGZN2PiYwH eclFjprXvjP0Pk0Vi1+eWVSo3eZUO4uxRXY940q045zPQaGJXi/PrIoSyzrPqE/jLNAy wEoHFDqZUy+a8ltpg8Vx70ngourgt7cUDFT1wzI2TX8V1eCC0xmkaxf1nU34N0GVYB6Y Us7PptSKaSJnGrIhTJtwTWiMtagnwsYdOPiElR0X8O8VKzaiZam538NLqV/4J7si/HW3 Rh7A== X-Gm-Message-State: AOJu0Yy6FwxpFxVwZq7uvyPqzg2oexly4q7qFdO+a5nQj7ZRggsOfH1a M9OP351LvnWR6M2IBd7noiNmkFtpyKCnM2F9N9I= X-Received: by 2002:a17:902:db0b:b0:1cc:5833:cf5e with SMTP id m11-20020a170902db0b00b001cc5833cf5emr3872457plx.27.1699990020403; Tue, 14 Nov 2023 11:27:00 -0800 (PST) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id j18-20020a170902c3d200b001c728609574sm6052643plj.6.2023.11.14.11.26.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 11:27:00 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PULL 3/3] target/sparc: Fix RETURN Date: Tue, 14 Nov 2023 11:26:56 -0800 Message-Id: <20231114192656.176451-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231114192656.176451-1-richard.henderson@linaro.org> References: <20231114192656.176451-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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, 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 Reviewed-by: Philippe Mathieu-Daudé Tested-by: Mark Cave-Ayland Acked-by: Mark Cave-Ayland Signed-off-by: Richard Henderson --- 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; }