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

kselftest/arm64: Extend vector configuration API tests to cover SME

Provide RDVL helpers for SME and extend the main vector configuration tests
to cover SME.

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-32-broonie@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

authored by

Mark Brown and committed by
Catalin Marinas
a0f2eb64 30e3a42b

+38 -1
+1
tools/testing/selftests/arm64/fp/.gitignore
··· 1 1 fp-pidbench 2 2 fpsimd-test 3 + rdvl-sme 3 4 rdvl-sve 4 5 sve-probe-vls 5 6 sve-ptrace
+2 -1
tools/testing/selftests/arm64/fp/Makefile
··· 3 3 CFLAGS += -I../../../../../usr/include/ 4 4 TEST_GEN_PROGS := sve-ptrace sve-probe-vls vec-syscfg 5 5 TEST_PROGS_EXTENDED := fp-pidbench fpsimd-test fpsimd-stress \ 6 - rdvl-sve \ 6 + rdvl-sme rdvl-sve \ 7 7 sve-test sve-stress \ 8 8 vlset 9 9 ··· 13 13 $(CC) -nostdlib $^ -o $@ 14 14 fpsimd-test: fpsimd-test.o asm-utils.o 15 15 $(CC) -nostdlib $^ -o $@ 16 + rdvl-sme: rdvl-sme.o rdvl.o 16 17 rdvl-sve: rdvl-sve.o rdvl.o 17 18 sve-ptrace: sve-ptrace.o 18 19 sve-probe-vls: sve-probe-vls.o rdvl.o
+14
tools/testing/selftests/arm64/fp/rdvl-sme.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + 3 + #include <stdio.h> 4 + 5 + #include "rdvl.h" 6 + 7 + int main(void) 8 + { 9 + int vl = rdvl_sme(); 10 + 11 + printf("%d\n", vl); 12 + 13 + return 0; 14 + }
+10
tools/testing/selftests/arm64/fp/rdvl.S
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 // Copyright (C) 2021 ARM Limited. 3 3 4 + #include "sme-inst.h" 5 + 4 6 .arch_extension sve 5 7 6 8 .globl rdvl_sve 7 9 rdvl_sve: 8 10 hint 34 // BTI C 9 11 rdvl x0, #1 12 + ret 13 + 14 + .globl rdvl_sme 15 + rdvl_sme: 16 + hint 34 // BTI C 17 + 18 + rdsvl 0, 1 19 + 10 20 ret
+1
tools/testing/selftests/arm64/fp/rdvl.h
··· 3 3 #ifndef RDVL_H 4 4 #define RDVL_H 5 5 6 + int rdvl_sme(void); 6 7 int rdvl_sve(void); 7 8 8 9 #endif
+10
tools/testing/selftests/arm64/fp/vec-syscfg.c
··· 51 51 .prctl_set = PR_SVE_SET_VL, 52 52 .default_vl_file = "/proc/sys/abi/sve_default_vector_length", 53 53 }, 54 + { 55 + .name = "SME", 56 + .hwcap_type = AT_HWCAP2, 57 + .hwcap = HWCAP2_SME, 58 + .rdvl = rdvl_sme, 59 + .rdvl_binary = "./rdvl-sme", 60 + .prctl_get = PR_SME_GET_VL, 61 + .prctl_set = PR_SME_SET_VL, 62 + .default_vl_file = "/proc/sys/abi/sme_default_vector_length", 63 + }, 54 64 }; 55 65 56 66 static int stdio_read_integer(FILE *f, const char *what, int *val)