Commit a0f2eb64 authored by Mark Brown's avatar Mark Brown Committed by Catalin Marinas

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: default avatarMark Brown <broonie@kernel.org>
Reviewed-by: default avatarShuah Khan <skhan@linuxfoundation.org>
Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20220419112247.711548-32-broonie@kernel.orgSigned-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 30e3a42b
fp-pidbench fp-pidbench
fpsimd-test fpsimd-test
rdvl-sme
rdvl-sve rdvl-sve
sve-probe-vls sve-probe-vls
sve-ptrace sve-ptrace
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
CFLAGS += -I../../../../../usr/include/ CFLAGS += -I../../../../../usr/include/
TEST_GEN_PROGS := sve-ptrace sve-probe-vls vec-syscfg TEST_GEN_PROGS := sve-ptrace sve-probe-vls vec-syscfg
TEST_PROGS_EXTENDED := fp-pidbench fpsimd-test fpsimd-stress \ TEST_PROGS_EXTENDED := fp-pidbench fpsimd-test fpsimd-stress \
rdvl-sve \ rdvl-sme rdvl-sve \
sve-test sve-stress \ sve-test sve-stress \
vlset vlset
...@@ -13,6 +13,7 @@ fp-pidbench: fp-pidbench.S asm-utils.o ...@@ -13,6 +13,7 @@ fp-pidbench: fp-pidbench.S asm-utils.o
$(CC) -nostdlib $^ -o $@ $(CC) -nostdlib $^ -o $@
fpsimd-test: fpsimd-test.o asm-utils.o fpsimd-test: fpsimd-test.o asm-utils.o
$(CC) -nostdlib $^ -o $@ $(CC) -nostdlib $^ -o $@
rdvl-sme: rdvl-sme.o rdvl.o
rdvl-sve: rdvl-sve.o rdvl.o rdvl-sve: rdvl-sve.o rdvl.o
sve-ptrace: sve-ptrace.o sve-ptrace: sve-ptrace.o
sve-probe-vls: sve-probe-vls.o rdvl.o sve-probe-vls: sve-probe-vls.o rdvl.o
......
// SPDX-License-Identifier: GPL-2.0-only
#include <stdio.h>
#include "rdvl.h"
int main(void)
{
int vl = rdvl_sme();
printf("%d\n", vl);
return 0;
}
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
// Copyright (C) 2021 ARM Limited. // Copyright (C) 2021 ARM Limited.
#include "sme-inst.h"
.arch_extension sve .arch_extension sve
.globl rdvl_sve .globl rdvl_sve
...@@ -8,3 +10,11 @@ rdvl_sve: ...@@ -8,3 +10,11 @@ rdvl_sve:
hint 34 // BTI C hint 34 // BTI C
rdvl x0, #1 rdvl x0, #1
ret ret
.globl rdvl_sme
rdvl_sme:
hint 34 // BTI C
rdsvl 0, 1
ret
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#ifndef RDVL_H #ifndef RDVL_H
#define RDVL_H #define RDVL_H
int rdvl_sme(void);
int rdvl_sve(void); int rdvl_sve(void);
#endif #endif
...@@ -51,6 +51,16 @@ static struct vec_data vec_data[] = { ...@@ -51,6 +51,16 @@ static struct vec_data vec_data[] = {
.prctl_set = PR_SVE_SET_VL, .prctl_set = PR_SVE_SET_VL,
.default_vl_file = "/proc/sys/abi/sve_default_vector_length", .default_vl_file = "/proc/sys/abi/sve_default_vector_length",
}, },
{
.name = "SME",
.hwcap_type = AT_HWCAP2,
.hwcap = HWCAP2_SME,
.rdvl = rdvl_sme,
.rdvl_binary = "./rdvl-sme",
.prctl_get = PR_SME_GET_VL,
.prctl_set = PR_SME_SET_VL,
.default_vl_file = "/proc/sys/abi/sme_default_vector_length",
},
}; };
static int stdio_read_integer(FILE *f, const char *what, int *val) static int stdio_read_integer(FILE *f, const char *what, int *val)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment