[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 39/45] target/arm: Enable MTE for user-only
From: |
Peter Maydell |
Subject: |
[PULL 39/45] target/arm: Enable MTE for user-only |
Date: |
Thu, 11 Feb 2021 12:58:54 +0000 |
From: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20210210000223.884088-31-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
target/arm/cpu.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 70cfcbc9181..b8bc89e71fc 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -209,6 +209,21 @@ static void arm_cpu_reset(DeviceState *dev)
* Note that this must match useronly_clean_ptr.
*/
env->cp15.tcr_el[1].raw_tcr = (1ULL << 37);
+
+ /* Enable MTE */
+ if (cpu_isar_feature(aa64_mte, cpu)) {
+ /* Enable tag access, but leave TCF0 as No Effect (0). */
+ env->cp15.sctlr_el[1] |= SCTLR_ATA0;
+ /*
+ * Exclude all tags, so that tag 0 is always used.
+ * This corresponds to Linux current->thread.gcr_incl = 0.
+ *
+ * Set RRND, so that helper_irg() will generate a seed later.
+ * Here in cpu_reset(), the crypto subsystem has not yet been
+ * initialized.
+ */
+ env->cp15.gcr_el1 = 0x1ffff;
+ }
#else
/* Reset into the highest available EL */
if (arm_feature(env, ARM_FEATURE_EL3)) {
--
2.20.1
- [PULL 20/45] exec: Introduce cpu_untagged_addr, (continued)
- [PULL 20/45] exec: Introduce cpu_untagged_addr, Peter Maydell, 2021/02/11
- [PULL 18/45] linux-user: Do not use guest_addr_valid for h2g_valid, Peter Maydell, 2021/02/11
- [PULL 19/45] linux-user: Fix guest_addr_valid vs reserved_va, Peter Maydell, 2021/02/11
- [PULL 23/45] linux-user: Use guest_range_valid in access_ok, Peter Maydell, 2021/02/11
- [PULL 21/45] exec: Use cpu_untagged_addr in g2h; split out g2h_untagged, Peter Maydell, 2021/02/11
- [PULL 25/45] linux-user: Use cpu_untagged_addr in access_ok; split out *_untagged, Peter Maydell, 2021/02/11
- [PULL 24/45] exec: Rename guest_{addr,range}_valid to *_untagged, Peter Maydell, 2021/02/11
- [PULL 29/45] linux-user/aarch64: Implement PR_TAGGED_ADDR_ENABLE, Peter Maydell, 2021/02/11
- [PULL 35/45] linux-user/aarch64: Pass syndrome to EXC_*_ABORT, Peter Maydell, 2021/02/11
- [PULL 31/45] target/arm: Use the proper TBI settings for linux-user, Peter Maydell, 2021/02/11
- [PULL 39/45] target/arm: Enable MTE for user-only,
Peter Maydell <=
- [PULL 22/45] linux-user: Explicitly untag memory management syscalls, Peter Maydell, 2021/02/11
- [PULL 26/45] linux-user: Move lock_user et al out of line, Peter Maydell, 2021/02/11
- [PULL 28/45] linux-user: Handle tags in lock_user/unlock_user, Peter Maydell, 2021/02/11
- [PULL 27/45] linux-user: Fix types in uaccess.c, Peter Maydell, 2021/02/11
- [PULL 30/45] target/arm: Improve gen_top_byte_ignore, Peter Maydell, 2021/02/11
- [PULL 32/45] linux-user/aarch64: Implement PR_MTE_TCF and PR_MTE_TAG, Peter Maydell, 2021/02/11
- [PULL 33/45] linux-user/aarch64: Implement PROT_MTE, Peter Maydell, 2021/02/11
- [PULL 34/45] target/arm: Split out syndrome.h from internals.h, Peter Maydell, 2021/02/11
- [PULL 36/45] linux-user/aarch64: Signal SEGV_MTESERR for sync tag check fault, Peter Maydell, 2021/02/11
- [PULL 43/45] tests/qtests: Add npcm7xx emc model test, Peter Maydell, 2021/02/11