unsigned long fpsimd_offset;
unsigned long esr_offset;
unsigned long sve_offset;
++++++ ++++++ unsigned long tpidr2_offset;
unsigned long za_offset;
+++++ +++++++ unsigned long zt_offset;
unsigned long extra_offset;
unsigned long end_offset;
};
struct user_ctxs {
struct fpsimd_context __user *fpsimd;
struct sve_context __user *sve;
++++++ ++++++ struct tpidr2_context __user *tpidr2;
struct za_context __user *za;
+++++ +++++++ struct zt_context __user *zt;
};
#ifdef CONFIG_ARM64_SVE
#else /* ! CONFIG_ARM64_SME */
/* Turn any non-optimised out attempts to use these into a link error: */
++++++ ++++++extern int preserve_tpidr2_context(void __user *ctx);
++++++ ++++++extern int restore_tpidr2_context(struct user_ctxs *user);
extern int preserve_za_context(void __user *ctx);
extern int restore_za_context(struct user_ctxs *user);
+++++ +++++++extern int preserve_zt_context(void __user *ctx);
+++++ +++++++extern int restore_zt_context(struct user_ctxs *user);
#endif /* ! CONFIG_ARM64_SME */
user->fpsimd = NULL;
user->sve = NULL;
++++++ ++++++ user->tpidr2 = NULL;
user->za = NULL;
+++++ +++++++ user->zt = NULL;
if (!IS_ALIGNED((unsigned long)base, 16))
goto invalid;
ksft_exit_fail_msg("PR_SVE_SET_VL failed: %s (%d)\n",
strerror(errno), errno);
--- --------- sve_vl &= PR_SVE_VL_LEN_MASK;
--- ---------
--- --------- if (sve_vq != sve_vq_from_vl(sve_vl))
--- --------- sve_vq = sve_vq_from_vl(sve_vl);
--- - -------
--- - ------- ksft_test_result(do_test(cfg, sve_vl, default_sme_vl, 0),
--- - ------- "%s SVE VL %d\n", cfg->name, sve_vl);
--- - -------
--- - ------- if (!(getauxval(AT_HWCAP2) & HWCAP2_SME))
--- - ------- continue;
+++ +++++++++ ksft_test_result(do_test(cfg, sve_vls[sve], default_sme_vl, 0),
+++ +++++++++ "%s SVE VL %d\n", cfg->name, sve_vls[sve]);
- ksft_test_result(do_test(cfg, sve_vl, default_sme_vl, 0),
- "%s SVE VL %d\n", cfg->name, sve_vl);
-
- if (!(getauxval(AT_HWCAP2) & HWCAP2_SME))
- continue;
-
--- --------- for (sme_vq = SVE_VQ_MAX; sme_vq > 0; --sme_vq) {
--- --------- sme_vl = prctl(PR_SME_SET_VL, sme_vq * 16);
--- --------- if (sme_vl == -1)
+++ +++++++++ for (sme = 0; sme < sme_vl_count; sme++) {
+++ +++++++++ ret = prctl(PR_SME_SET_VL, sme_vls[sme]);
+++ +++++++++ if (ret == -1)
ksft_exit_fail_msg("PR_SME_SET_VL failed: %s (%d)\n",
strerror(errno), errno);
srandom(getpid());
ksft_print_header();
--- --------- tests += sve_count_vls();
--- --------- tests += (sve_count_vls() * sme_count_vls()) * 3;
+++ +++++++++
+++ +++++++++ sve_count_vls();
+++ +++++++++ sme_count_vls();
+++ +++++++++
+++ +++++++++ tests += sve_vl_count;
+++ +++++++++ tests += sme_vl_count * 3;
+++ +++++++++ tests += (sve_vl_count * sme_vl_count) * 3;
ksft_set_plan(ARRAY_SIZE(syscalls) * tests);
+++++ +++++++ if (getauxval(AT_HWCAP2) & HWCAP2_SME2)
+++++ +++++++ sme_ver = 2;
+++++ +++++++ else
+++++ +++++++ sme_ver = 1;
+++++ +++++++
if (getauxval(AT_HWCAP2) & HWCAP2_SME_FA64)
----- ------- ksft_print_msg("SME with FA64\n");
+++++ +++++++ ksft_print_msg("SME%d with FA64\n", sme_ver);
else if (getauxval(AT_HWCAP2) & HWCAP2_SME)
----- ------- ksft_print_msg("SME without FA64\n");
+++++ +++++++ ksft_print_msg("SME%d without FA64\n", sme_ver);
for (i = 0; i < ARRAY_SIZE(syscalls); i++)
test_one_syscall(&syscalls[i]);