This patch series was first developed as part of the LKCamp hackathon
that happened last year[1], mainly focusing on refactoring DRM tests to
use KUnit.
KUnit[2][3] is a unified test framework that provides helper tools,
simplifying their development and execution. Using an x86-64 machine
it's possible to run tests in the host's kernel natively using user-mode
Linux[4] (aka UML), which simplifies usage in a wide variety of
scenarios, including integration to CI.
As the tool's adoption widens into graphics testing territory, I and
LKCamp members figured it would be important to support it in IGT, as
it's a core tool for GPU drivers maintainers.
I have then added KUnit support into IGT mainly following the KTAP
specs, and it can be tested using patch 4/4 in this series together with
a DRM selftests patch series available at [5].
Changes since v1:
- Major rework of parsing function structure:
- It is not longer recursive
- Adapt kselftests functions and structs to be used with KUnit
- Switch DRM selftests to KUnit parsing as they're updated in the kernel
- Replace AMD KUnit tests by DRM selftests
[1]: https://groups.google.com/g/kunit-dev/c/YqFR1q2uZvk/m/IbvItSfHBAAJ
[2]: https://kunit.dev
[3]: https://docs.kernel.org/dev-tools/kunit/index.html
[4]: http://user-mode-linux.sourceforge.net
[5]: https://lore.kernel.org/all/20220708203052.236290-1-maira.canal@usp.br/
Isabella Basso (4):
lib/igt_kmod: rename kselftest functions to ktest
lib/igt_kmod.c: check if module is builtin before attempting to unload
it
lib/igt_kmod: add compatibility for KUnit
tests: DRM selftests: switch to KUnit
lib/igt_kmod.c | 315 +++++++++++++++++++++++++++++++++++++++++--
lib/igt_kmod.h | 14 +-
tests/drm_buddy.c | 7 +-
tests/drm_mm.c | 7 +-
tests/kms_selftest.c | 12 +-
5 files changed, 329 insertions(+), 26 deletions(-)
--
2.37.2
AMX architecture involves several entities such as xstate, XCR0,
IA32_XFD. This series add several missing checks on top of the existing
amx_test. In particular, the 1st commit just fixes a typo in comment.
The 2nd and 4th commit focus on the properties of IA32_XFD/IA32_XFD_ERR
when interating with xsavec and #NM, while the 3rd commit adds the
checking of xcomp_bv in xstate.
Mingwei Zhang (4):
KVM: selftests: x86: Fix an error in comment of amx_test
KVM: selftests: x86: Add check of IA32_XFD in amx_test
KVM: selftests: x86: Enable checking on xcomp_bv in amx_test
KVM: selftests: x86: Repeat the checking of xheader when IA32_XFD[18]
is set in amx_test
tools/testing/selftests/kvm/x86_64/amx_test.c | 43 +++++++++++++++++--
1 file changed, 40 insertions(+), 3 deletions(-)
--
2.39.0.314.g84b9a713c41-goog
Currently, the KUnit debugfs logs have a few issues:
1. The results of parameterized tests don’t show up
2. The order of the lines in the logs is sometimes incorrect
3. There are extra new lines in the logs
This patch series aims to fix these issues.
This is an example of a debugfs log prior to these fixes:
KTAP version 1
# Subtest: kunit_status
1..2
# kunit_status: pass:2 fail:0 skip:0 total:2
# Totals: pass:2 fail:0 skip:0 total:2
ok 1 kunit_status_set_failure_test
ok 2 kunit_status_mark_skipped_test
ok 1 kunit_status
Note there is an extra line and a few of the lines are out of order.
This is the same debugfs log after the fixes:
KTAP version 1
# Subtest: kunit_status
1..2
ok 1 kunit_status_set_failure_test
ok 2 kunit_status_mark_skipped_test
# kunit_status: pass:2 fail:0 skip:0 total:2
# Totals: pass:2 fail:0 skip:0 total:2
ok 4 kunit_status
This is now equivalent to the regular KTAP output for the kunit_status
test.
Thanks!
-Rae
Rae Moar (3):
kunit: fix bug in debugfs logs of parameterized tests
kunit: fix bug in the order of lines in debugfs logs
kunit: fix bug of extra newline characters in debugfs logs
include/kunit/test.h | 2 +-
lib/kunit/debugfs.c | 13 ++++++++-----
lib/kunit/kunit-test.c | 36 ++++++++++++++++++++++++------------
lib/kunit/test.c | 36 ++++++++++++++++++++++--------------
4 files changed, 55 insertions(+), 32 deletions(-)
base-commit: 766f4f2514d2d18bcbd60a058188fb502dea5ddf
--
2.39.1.456.gfc5497dd1b-goog
Hello,
The aim of this patch series is to improve the resctrl selftest.
Without these fixes, some unnecessary processing will be executed
and test results will be confusing.
There is no behavior change in test themselves.
[patch 1] Make write_schemata() run to set up shemata with 100% allocation
on first run in MBM test.
[patch 2] The MBA test result message is always output as "ok",
make output message to be "not ok" if MBA check result is failed.
[patch 3] When a child process is created by fork(), the buffer of the
parent process is also copied. Flush the buffer before
executing fork().
[patch 4] Add a signal handler to cleanup properly before exiting the
parent process if there is an error occurs after creating
a child process with fork() in the CAT test, and unregister
signal handler when each test finished.
[patch 5] Before exiting each test CMT/CAT/MBM/MBA, clear test result
files function cat/cmt/mbm/mba_test_cleanup() are called
twice. Delete once.
This patch series is based on Linux v6.2-rc6.
Difference from v5:
[patch 4]
- If an error occurs in signal_handler_register() return -1,
and if an error occurs in signal_handler_unregister() does
not return any value.
- If signal_handler_register() fails, stop the running
parents&child process.
- Ignore the result of signal_handler_unregister()
so as not to overwrite earlier value of ret.
- Fix change log.
Shaopeng Tan (5):
selftests/resctrl: Fix set up schemata with 100% allocation on first
run in MBM test
selftests/resctrl: Return MBA check result and make it to output
message
selftests/resctrl: Flush stdout file buffer before executing fork()
selftests/resctrl: Cleanup properly when an error occurs in CAT test
selftests/resctrl: Remove duplicate codes that clear each test result
file
tools/testing/selftests/resctrl/cat_test.c | 29 ++++----
tools/testing/selftests/resctrl/cmt_test.c | 7 +-
tools/testing/selftests/resctrl/fill_buf.c | 14 ----
tools/testing/selftests/resctrl/mba_test.c | 23 +++---
tools/testing/selftests/resctrl/mbm_test.c | 20 +++---
tools/testing/selftests/resctrl/resctrl.h | 2 +
.../testing/selftests/resctrl/resctrl_tests.c | 4 --
tools/testing/selftests/resctrl/resctrl_val.c | 71 +++++++++++++------
tools/testing/selftests/resctrl/resctrlfs.c | 5 +-
9 files changed, 98 insertions(+), 77 deletions(-)
--
2.27.0
Arm have recently released versions 2 and 2.1 of the SME extension.
Among the features introduced by SME 2 is some new architectural state,
the ZT0 register. This series adds support for this and all the other
features of the new SME versions.
Since the architecture has been designed with the possibility of adding
further ZTn registers in mind the interfaces added for ZT0 are done with
this possibility in mind. As ZT0 is a simple fixed size register these
interfaces are all fairly simple, the main complication is that ZT0 is
only accessible when PSTATE.ZA is enabled. The memory allocation that we
already do for PSTATE.ZA is extended to include space for ZT0.
Due to textual collisions especially around the addition of hwcaps this
is based on the recently merged series "arm64: Support for 2022 data
processing instructions" but there is no meaningful interaction. There
will be collisions with "arm64/signal: Signal handling cleanups" if that
is applied but again not super substantial.
v4:
- Rebase onto v6.2-rc3.
- Add SME2 value to ID_AA64PFR1_EL1.SME and move cpufeature to key off
it.
- Fix cut'n'paste errors and missing capability in hwcap table.
- Fix bitrot in za-test program.
- Typo and cut'n'paste fixes.
v3:
- Rebase onto merged series for the 2022 architectur extensions.
- Clarifications and typo fixes in the ABI documentation.
v2:
- Add missing initialisation of user->zt in signal context parsing.
- Change the magic for ZT signal frames to 0x5a544e01 (ZTN0).
To: Catalin Marinas <catalin.marinas(a)arm.com>
To: Will Deacon <will(a)kernel.org>
To: Oleg Nesterov <oleg(a)redhat.com>
To: Marc Zyngier <maz(a)kernel.org>
To: James Morse <james.morse(a)arm.com>
To: Alexandru Elisei <alexandru.elisei(a)arm.com>
To: Suzuki K Poulose <suzuki.poulose(a)arm.com>
To: Oliver Upton <oliver.upton(a)linux.dev>
Cc: Alan Hayward <alan.hayward(a)arm.com>
Cc: Luis Machado <luis.machado(a)arm.com>,
Cc: Szabolcs Nagy <szabolcs.nagy(a)arm.com>
Cc: linux-arm-kernel(a)lists.infradead.org
Cc: linux-kernel(a)vger.kernel.org
Cc: kvmarm(a)lists.linux.dev
To: Shuah Khan <shuah(a)kernel.org>
Cc: linux-kselftest(a)vger.kernel.org
---
Mark Brown (21):
arm64/sme: Rename za_state to sme_state
arm64: Document boot requirements for SME 2
arm64/sysreg: Update system registers for SME 2 and 2.1
arm64/sme: Document SME 2 and SME 2.1 ABI
arm64/esr: Document ISS for ZT0 being disabled
arm64/sme: Manually encode ZT0 load and store instructions
arm64/sme: Enable host kernel to access ZT0
arm64/sme: Add basic enumeration for SME2
arm64/sme: Provide storage for ZT0
arm64/sme: Implement context switching for ZT0
arm64/sme: Implement signal handling for ZT
arm64/sme: Implement ZT0 ptrace support
arm64/sme: Add hwcaps for SME 2 and 2.1 features
kselftest/arm64: Add a stress test program for ZT0
kselftest/arm64: Cover ZT in the FP stress test
kselftest/arm64: Enumerate SME2 in the signal test utility code
kselftest/arm64: Teach the generic signal context validation about ZT
kselftest/arm64: Add test coverage for ZT register signal frames
kselftest/arm64: Add SME2 coverage to syscall-abi
kselftest/arm64: Add coverage of the ZT ptrace regset
kselftest/arm64: Add coverage of SME 2 and 2.1 hwcaps
Documentation/arm64/booting.rst | 10 +
Documentation/arm64/elf_hwcaps.rst | 18 +
Documentation/arm64/sme.rst | 52 ++-
arch/arm64/include/asm/cpufeature.h | 6 +
arch/arm64/include/asm/esr.h | 1 +
arch/arm64/include/asm/fpsimd.h | 30 +-
arch/arm64/include/asm/fpsimdmacros.h | 22 ++
arch/arm64/include/asm/hwcap.h | 6 +
arch/arm64/include/asm/processor.h | 2 +-
arch/arm64/include/uapi/asm/hwcap.h | 6 +
arch/arm64/include/uapi/asm/sigcontext.h | 19 ++
arch/arm64/kernel/cpufeature.c | 28 ++
arch/arm64/kernel/cpuinfo.c | 6 +
arch/arm64/kernel/entry-fpsimd.S | 30 +-
arch/arm64/kernel/fpsimd.c | 47 ++-
arch/arm64/kernel/hyp-stub.S | 6 +
arch/arm64/kernel/idreg-override.c | 1 +
arch/arm64/kernel/process.c | 21 +-
arch/arm64/kernel/ptrace.c | 60 +++-
arch/arm64/kernel/signal.c | 113 ++++++-
arch/arm64/kvm/fpsimd.c | 2 +-
arch/arm64/tools/cpucaps | 1 +
arch/arm64/tools/sysreg | 27 +-
include/uapi/linux/elf.h | 1 +
tools/testing/selftests/arm64/abi/hwcap.c | 115 +++++++
.../testing/selftests/arm64/abi/syscall-abi-asm.S | 43 ++-
tools/testing/selftests/arm64/abi/syscall-abi.c | 40 ++-
tools/testing/selftests/arm64/fp/.gitignore | 2 +
tools/testing/selftests/arm64/fp/Makefile | 5 +
tools/testing/selftests/arm64/fp/fp-stress.c | 29 +-
tools/testing/selftests/arm64/fp/sme-inst.h | 20 ++
tools/testing/selftests/arm64/fp/zt-ptrace.c | 365 +++++++++++++++++++++
tools/testing/selftests/arm64/fp/zt-test.S | 317 ++++++++++++++++++
tools/testing/selftests/arm64/signal/.gitignore | 1 +
.../testing/selftests/arm64/signal/test_signals.h | 2 +
.../selftests/arm64/signal/test_signals_utils.c | 3 +
.../selftests/arm64/signal/testcases/testcases.c | 36 ++
.../selftests/arm64/signal/testcases/testcases.h | 1 +
.../selftests/arm64/signal/testcases/zt_no_regs.c | 51 +++
.../selftests/arm64/signal/testcases/zt_regs.c | 85 +++++
40 files changed, 1558 insertions(+), 72 deletions(-)
---
base-commit: b7bfaa761d760e72a969d116517eaa12e404c262
change-id: 20221208-arm64-sme2-363c27227a32
Best regards,
--
Mark Brown <broonie(a)kernel.org>
From: Masami Hiramatsu (Google) <mhiramat(a)kernel.org>
Since commit a1d6cd88c897 ("selftests/ftrace: event_triggers: wait
longer for test_event_enable") introduced bash specific "=="
comparation operator, that test will fail when we run it on a
posix-shell. `checkbashisms` warned it as below.
possible bashism in ftrace/func_event_triggers.tc line 45 (should be 'b = a'):
if [ "$e" == $val ]; then
This replaces it with "=".
Fixes: a1d6cd88c897 ("selftests/ftrace: event_triggers: wait longer for test_event_enable")
Signed-off-by: Masami Hiramatsu (Google) <mhiramat(a)kernel.org>
---
.../ftrace/test.d/ftrace/func_event_triggers.tc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc
index 3eea2abf68f9..2ad7d4b501cc 100644
--- a/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc
+++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc
@@ -42,7 +42,7 @@ test_event_enabled() {
while [ $check_times -ne 0 ]; do
e=`cat $EVENT_ENABLE`
- if [ "$e" == $val ]; then
+ if [ "$e" = $val ]; then
return 0
fi
sleep $SLEEP_TIME