From nobody Tue Feb 10 13:18:05 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1622032009; cv=none; d=zohomail.com; s=zohoarc; b=eEEABrTvpkdw53l8KeGD1zgr2/TuP60j2OrtlSSo/7NRWqV/4ODWjKiyJCt5EqLIgfYhPLAAXoFoqA39lbC1Y8GRaW6mMmNEDBMC3tM3RdTmliXcCe93Vp8bToO9eWObgYVgRkQmRvxEyL/ysYAz5tIX6Qks4q1VzFmOxQxBMMo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622032009; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YzZcKLssN7IMbDyrpIALXOlPU1SgzuV4mOV0Xk2F1ro=; b=Jw9m09v3ZYN0lFHHlratCqTvFbTgz0ttJvtF+BrONT0ncVM5goP0i0gUcdt7o6+yDYmuZ7ojeDL0HfgZqpBL44RZ/PZEUbtLtIvPAci0cFLO1TlG+kE7MXM0U8PTwcjYagpaUy+7yuNx3ZuCZFaFoPOIjQL4ZKBC5jwf5O3ycbg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622032009459313.5667207460302; Wed, 26 May 2021 05:26:49 -0700 (PDT) Received: from localhost ([::1]:34532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llsca-0000z1-5M for importer@patchew.org; Wed, 26 May 2021 08:26:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36634) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llsV6-0001a4-9y for qemu-devel@nongnu.org; Wed, 26 May 2021 08:19:04 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:46806) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llsUy-00033q-CB for qemu-devel@nongnu.org; Wed, 26 May 2021 08:19:04 -0400 Received: by mail-wm1-x329.google.com with SMTP id l18-20020a1c79120000b0290181c444b2d0so382730wme.5 for ; Wed, 26 May 2021 05:18:55 -0700 (PDT) Received: from localhost ([82.44.17.50]) by smtp.gmail.com with ESMTPSA id q11sm14634522wrx.80.2021.05.26.05.18.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 05:18:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YzZcKLssN7IMbDyrpIALXOlPU1SgzuV4mOV0Xk2F1ro=; b=EdvBbosOQzKMxr8CF4OHRsrOo+a4DByEwTwhnCH4NvbGm/DN0eTvXW7z47PeIQf7i1 hWD3UjR24N3L0WVWOr5gbbaK2L1QxOReU24L6OpROSYkH/aIE7SAno+yNp+Gs0FhqLrw 4Fvan53o8KG8Higqh+wMRfuczEVdoBx9hN77+IwTzjTOi/PiEi+2jJ+5MIP6MIp/mDKt 0sceW266kQBnSHyyWTQBaVYmQejIDCKq4Ov8G3K96Imol0JZVkLfBsZwEbrDl6K6W/uV 6QPs+E+Xs2/9HSDLfo9A4VKFNk0hBUqdD3CYSGOULrkgc0Qthw5l4L0pGtSGwQMT4hIO chJg== 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=YzZcKLssN7IMbDyrpIALXOlPU1SgzuV4mOV0Xk2F1ro=; b=Egznp0+w5AldQF2d+fTpu3GtRx2NYBPYHs/cgRUl2Eg7wo82xdnnc+mDw/ijGJGPQs FbqP637hyMsDZnIHzLCkwsVn/jtVXZ9jkggPDY8aMEtO5620HeXr/VYVRkkozp1gfnzp AXDpnzY8CCWgp0h2W9Y7p3bsOqSRjtBp9etqJnv43ZMppaBgNMwTZxWb8HPl74PMNS/G L7ZKMmFwvXVl8iLRZTIvTCb0V81g7GYx5CRsuDwywG6Aaz0Nsl3ubJwoQ7S6MQxoDpKz QneMgFd+BhSlnyxuCZAfRrKbgqeXmH2FmlY6I1X7dS0cAei4vO5rHqj69EEWu3jb1fwj KM5w== X-Gm-Message-State: AOAM5335r16S0+0+FkzD4DhYbA+kI/FDUwXHimnZUVXBbNLiG+OddU4x cx1FEx+Z8mWlyZWfRt8Dg3I1EA== X-Google-Smtp-Source: ABdhPJz/YwYJK9TWFzbv6ha0yQNxxvWtkT/WCKqqWxvRgjZhOCw1PkRPDq+3Ja1SN2SnuG2fcCjGdg== X-Received: by 2002:a05:600c:4f15:: with SMTP id l21mr28463396wmq.37.1622031535083; Wed, 26 May 2021 05:18:55 -0700 (PDT) From: Jamie Iles To: qemu-arm@nongnu.org Subject: [PATCHv2 3/4] target/arm: use raise_exception_ra for MTE check failure Date: Wed, 26 May 2021 13:18:46 +0100 Message-Id: <20210526121847.1935454-4-jamie@nuviainc.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210526121847.1935454-1-jamie@nuviainc.com> References: <20210526121847.1935454-1-jamie@nuviainc.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=jamie@nuviainc.com; helo=mail-wm1-x329.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-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: Peter Maydell , Jamie Iles , Richard Henderson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Now that raise_exception_ra restores the state before raising the exception we can use restore_exception_ra to perform the state restore + exception raising without clobbering the syndrome. Cc: Richard Henderson Cc: Peter Maydell Signed-off-by: Jamie Iles --- target/arm/mte_helper.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/target/arm/mte_helper.c b/target/arm/mte_helper.c index a6fccc6e69e2..d48419583747 100644 --- a/target/arm/mte_helper.c +++ b/target/arm/mte_helper.c @@ -563,20 +563,13 @@ static void mte_check_fail(CPUARMState *env, uint32_t= desc, =20 switch (tcf) { case 1: - /* - * Tag check fail causes a synchronous exception. - * - * In restore_state_to_opc, we set the exception syndrome - * for the load or store operation. Unwind first so we - * may overwrite that with the syndrome for the tag check. - */ - cpu_restore_state(env_cpu(env), ra, true); env->exception.vaddress =3D dirty_ptr; =20 is_write =3D FIELD_EX32(desc, MTEDESC, WRITE); syn =3D syn_data_abort_no_iss(arm_current_el(env) !=3D 0, 0, 0, 0,= 0, is_write, 0x11); - raise_exception(env, EXCP_DATA_ABORT, syn, exception_target_el(env= )); + raise_exception_ra(env, EXCP_DATA_ABORT, syn, + exception_target_el(env), ra); /* noreturn, but fall through to the assert anyway */ =20 case 0: --=20 2.30.2