[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 16/45] target/arm: Handle SME in sve_access_check
From: |
Peter Maydell |
Subject: |
[PULL 16/45] target/arm: Handle SME in sve_access_check |
Date: |
Mon, 11 Jul 2022 14:57:21 +0100 |
From: Richard Henderson <richard.henderson@linaro.org>
The pseudocode for CheckSVEEnabled gains a check for Streaming
SVE mode, and for SME present but SVE absent.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220708151540.18136-17-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
target/arm/translate-a64.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index b16d81bf197..b7b64f73584 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -1183,21 +1183,31 @@ static bool fp_access_check(DisasContext *s)
return true;
}
-/* Check that SVE access is enabled. If it is, return true.
+/*
+ * Check that SVE access is enabled. If it is, return true.
* If not, emit code to generate an appropriate exception and return false.
+ * This function corresponds to CheckSVEEnabled().
*/
bool sve_access_check(DisasContext *s)
{
- if (s->sve_excp_el) {
- assert(!s->sve_access_checked);
- s->sve_access_checked = true;
-
+ if (s->pstate_sm || !dc_isar_feature(aa64_sve, s)) {
+ assert(dc_isar_feature(aa64_sme, s));
+ if (!sme_sm_enabled_check(s)) {
+ goto fail_exit;
+ }
+ } else if (s->sve_excp_el) {
gen_exception_insn_el(s, s->pc_curr, EXCP_UDEF,
syn_sve_access_trap(), s->sve_excp_el);
- return false;
+ goto fail_exit;
}
s->sve_access_checked = true;
return fp_access_check(s);
+
+ fail_exit:
+ /* Assert that we only raise one exception per instruction. */
+ assert(!s->sve_access_checked);
+ s->sve_access_checked = true;
+ return false;
}
/*
--
2.25.1
- [PULL 13/45] target/arm: Mark LDFF1 and LDNF1 as non-streaming, (continued)
- [PULL 13/45] target/arm: Mark LDFF1 and LDNF1 as non-streaming, Peter Maydell, 2022/07/11
- [PULL 25/45] target/arm: Implement BFMOPA, BFMOPS, Peter Maydell, 2022/07/11
- [PULL 22/45] target/arm: Implement SME LDR, STR, Peter Maydell, 2022/07/11
- [PULL 27/45] target/arm: Implement SME integer outer product, Peter Maydell, 2022/07/11
- [PULL 29/45] target/arm: Implement REVD, Peter Maydell, 2022/07/11
- [PULL 15/45] target/arm: Add SME enablement checks, Peter Maydell, 2022/07/11
- [PULL 12/45] target/arm: Mark gather prefetch as non-streaming, Peter Maydell, 2022/07/11
- [PULL 02/45] target/arm: Add infrastructure for disas_sme, Peter Maydell, 2022/07/11
- [PULL 09/45] target/arm: Mark SMMLA, UMMLA, USMMLA as non-streaming, Peter Maydell, 2022/07/11
- [PULL 06/45] target/arm: Mark BDEP, BEXT, BGRP, COMPACT, FEXPA, FTSSEL as non-streaming, Peter Maydell, 2022/07/11
- [PULL 16/45] target/arm: Handle SME in sve_access_check,
Peter Maydell <=
- [PULL 19/45] target/arm: Implement SME MOVA, Peter Maydell, 2022/07/11
- [PULL 21/45] target/arm: Export unpredicated ld/st from translate-sve.c, Peter Maydell, 2022/07/11
- [PULL 24/45] target/arm: Implement FMOPA, FMOPS (non-widening), Peter Maydell, 2022/07/11
- [PULL 17/45] target/arm: Implement SME RDSVL, ADDSVL, ADDSPL, Peter Maydell, 2022/07/11
- [PULL 26/45] target/arm: Implement FMOPA, FMOPS (widening), Peter Maydell, 2022/07/11
- [PULL 31/45] target/arm: Reset streaming sve state on exception boundaries, Peter Maydell, 2022/07/11
- [PULL 33/45] linux-user/aarch64: Clear tpidr2_el0 if CLONE_SETTLS, Peter Maydell, 2022/07/11
- [PULL 37/45] linux-user/aarch64: Do not allow duplicate or short sve records, Peter Maydell, 2022/07/11
- [PULL 34/45] linux-user/aarch64: Reset PSTATE.SM on syscalls, Peter Maydell, 2022/07/11
- [PULL 30/45] target/arm: Implement SCLAMP, UCLAMP, Peter Maydell, 2022/07/11
- Prev by Date:
[PULL 06/45] target/arm: Mark BDEP, BEXT, BGRP, COMPACT, FEXPA, FTSSEL as non-streaming
- Next by Date:
[PULL 19/45] target/arm: Implement SME MOVA
- Previous by thread:
[PULL 06/45] target/arm: Mark BDEP, BEXT, BGRP, COMPACT, FEXPA, FTSSEL as non-streaming
- Next by thread:
[PULL 19/45] target/arm: Implement SME MOVA
- Index(es):