Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kselftest/arm64: sme: Add SME support to vlset

The Scalable Matrix Extenions (SME) introduces additional register state
with configurable vector lengths, similar to SVE but configured separately.
Extend vlset to support configuring this state with a --sme or -s command
line option.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20220419112247.711548-30-broonie@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

authored by

Mark Brown and committed by
Catalin Marinas
e8c44514 6d51b188

+8 -2
+8 -2
tools/testing/selftests/arm64/fp/vlset.c
··· 22 22 static int no_inherit = 0; 23 23 static int force = 0; 24 24 static unsigned long vl; 25 + static int set_ctl = PR_SVE_SET_VL; 26 + static int get_ctl = PR_SVE_GET_VL; 25 27 26 28 static const struct option options[] = { 27 29 { "force", no_argument, NULL, 'f' }, 28 30 { "inherit", no_argument, NULL, 'i' }, 29 31 { "max", no_argument, NULL, 'M' }, 30 32 { "no-inherit", no_argument, &no_inherit, 1 }, 33 + { "sme", no_argument, NULL, 's' }, 31 34 { "help", no_argument, NULL, '?' }, 32 35 {} 33 36 }; ··· 53 50 case 'M': vl = SVE_VL_MAX; break; 54 51 case 'f': force = 1; break; 55 52 case 'i': inherit = 1; break; 53 + case 's': set_ctl = PR_SME_SET_VL; 54 + get_ctl = PR_SME_GET_VL; 55 + break; 56 56 case 0: break; 57 57 default: goto error; 58 58 } ··· 131 125 if (inherit) 132 126 flags |= PR_SVE_VL_INHERIT; 133 127 134 - t = prctl(PR_SVE_SET_VL, vl | flags); 128 + t = prctl(set_ctl, vl | flags); 135 129 if (t < 0) { 136 130 fprintf(stderr, "%s: PR_SVE_SET_VL: %s\n", 137 131 program_name, strerror(errno)); 138 132 goto error; 139 133 } 140 134 141 - t = prctl(PR_SVE_GET_VL); 135 + t = prctl(get_ctl); 142 136 if (t == -1) { 143 137 fprintf(stderr, "%s: PR_SVE_GET_VL: %s\n", 144 138 program_name, strerror(errno));