[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v9 17/46] target/arm: Restrict the values of DCZID.BS under TCG
From: |
Richard Henderson |
Subject: |
[PATCH v9 17/46] target/arm: Restrict the values of DCZID.BS under TCG |
Date: |
Thu, 25 Jun 2020 20:31:15 -0700 |
We can simplify our DC_ZVA if we recognize that the largest BS
that we actually use in system mode is 64. Let us just assert
that it fits within TARGET_PAGE_SIZE.
For DC_GVA and STZGM, we want to be able to write whole bytes
of tag memory, so assert that BS is >= 2 * TAG_GRANULE, or 32.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/cpu.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index d9b8ec791e..d9876337c0 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -1758,6 +1758,30 @@ static void arm_cpu_realizefn(DeviceState *dev, Error
**errp)
}
#endif
+ if (tcg_enabled()) {
+ int dcz_blocklen = 4 << cpu->dcz_blocksize;
+
+ /*
+ * We only support DCZ blocklen that fits on one page.
+ *
+ * Architectually this is always true. However TARGET_PAGE_SIZE
+ * is variable and, for compatibility with -machine virt-2.7,
+ * is only 1KiB, as an artifact of legacy ARMv5 subpage support.
+ * But even then, while the largest architectural DCZ blocklen
+ * is 2KiB, no cpu actually uses such a large blocklen.
+ */
+ assert(dcz_blocklen <= TARGET_PAGE_SIZE);
+
+ /*
+ * We only support DCZ blocksize >= 2*TAG_GRANULE, which is to say
+ * both nibbles of each byte storing tag data may be written at once.
+ * Since TAG_GRANULE is 16, this means that blocklen must be >= 32.
+ */
+ if (cpu_isar_feature(aa64_mte, cpu)) {
+ assert(dcz_blocklen >= 2 * TAG_GRANULE);
+ }
+ }
+
qemu_init_vcpu(cs);
cpu_reset(cs);
--
2.25.1
- [PATCH v9 08/46] target/arm: Add MTE bits to tb_flags, (continued)
- [PATCH v9 08/46] target/arm: Add MTE bits to tb_flags, Richard Henderson, 2020/06/25
- [PATCH v9 09/46] target/arm: Implement the IRG instruction, Richard Henderson, 2020/06/25
- [PATCH v9 10/46] target/arm: Revise decoding for disas_add_sub_imm, Richard Henderson, 2020/06/25
- [PATCH v9 11/46] target/arm: Implement the ADDG, SUBG instructions, Richard Henderson, 2020/06/25
- [PATCH v9 12/46] target/arm: Implement the GMI instruction, Richard Henderson, 2020/06/25
- [PATCH v9 13/46] target/arm: Implement the SUBP instruction, Richard Henderson, 2020/06/25
- [PATCH v9 14/46] target/arm: Define arm_cpu_do_unaligned_access for user-only, Richard Henderson, 2020/06/25
- [PATCH v9 15/46] target/arm: Implement LDG, STG, ST2G instructions, Richard Henderson, 2020/06/25
- [PATCH v9 16/46] target/arm: Implement the STGP instruction, Richard Henderson, 2020/06/25
- [PATCH v9 18/46] target/arm: Simplify DC_ZVA, Richard Henderson, 2020/06/25
- [PATCH v9 17/46] target/arm: Restrict the values of DCZID.BS under TCG,
Richard Henderson <=
- [PATCH v9 20/46] target/arm: Implement the access tag cache flushes, Richard Henderson, 2020/06/25
- [PATCH v9 19/46] target/arm: Implement the LDGM, STGM, STZGM instructions, Richard Henderson, 2020/06/25
- [PATCH v9 21/46] target/arm: Move regime_el to internals.h, Richard Henderson, 2020/06/25
- [PATCH v9 22/46] target/arm: Move regime_tcr to internals.h, Richard Henderson, 2020/06/25
- [PATCH v9 23/46] target/arm: Add gen_mte_check1, Richard Henderson, 2020/06/25
- [PATCH v9 24/46] target/arm: Add gen_mte_checkN, Richard Henderson, 2020/06/25
- [PATCH v9 25/46] target/arm: Implement helper_mte_check1, Richard Henderson, 2020/06/25
- [PATCH v9 26/46] target/arm: Implement helper_mte_checkN, Richard Henderson, 2020/06/25
- [PATCH v9 27/46] target/arm: Add helper_mte_check_zva, Richard Henderson, 2020/06/25
- [PATCH v9 28/46] target/arm: Use mte_checkN for sve unpredicated loads, Richard Henderson, 2020/06/25