From patchwork Mon Jun 20 17:51:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 583173 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5036:0:0:0:0 with SMTP id e22csp919464mab; Mon, 20 Jun 2022 11:01:38 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uZlwtnUNK3A1lByw2ymDU6U371+nD7s5eckUBf/tuVSTI72mwDTjqjyTxrX9YvJUmNkyeE X-Received: by 2002:a05:620a:4015:b0:6a7:8025:832f with SMTP id h21-20020a05620a401500b006a78025832fmr17107089qko.140.1655748097994; Mon, 20 Jun 2022 11:01:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655748097; cv=none; d=google.com; s=arc-20160816; b=haj2Z4bP4evE+SKQQ7VWrmgcsfGvn9nB4qDIGRddDidSdgPHflRUITax92Y/BxSWhE Eszl0X0jgfDzh4v+gSpU22j5H7n/yMVj8UkHz51oi1lflUPMvR5QCqutZdPV2FtuTzP1 BagDOd1s0U+M+AkRAuF5ETyL8U1PIK5xvCHwu0oHlDMh6x44ocFqJIG/9qRykYlPGfV6 CQTMgGV10PVDnEtwFwh4SGmmDQh5t43Dx/sBdDBhtt9JW/SPxfgV+0G4zZNyEk+jrTsd RHGH0/oqoRNd/Fs9xZRBTSYO7ySU6e6o4FXZamLQeUkM9awanPmnIGpHdHHVfzla30WC wkpA== 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=GI+YlDQYkDB/N7mh7auOF6n5z7sxW3awZsRTI+xJ+O8=; b=eIDoHrRYqR4PH6MDbwi6uLQxeIyGKo23e0xPMEeHup8e2kIxGksiRKXXvTeYB45dU7 mcEHz4C8rRgPQ1wrqYyAAZJvt7jHmTQ+fOgr5ROMv8AGsRO9zVVd/WD5JjDWF7QFGlCw EGvGaEHxi1O1hG+dSxQihITVZxYhQ7sqU/PZcp6YXVhBGg7avgrlWVMD5y2fMKHvVPaq iKk3tOyJ7joH+XLtW//tzcm0eiLsxx5BAwqZFCsm2T6hFEP8UyfriGAamGVG3HCDz9Rq cBky+zX8W5VInm4dJIpJNQPtG8HlUwVdQVLdzt3LbFqU5LfdrXQgqRDUu7q3Mg82o1a1 Yeow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ui6Jv1VS; 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 bq39-20020a05620a46a700b006a6b1d34315si8350430qkb.395.2022.06.20.11.01.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Jun 2022 11:01:37 -0700 (PDT) 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=Ui6Jv1VS; 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]:33816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3LiT-0002I0-H4 for patch@linaro.org; Mon, 20 Jun 2022 14:01:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3LZu-0005cZ-F3 for qemu-devel@nongnu.org; Mon, 20 Jun 2022 13:52:46 -0400 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]:44641) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o3LZs-0001NO-Qv for qemu-devel@nongnu.org; Mon, 20 Jun 2022 13:52:46 -0400 Received: by mail-pg1-x52a.google.com with SMTP id a14so1282766pgh.11 for ; Mon, 20 Jun 2022 10:52:44 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=GI+YlDQYkDB/N7mh7auOF6n5z7sxW3awZsRTI+xJ+O8=; b=Ui6Jv1VSNxw+TnwLYlwaSuTkhMfo67zUK/R/myq0tuXimgLuLEgDxZ37H3nc/nM9X3 8eeogw77pGTjhLOuD7gqx1KtB3pePwHaD44qg4m6MdIuN9hUAlepIsEk+Vt6j4p/UhPk PccBPij1v5Q3Eg2tzuzQIAINlSFVeg0tXJ4eawbn6nnoGiZaDd76rWq+uFBij7X1dRcP glNy7Mk+cW6+OaWAYrHU62KJlSFmqGTu86lvSmP62uM7VD1aBfDLMt3+ioxe8fHFIJks kdh08mabEBMn9n6ss/PbcUB2pQm5KgwngI31G+208oKOc+wPhI6se37mKJnEzldEg9f2 SbUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GI+YlDQYkDB/N7mh7auOF6n5z7sxW3awZsRTI+xJ+O8=; b=egjX5BMRd7to0MDduaCNVaT2OmLwuFUJ9REcLuBEQnY5+1BPjtMBzd37iJMc3enp1M aAKKVObk1LD2PBMAkcCi0NhKd1AtFUqcR295v5IUjv4kkNSsMn8CZqDRwvnzvBFLQZcL nxJSRGR0Bg/7aVkNsYONeKlIV0Cxa0XaVYvf40+XPAjz5lkE5+yhBd6zmWkHwYV9Y6kg A9s4SIn3Uar6KbcOYWSrorPtUSVtE0EVBMWt1G+/xEzU+gR8A+GKtXKY5zixZEgR3c/x N8jmb8b+g8dgO9zVBulzEXEmWbH1cfB3Ims7GJMjc4wPGJkuG6EbhRIvOLgNF8ieo9SA DzhQ== X-Gm-Message-State: AJIora++qlyahUWxEDOz0IV6NtyvsTAOIJt3qtJTsksU7nhmUVtqKQ7w 3Q0zVPjj1UrtFSeEDbNpPaEUsQsI0O+y+Q== X-Received: by 2002:a05:6a00:2185:b0:520:7276:6570 with SMTP id h5-20020a056a00218500b0052072766570mr25433927pfi.84.1655747563472; Mon, 20 Jun 2022 10:52:43 -0700 (PDT) Received: from stoup.. ([2602:47:d49e:3c01:a3e0:8a80:7b85:aea6]) by smtp.gmail.com with ESMTPSA id j14-20020aa7928e000000b00525133f98adsm5138138pfa.146.2022.06.20.10.52.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jun 2022 10:52:43 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell Subject: [PATCH v3 08/51] target/arm: Add PSTATE.{SM,ZA} to TB flags Date: Mon, 20 Jun 2022 10:51:52 -0700 Message-Id: <20220620175235.60881-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220620175235.60881-1-richard.henderson@linaro.org> References: <20220620175235.60881-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52a.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=unavailable 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" These are required to determine if various insns are allowed to issue. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/cpu.h | 2 ++ target/arm/translate.h | 4 ++++ target/arm/helper.c | 4 ++++ target/arm/translate-a64.c | 2 ++ 4 files changed, 12 insertions(+) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index dec52c6c3b..05d369e690 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -3160,6 +3160,8 @@ FIELD(TBFLAG_A64, TCMA, 16, 2) FIELD(TBFLAG_A64, MTE_ACTIVE, 18, 1) FIELD(TBFLAG_A64, MTE0_ACTIVE, 19, 1) FIELD(TBFLAG_A64, SMEEXC_EL, 20, 2) +FIELD(TBFLAG_A64, PSTATE_SM, 22, 1) +FIELD(TBFLAG_A64, PSTATE_ZA, 23, 1) /* * Helpers for using the above. diff --git a/target/arm/translate.h b/target/arm/translate.h index c88c953325..93766649f7 100644 --- a/target/arm/translate.h +++ b/target/arm/translate.h @@ -97,6 +97,10 @@ typedef struct DisasContext { bool align_mem; /* True if PSTATE.IL is set */ bool pstate_il; + /* True if PSTATE.SM is set. */ + bool pstate_sm; + /* True if PSTATE.ZA is set. */ + bool pstate_za; /* True if MVE insns are definitely not predicated by VPR or LTPSIZE */ bool mve_no_pred; /* diff --git a/target/arm/helper.c b/target/arm/helper.c index bbd04fbd67..e06c054c3d 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -11335,6 +11335,10 @@ static CPUARMTBFlags rebuild_hflags_a64(CPUARMState *env, int el, int fp_el, } if (cpu_isar_feature(aa64_sme, env_archcpu(env))) { DP_TBFLAG_A64(flags, SMEEXC_EL, sme_exception_el(env, el)); + if (FIELD_EX64(env->svcr, SVCR, SM)) { + DP_TBFLAG_A64(flags, PSTATE_SM, 1); + } + DP_TBFLAG_A64(flags, PSTATE_ZA, FIELD_EX64(env->svcr, SVCR, ZA)); } sctlr = regime_sctlr(env, stage1); diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 8f609f46b6..5cf4a283ba 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -14630,6 +14630,8 @@ static void aarch64_tr_init_disas_context(DisasContextBase *dcbase, dc->ata = EX_TBFLAG_A64(tb_flags, ATA); dc->mte_active[0] = EX_TBFLAG_A64(tb_flags, MTE_ACTIVE); dc->mte_active[1] = EX_TBFLAG_A64(tb_flags, MTE0_ACTIVE); + dc->pstate_sm = EX_TBFLAG_A64(tb_flags, PSTATE_SM); + dc->pstate_za = EX_TBFLAG_A64(tb_flags, PSTATE_ZA); dc->vec_len = 0; dc->vec_stride = 0; dc->cp_regs = arm_cpu->cp_regs;