summaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorRichard Henderson2019-02-05 17:52:40 +0100
committerPeter Maydell2019-02-05 17:52:40 +0100
commitf6a148fef63698826e69ca91cc11877ab1ed786f (patch)
treecaa1193efb3bfdda4c8aefae3553dfe3b52ff3ff /target
parenttarget/arm: Compute TB_FLAGS for TBI for user-only (diff)
downloadqemu-f6a148fef63698826e69ca91cc11877ab1ed786f.tar.gz
qemu-f6a148fef63698826e69ca91cc11877ab1ed786f.tar.xz
qemu-f6a148fef63698826e69ca91cc11877ab1ed786f.zip
target/arm: Enable TBI for user-only
This has been enabled in the linux kernel since v3.11 (commit d50240a5f6cea, 2013-09-03, "arm64: mm: permit use of tagged pointers at EL0"). Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20190204132126.3255-5-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target')
-rw-r--r--target/arm/cpu.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 3874dc9875..edf6e0e1f1 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -200,6 +200,12 @@ static void arm_cpu_reset(CPUState *s)
env->vfp.zcr_el[1] = cpu->sve_max_vq - 1;
env->vfp.zcr_el[2] = env->vfp.zcr_el[1];
env->vfp.zcr_el[3] = env->vfp.zcr_el[1];
+ /*
+ * Enable TBI0 and TBI1. While the real kernel only enables TBI0,
+ * turning on both here will produce smaller code and otherwise
+ * make no difference to the user-level emulation.
+ */
+ env->cp15.tcr_el[1].raw_tcr = (3ULL << 37);
#else
/* Reset into the highest available EL */
if (arm_feature(env, ARM_FEATURE_EL3)) {