mirror of
https://github.com/torvalds/linux.git
synced 2026-04-23 00:55:48 -04:00
Currently a number of SVE/SME related tests have almost identical
functions to enumerate all supported vector lengths. However over time
the copy&pasted code has diverged, allowing some bugs to creep in:
- fake_sigreturn_sme_change_vl reports a failure, not a SKIP if only
one vector length is supported (but the SVE version is fine)
- fake_sigreturn_sme_change_vl tries to set the SVE vector length, not
the SME one (but the other SME tests are fine)
- za_no_regs keeps iterating forever if only one vector length is
supported (but za_regs is correct)
Since those bugs seem to be mostly copy&paste ones, let's consolidate
the enumeration loop into one shared function, and just call that from
each test. That should fix the above bugs, and prevent similar issues
from happening again.
Fixes: 4963aeb35a ("kselftest/arm64: signal: Add SME signal handling tests")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20240821164401.3598545-1-andre.przywara@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
32 lines
1.1 KiB
Makefile
32 lines
1.1 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
# Copyright (C) 2019 ARM Limited
|
|
|
|
# Additional include paths needed by kselftest.h and local headers
|
|
CFLAGS += -D_GNU_SOURCE -std=gnu99 -I.
|
|
|
|
SRCS := $(filter-out testcases/testcases.c,$(wildcard testcases/*.c))
|
|
PROGS := $(patsubst %.c,%,$(SRCS))
|
|
|
|
# Generated binaries to be installed by top KSFT script
|
|
TEST_GEN_PROGS := $(notdir $(PROGS))
|
|
|
|
# Get Kernel headers installed and use them.
|
|
|
|
# Including KSFT lib.mk here will also mangle the TEST_GEN_PROGS list
|
|
# to account for any OUTPUT target-dirs optionally provided by
|
|
# the toplevel makefile
|
|
include ../../lib.mk
|
|
|
|
$(TEST_GEN_PROGS): $(PROGS)
|
|
cp $(PROGS) $(OUTPUT)/
|
|
|
|
# Common test-unit targets to build common-layout test-cases executables
|
|
# Needs secondary expansion to properly include the testcase c-file in pre-reqs
|
|
COMMON_SOURCES := test_signals.c test_signals_utils.c testcases/testcases.c \
|
|
signals.S sve_helpers.c
|
|
COMMON_HEADERS := test_signals.h test_signals_utils.h testcases/testcases.h
|
|
|
|
.SECONDEXPANSION:
|
|
$(PROGS): $$@.c ${COMMON_SOURCES} ${COMMON_HEADERS}
|
|
$(CC) $(CFLAGS) ${@}.c ${COMMON_SOURCES} -o $@
|