All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [PULL 11/25] target/arm: Add PSTATE.{SM,ZA} to TB flags
Date: Mon, 27 Jun 2022 11:22:22 +0100	[thread overview]
Message-ID: <20220627102236.3097629-12-peter.maydell@linaro.org> (raw)
In-Reply-To: <20220627102236.3097629-1-peter.maydell@linaro.org>

From: Richard Henderson <richard.henderson@linaro.org>

These are required to determine if various insns
are allowed to issue.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220620175235.60881-9-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 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 dec52c6c3b9..05d369e690a 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 c88c9533253..93766649f7f 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 bbd04fbd67b..e06c054c3d7 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 8f609f46b6a..5cf4a283bac 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;
-- 
2.25.1



  parent reply	other threads:[~2022-06-27 10:36 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-27 10:22 [PULL 00/25] target-arm queue Peter Maydell
2022-06-27 10:22 ` [PULL 01/25] sphinx: change default language to 'en' Peter Maydell
2022-06-27 10:22 ` [PULL 02/25] accel: Introduce current_accel_name() Peter Maydell
2022-06-27 10:22 ` [PULL 03/25] target/arm: Catch invalid kvm state also for hvf Peter Maydell
2022-06-27 10:22 ` [PULL 04/25] target/arm: Implement TPIDR2_EL0 Peter Maydell
2022-06-27 10:22 ` [PULL 05/25] target/arm: Add SMEEXC_EL to TB flags Peter Maydell
2022-06-27 10:22 ` [PULL 06/25] target/arm: Add syn_smetrap Peter Maydell
2022-06-27 10:22 ` [PULL 07/25] target/arm: Add ARM_CP_SME Peter Maydell
2022-06-27 10:22 ` [PULL 08/25] target/arm: Add SVCR Peter Maydell
2022-06-27 10:22 ` [PULL 09/25] target/arm: Add SMCR_ELx Peter Maydell
2022-06-27 10:22 ` [PULL 10/25] target/arm: Add SMIDR_EL1, SMPRI_EL1, SMPRIMAP_EL2 Peter Maydell
2022-06-27 10:22 ` Peter Maydell [this message]
2022-06-27 10:22 ` [PULL 12/25] target/arm: Add the SME ZA storage to CPUARMState Peter Maydell
2022-06-27 10:22 ` [PULL 13/25] target/arm: Implement SMSTART, SMSTOP Peter Maydell
2022-06-27 10:22 ` [PULL 14/25] target/arm: Move error for sve%d property to arm_cpu_sve_finalize Peter Maydell
2022-06-27 10:22 ` [PULL 15/25] target/arm: Create ARMVQMap Peter Maydell
2022-06-27 10:22 ` [PULL 16/25] target/arm: Generalize cpu_arm_{get,set}_vq Peter Maydell
2022-06-27 10:22 ` [PULL 17/25] target/arm: Generalize cpu_arm_{get, set}_default_vec_len Peter Maydell
2022-06-27 10:22 ` [PULL 18/25] target/arm: Move arm_cpu_*_finalize to internals.h Peter Maydell
2022-06-27 10:22 ` [PULL 19/25] target/arm: Unexport aarch64_add_*_properties Peter Maydell
2022-06-27 10:22 ` [PULL 20/25] target/arm: Add cpu properties for SME Peter Maydell
2022-06-27 10:22 ` [PULL 21/25] target/arm: Introduce sve_vqm1_for_el_sm Peter Maydell
2022-06-27 10:22 ` [PULL 22/25] target/arm: Add SVL to TB flags Peter Maydell
2022-06-27 10:22 ` [PULL 23/25] target/arm: Move pred_{full, gvec}_reg_{offset, size} to translate-a64.h Peter Maydell
2022-06-27 10:22 ` [PULL 24/25] target/arm: Extend arm_pamax to more than aarch64 Peter Maydell
2022-06-27 10:22 ` [PULL 25/25] target/arm: Check V7VE as well as LPAE in arm_pamax Peter Maydell
2022-06-27 22:55 ` [PULL 00/25] target-arm queue Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220627102236.3097629-12-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.