From patchwork Thu Nov 9 13:42:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 742577 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:110f:b0:32d:baff:b0ca with SMTP id z15csp847590wrw; Thu, 9 Nov 2023 05:53:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IGRjgyb117Yy+4zhfIg7Mqo34KuSC7uO/0lIsb5faxeWAYI4sVNYqp0MOrMB24FTpWe/M7y X-Received: by 2002:ad4:5cad:0:b0:66d:169a:d41c with SMTP id q13-20020ad45cad000000b0066d169ad41cmr4970584qvh.19.1699538039362; Thu, 09 Nov 2023 05:53:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699538039; cv=none; d=google.com; s=arc-20160816; b=hSvY8D9lEqeCpjF4t897P7d3EU5Kx52sMXYpTepBEtg976i7atQ+V9ZOo5GaqYKK9e 5eMP7WMrSk4Bdl4eeLBwKpK46954+ME6SSDECL/6tcs/yZFEsdqfhbw6H/z0VQcj4giL g9H8+p6ijbViyT3oBBNC/TVBRz0hVcDHCmR6VvJB/1OKrAQP0xh8OJJDIX/NHgqibwAW e8gps9d5FTRZzM7e0Rrwvw8YWk4BIl5qwxvE9vCrXmCgyAaLBohgueEbg59UiYcHupEO i7jdf/stZFCkxAjsQB0iP9jzvdv9+zR+ZYpmsQlyatJgtduhsXhveLPwfsYs7Qgi10Gi y7FQ== 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; bh=HFfLcRtRh2K4TU3fjm1oXrZJuo0We/2XVBteRvIwzEI=; fh=xJ1URYKcMN3TM0/XAv5v+aCN+5tIbzAdcfBx5UNgoLw=; b=j4RJXiOScduin1bWOIHcB1ia/5uA6x1IagWXzobAhaNuX+T1x69mfDbttTmfZ48ake l1lCJaRtkJR+ADJOhWEbVwio9xpJ64VZOabHBJSvQm+UEHSnM8UhkK7N40wHPwlQfDbU d/M/cAC8DlpsJMvKLwl9JyqiVHnoKXWattelxSQCelb+bFV/yf7ngs8iDZ1K+0uZ4ca0 wq6sXsY5l17o2TwbzBd/JlbMM7Z7+nad1BF9aDlfx10PkZ/w0VuAmCFUIo+UqFH8SdD9 xas5DFnh9TnJPxuNJF3kSN36W1fw5w0kOKudHZKMmQh3Ui/JSxlvP0CwooVqitRj3NDQ qvWw== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id dn1-20020a056214094100b0066cf666c6fbsi2773070qvb.313.2023.11.09.05.53.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Nov 2023 05:53:59 -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; 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r15LQ-0002nH-DG; Thu, 09 Nov 2023 08:45:16 -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 1r15LA-0002au-Us; Thu, 09 Nov 2023 08:45:02 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r15L7-0001MR-8I; Thu, 09 Nov 2023 08:44:59 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 6E34031B0A; Thu, 9 Nov 2023 16:43:12 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 7DC0C344B1; Thu, 9 Nov 2023 16:43:04 +0300 (MSK) Received: (nullmailer pid 1461818 invoked by uid 1000); Thu, 09 Nov 2023 13:43:02 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Peter Maydell , Richard Henderson , Michael Tokarev Subject: [Stable-8.1.3 19/55] target/arm: Fix syndrome for FGT traps on ERET Date: Thu, 9 Nov 2023 16:42:23 +0300 Message-Id: <20231109134300.1461632-19-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, 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 From: Peter Maydell In commit 442c9d682c94fc2 when we converted the ERET, ERETAA, ERETAB instructions to decodetree, the conversion accidentally lost the correct setting of the syndrome register when taking a trap because of the FEAT_FGT HFGITR_EL1.ERET bit. Instead of reporting a correct full syndrome value with the EC and IL bits, we only reported the low two bits of the syndrome, because the call to syn_erettrap() got dropped. Fix the syndrome values for these traps by reinstating the syn_erettrap() calls. Fixes: 442c9d682c94fc2 ("target/arm: Convert ERET, ERETAA, ERETAB to decodetree") Cc: qemu-stable@nongnu.org Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20231024172438.2990945-1-peter.maydell@linaro.org (cherry picked from commit 307521d6e29e559c89afa9dbd337ae75fe3c436d) Signed-off-by: Michael Tokarev diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 5fa1257d32..58787ee8a7 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -1627,7 +1627,7 @@ static bool trans_ERET(DisasContext *s, arg_ERET *a) return false; } if (s->fgt_eret) { - gen_exception_insn_el(s, 0, EXCP_UDEF, 0, 2); + gen_exception_insn_el(s, 0, EXCP_UDEF, syn_erettrap(0), 2); return true; } dst = tcg_temp_new_i64(); @@ -1654,7 +1654,7 @@ static bool trans_ERETA(DisasContext *s, arg_reta *a) } /* The FGT trap takes precedence over an auth trap. */ if (s->fgt_eret) { - gen_exception_insn_el(s, 0, EXCP_UDEF, a->m ? 3 : 2, 2); + gen_exception_insn_el(s, 0, EXCP_UDEF, syn_erettrap(a->m ? 3 : 2), 2); return true; } dst = tcg_temp_new_i64();