From patchwork Mon Feb 11 01:08:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 157959 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2066082jaa; Sun, 10 Feb 2019 17:26:40 -0800 (PST) X-Google-Smtp-Source: AHgI3IZztA281+zrYxFTjCqRebGK/Vc2EFBR09viagbXp0asASsoVWCJTT3PPBISiPz6Dw8MYx5Z X-Received: by 2002:adf:fbc8:: with SMTP id d8mr24679107wrs.318.1549848400644; Sun, 10 Feb 2019 17:26:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549848400; cv=none; d=google.com; s=arc-20160816; b=hVdXzbPu21HbFbHkQY2bIB5iwiuEjL/TCkuqNcE8XMNUyINto1LpGKsX2HPiYKVZzO eB//q3xwwpoNhKh3n2lOF2E8O0AavZMIYCJRwmYXLkbg6fSwiIG9zZNdEhrRFdtcg9UG 1CzrglLtZb2oXweAdl9YY/dMhQ5nvCiuEF1I/ylblxNgaVg/tDeJoEJTUC/TZPtAWo6w E8u7YrVT1HPutsl3hfrWVqYJQTouGz+Ti8U7w5f/fxJUcv+7rxMK+Q+5TyHx/HXUGpp4 w9wzmDWOJYXDnjHHU7ezGv+Y1exajaHJBZsK65BwS7MvXuy0LjR4OJv567WsREE5wCv2 L+nw== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=wOgP7lobhsemXB3OvFkJ+c0fo71lcU0DJjKscTksgDY=; b=f0249DTa+GPTr2/JPcOSGPukXKazcs4jlxBxClUIGmYWtcqGWZ6uRPnjJaJ3gS78Ae SzDWVAX3YS+V6nRqCmMlM7bj/gYyb1QDO7sVqN1sCVjhNubDj2XEteh7CZktP/ge2aid 6HHc2WZxqmtcLsaiKkdf4eNnTnWHOP315FdfwEIJFnf1bqGD9LKxx+F9WLQI2VkXcaB2 PqB2c2Nfi97UCk5uCgLeF93wDxxIj9RlQyuMCzwk1xGw091RSMsoYleTrIYm17iynSlt IcTxUL7H1X37jWMrx7ZpIKpd5RwgrKTDpzlGQSP2+dzvovhZl0gyOE6CsoMemJ/rTH5j Q1uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=LhHuHHso; 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 m2si6767324wrg.33.2019.02.10.17.26.40 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 10 Feb 2019 17:26:40 -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=fail header.i=@linaro.org header.s=google header.b=LhHuHHso; 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 ([127.0.0.1]:42353 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gt0Mp-0002RP-HK for patch@linaro.org; Sun, 10 Feb 2019 20:26:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37718) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gt05x-0005zJ-Ir for qemu-devel@nongnu.org; Sun, 10 Feb 2019 20:09:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gt05t-0000CI-DJ for qemu-devel@nongnu.org; Sun, 10 Feb 2019 20:09:13 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:40459) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gt05t-0008Lq-32 for qemu-devel@nongnu.org; Sun, 10 Feb 2019 20:09:09 -0500 Received: by mail-pl1-x635.google.com with SMTP id bj4so1844896plb.7 for ; Sun, 10 Feb 2019 17:08:57 -0800 (PST) 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; bh=wOgP7lobhsemXB3OvFkJ+c0fo71lcU0DJjKscTksgDY=; b=LhHuHHsouSudzJgxA6esj9Dxhq3q4AUyafQvjtnA1+FemlnXj1cNFR+F96mJ+m8yaK nhlaBSV10xPPH+BNG5xgwE+7FnA6K29TAmYMNx2nuuDbFVb/INHJ6weI8CZsWBwbFDal z+wyHOSfyeqcEJ5bS6uZvIJgVrjGmxxN6Qr/vQbYvYppX6iOsl2IRsXghpcuVdHWKaVJ 5PUEfip/ZMCalKWaixJNQQJ4MRQFCE0artppcNiu40fiJZieX7hVBAWStPAyzj85pB54 vebBdocE9S7x8xV4lr84jGS2/aS4xX5NqYnXip2BUOD9VdLOmkEDnn9Kes8tTb71EblZ ooCg== 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; bh=wOgP7lobhsemXB3OvFkJ+c0fo71lcU0DJjKscTksgDY=; b=P3d8q6iH9wTvpSgKO1G1aB4U/A3j9/LVQDU3OTR7hZPPqGi7DHOcD8JN27DjsDyfN1 88E5uWaPVuJdIT+jqWLe/s8wSjyggBXaptRvhWG+fubXKPBch+gXLrEAWUlH+ijBHiKE 5AdnzT4bOigeKViGsJo1/QGO+jtGPiKmMWYRilyY7lwZ7quyTL6Ck+VIMyd+3Obf7UDe g4OAD7N6DND544ISJJ5zgVi2WxCLBAJwU32UCjee/yFKc4RTBNdpzW/IJjxfpzFuxTBW gbtwyE8UWpbpF6ZDo88uvfXaNi7KEZ0RVVeFj2zknP3311yv5tad0Cyvs7usx8WIs87V 4I3A== X-Gm-Message-State: AHQUAuYDNrih4a4+4GOBi7fPpVLNKiwlvd1gOGGjTlXRinInH2LuR8Q+ JibSCRkAf8h0KLzC0txtHIk5eTsLM40= X-Received: by 2002:a17:902:a50e:: with SMTP id s14mr23328196plq.311.1549847336348; Sun, 10 Feb 2019 17:08:56 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id g14sm17177630pfg.27.2019.02.10.17.08.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 10 Feb 2019 17:08:55 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 10 Feb 2019 17:08:22 -0800 Message-Id: <20190211010829.29869-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190211010829.29869-1-richard.henderson@linaro.org> References: <20190211010829.29869-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::635 Subject: [Qemu-devel] [PATCH v2 19/26] target/arm: Set PSTATE.TCO on exception entry X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" R0085 specifies that exception handlers begin with tag checks overridden. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- v2: Only set if MTE feature present. --- target/arm/helper.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) -- 2.17.2 diff --git a/target/arm/helper.c b/target/arm/helper.c index 9fac3628e5..a3ad5bc54e 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -9455,6 +9455,7 @@ static void arm_cpu_do_interrupt_aarch64(CPUState *cs) target_ulong addr = env->cp15.vbar_el[new_el]; unsigned int new_mode = aarch64_pstate_mode(new_el, true); unsigned int cur_el = arm_current_el(env); + unsigned int new_pstate; /* * Note that new_el can never be 0. If cur_el is 0, then @@ -9548,7 +9549,11 @@ static void arm_cpu_do_interrupt_aarch64(CPUState *cs) qemu_log_mask(CPU_LOG_INT, "...with ELR 0x%" PRIx64 "\n", env->elr_el[new_el]); - pstate_write(env, PSTATE_DAIF | new_mode); + new_pstate = new_mode | PSTATE_DAIF; + if (cpu_isar_feature(aa64_mte, cpu)) { + new_pstate |= PSTATE_TCO; + } + pstate_write(env, new_pstate); env->aarch64 = 1; aarch64_restore_sp(env, new_el);