return ret;
 }
 
+static int zt_get(struct task_struct *target,
+                 const struct user_regset *regset,
+                 struct membuf to)
+{
+       if (!system_supports_sme2())
+               return -EINVAL;
+
+       /*
+        * If PSTATE.ZA is not set then ZT will be zeroed when it is
+        * enabled so report the current register value as zero.
+        */
+       if (thread_za_enabled(&target->thread))
+               membuf_write(&to, thread_zt_state(&target->thread),
+                            ZT_SIG_REG_BYTES);
+       else
+               membuf_zero(&to, ZT_SIG_REG_BYTES);
+
+       return 0;
+}
+
+static int zt_set(struct task_struct *target,
+                 const struct user_regset *regset,
+                 unsigned int pos, unsigned int count,
+                 const void *kbuf, const void __user *ubuf)
+{
+       int ret;
+
+       if (!system_supports_sme2())
+               return -EINVAL;
+
+       if (!thread_za_enabled(&target->thread)) {
+               sme_alloc(target);
+               if (!target->thread.sme_state)
+                       return -ENOMEM;
+       }
+
+       ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
+                                thread_zt_state(&target->thread),
+                                0, ZT_SIG_REG_BYTES);
+       if (ret == 0)
+               target->thread.svcr |= SVCR_ZA_MASK;
+
+       return ret;
+}
+
 #endif /* CONFIG_ARM64_SME */
 
 #ifdef CONFIG_ARM64_PTR_AUTH
 #ifdef CONFIG_ARM64_SVE
        REGSET_SSVE,
        REGSET_ZA,
+       REGSET_ZT,
 #endif
 #ifdef CONFIG_ARM64_PTR_AUTH
        REGSET_PAC_MASK,
                .regset_get = za_get,
                .set = za_set,
        },
+       [REGSET_ZT] = { /* SME ZT */
+               .core_note_type = NT_ARM_ZT,
+               .n = 1,
+               .size = ZT_SIG_REG_BYTES,
+               .align = sizeof(u64),
+               .regset_get = zt_get,
+               .set = zt_set,
+       },
 #endif
 #ifdef CONFIG_ARM64_PTR_AUTH
        [REGSET_PAC_MASK] = {
 
 #define NT_ARM_PAC_ENABLED_KEYS        0x40a   /* arm64 ptr auth enabled keys (prctl()) */
 #define NT_ARM_SSVE    0x40b           /* ARM Streaming SVE registers */
 #define NT_ARM_ZA      0x40c           /* ARM SME ZA registers */
+#define NT_ARM_ZT      0x40d           /* ARM SME ZT registers */
 #define NT_ARC_V2      0x600           /* ARCv2 accumulator/extra registers */
 #define NT_VMCOREDD    0x700           /* Vmcore Device Dump Note */
 #define NT_MIPS_DSP    0x800           /* MIPS DSP ASE registers */