target/arm/cpu.c | 4 ++++ 1 file changed, 4 insertions(+)
On SME2 systems, Linux sets SMCR_EL1.EZT0 in cpu_enable_sme2()
to allow user space to access ZT0.
linux-user already initializes SMCR_EL1.LEN and FA64 to match the
kernel's setup, but leaves EZT0 clear (see commit 3aad4bc8beb9
"target/arm: Add zt0_excp_el to DisasContext"). Set EZT0 when SME2
is present to keep the emulated EL1 state consistent with Linux.
This has no functional effect because CONFIG_USER_ONLY omits the
ZT0 trap checks.
Reported-by: Samyuktha K <samyu@qti.qualcomm.com>
Suggested-by: Sritam Paltasingh <spaltasi@qti.qualcomm.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
target/arm/cpu.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 62262d742a27..851c9a81f3cb 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -387,6 +387,10 @@ static void arm_cpu_reset_hold(Object *obj, ResetType type)
env->vfp.smcr_el[1] = FIELD_DP64(env->vfp.smcr_el[1],
SMCR, FA64, 1);
}
+ if (cpu_isar_feature(aa64_sme2, cpu)) {
+ env->vfp.smcr_el[1] = FIELD_DP64(env->vfp.smcr_el[1],
+ SMCR, EZT0, 1);
+ }
}
/*
* Enable 48-bit address space (TODO: take reserved_va into account).
--
2.55.0
On 10/26/26 12:52, Philippe Mathieu-Daudé wrote: > On SME2 systems, Linux sets SMCR_EL1.EZT0 in cpu_enable_sme2() > to allow user space to access ZT0. > > linux-user already initializes SMCR_EL1.LEN and FA64 to match the > kernel's setup, but leaves EZT0 clear (see commit 3aad4bc8beb9 > "target/arm: Add zt0_excp_el to DisasContext"). Set EZT0 when SME2 > is present to keep the emulated EL1 state consistent with Linux. > > This has no functional effect because CONFIG_USER_ONLY omits the > ZT0 trap checks. > > Reported-by: Samyuktha K<samyu@qti.qualcomm.com> > Suggested-by: Sritam Paltasingh<spaltasi@qti.qualcomm.com> > Signed-off-by: Philippe Mathieu-Daudé<philmd@oss.qualcomm.com> > --- > target/arm/cpu.c | 4 ++++ > 1 file changed, 4 insertions(+) Reviewed-by: Richard Henderson <richard.henderson@linaro.org> r~
On Wed, 28 Oct 2026 at 11:08, Richard Henderson <richard.henderson@linaro.org> wrote: > > On 10/26/26 12:52, Philippe Mathieu-Daudé wrote: > > On SME2 systems, Linux sets SMCR_EL1.EZT0 in cpu_enable_sme2() > > to allow user space to access ZT0. > > > > linux-user already initializes SMCR_EL1.LEN and FA64 to match the > > kernel's setup, but leaves EZT0 clear (see commit 3aad4bc8beb9 > > "target/arm: Add zt0_excp_el to DisasContext"). Set EZT0 when SME2 > > is present to keep the emulated EL1 state consistent with Linux. > > > > This has no functional effect because CONFIG_USER_ONLY omits the > > ZT0 trap checks. > > > > Reported-by: Samyuktha K<samyu@qti.qualcomm.com> > > Suggested-by: Sritam Paltasingh<spaltasi@qti.qualcomm.com> > > Signed-off-by: Philippe Mathieu-Daudé<philmd@oss.qualcomm.com> > > --- > > target/arm/cpu.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Applied to target-arm.next, thanks. -- PMM
© 2016 - 2026 Red Hat, Inc.