From: Steven Rostedt <rostedt(a)goodmis.org>
For the tests that have both a README attribute as well as the instance
flag to run the tests as an instance, the instance version will always
exit with UNSUPPORTED. That's because the instance directory does not
contain a README file. Currently, the tests check for a README file in the
directory that the test runs in and if there's a requirement for something
to be present in the README file, it will not find it, as the instance
directory doesn't have it.
Have the tests check if the current directory is an instance directory,
and if it is, check two directories above the current directory for the
README file:
/sys/kernel/tracing/README
/sys/kernel/tracing/instances/foo/../../README
Signed-off-by: Steven Rostedt (Google) <rostedt(a)goodmis.org>
---
tools/testing/selftests/ftrace/test.d/functions | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions
index 779f3e62ec90..9f2a67fbaf4d 100644
--- a/tools/testing/selftests/ftrace/test.d/functions
+++ b/tools/testing/selftests/ftrace/test.d/functions
@@ -156,7 +156,13 @@ check_requires() { # Check required files and tracers
exit_unsupported
fi
elif [ "$r" != "$i" ]; then
- if ! grep -Fq "$r" README ; then
+ # If this is an instance, check the top directory
+ if echo $TRACING_DIR | grep -q "/instances/"; then
+ test="$TRACING_DIR/../.."
+ else
+ test=$TRACING_DIR
+ fi
+ if ! grep -Fq "$r" $test/README ; then
echo "Required feature pattern \"$r\" is not in README."
exit_unsupported
fi
--
2.45.2
Recent change to add more cases to XFAIL has a broken regex,
the matching needs a real regex not a glob pattern.
While at it add the cases Willem pointed out during review.
Fixes: 3030e3d57ba8 ("selftests/net: packetdrill: make tcp buf limited timing tests benign")
Signed-off-by: Jakub Kicinski <kuba(a)kernel.org>
---
CC: shuah(a)kernel.org
CC: willemb(a)google.com
CC: matttbe(a)kernel.org
CC: linux-kselftest(a)vger.kernel.org
---
tools/testing/selftests/net/packetdrill/ksft_runner.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/packetdrill/ksft_runner.sh b/tools/testing/selftests/net/packetdrill/ksft_runner.sh
index e15c43b7359b..ef8b25a606d8 100755
--- a/tools/testing/selftests/net/packetdrill/ksft_runner.sh
+++ b/tools/testing/selftests/net/packetdrill/ksft_runner.sh
@@ -39,11 +39,13 @@ if [[ -n "${KSFT_MACHINE_SLOW}" ]]; then
# xfail tests that are known flaky with dbg config, not fixable.
# still run them for coverage (and expect 100% pass without dbg).
declare -ar xfail_list=(
+ "tcp_eor_no-coalesce-retrans.pkt"
"tcp_fast_recovery_prr-ss.*.pkt"
+ "tcp_slow_start_slow-start-after-win-update.pkt"
"tcp_timestamping.*.pkt"
"tcp_user_timeout_user-timeout-probe.pkt"
"tcp_zerocopy_epoll_.*.pkt"
- "tcp_tcp_info_tcp-info-*-limited.pkt"
+ "tcp_tcp_info_tcp-info-.*-limited.pkt"
)
readonly xfail_regex="^($(printf '%s|' "${xfail_list[@]}"))$"
[[ "$script" =~ ${xfail_regex} ]] && failfunc=ktap_test_xfail
--
2.48.1
Hi all,
Does anyone know what the 'stty sane' invocation in kunit.py is about?
The other day I ran into an issue when running it via watchexec[1]. At
the time I believed that it was there to clean up after the firmware
that QEMU runs potentially messed up the terminal.
However, I just realised I'm not sure if that makes sense - stty is
about setting terminal settings via ioctl. I don't think QEMU or its
guests are messing up the terminal with ioctls, they're just writing
funny control characters.
What's going on here? I guess one of:
1. Terminal is messed up with ctrl chars but ioctls are the
easiest/only way to reliably clean it up.
2. Nobody thought about this unimportant detail so hard before and
there's no particular rationale in place here.
3. I made bad assumptions about why the `stty sane` is there.
If it's 1 or 2 I wonder if there's an alternative way to clean up
without getting the SIGTTOU issue.
Or, maybe it doesn't matter and the fact that this was ever a problem
is just a bug in watchexec (maybe you can tell I haven't actually
taken the time to research the SIGTTOU thing properly). But thought
I'd raise it in case this points to issues people might have using
kunit.py in CI.
[1] https://github.com/watchexec/watchexec/issues/874
[2] https://gist.github.com/bjackman/27fd9980d87c5556c20e67a6ed891500
As the vIOMMU infrastructure series part-3, this introduces a new vEVENTQ
object. The existing FAULT object provides a nice notification pathway to
the user space with a queue already, so let vEVENTQ reuse that.
Mimicing the HWPT structure, add a common EVENTQ structure to support its
derivatives: IOMMUFD_OBJ_FAULT (existing) and IOMMUFD_OBJ_VEVENTQ (new).
An IOMMUFD_CMD_VEVENTQ_ALLOC is introduced to allocate vEVENTQ object for
vIOMMUs. One vIOMMU can have multiple vEVENTQs in different types but can
not support multiple vEVENTQs in the same type.
The forwarding part is fairly simple but might need to replace a physical
device ID with a virtual device ID in a driver-level event data structure.
So, this also adds some helpers for drivers to use.
As usual, this series comes with the selftest coverage for this new ioctl
and with a real world use case in the ARM SMMUv3 driver.
This is on Github:
https://github.com/nicolinc/iommufd/commits/iommufd_veventq-v5
Testing with RMR patches for MSI:
https://github.com/nicolinc/iommufd/commits/iommufd_veventq-v5-with-rmr
Paring QEMU branch for testing:
https://github.com/nicolinc/qemu/commits/wip/for_iommufd_veventq-v5
Changelog
v5
* Add Reviewed-by from Baolu
* Reorder the OBJ list as well
* Fix alphabetical order after renaming in v4
* Add supports_veventq viommu op for vEVENTQ type validation
v4
https://lore.kernel.org/all/cover.1735933254.git.nicolinc@nvidia.com/
* Rename "vIRQ" to "vEVENTQ"
* Use flexible array in struct iommufd_vevent
* Add the new ioctl command to union ucmd_buffer
* Fix the alphabetical order in union ucmd_buffer too
* Rename _TYPE_NONE to _TYPE_DEFAULT aligning with vIOMMU naming
v3
https://lore.kernel.org/all/cover.1734477608.git.nicolinc@nvidia.com/
* Rebase on Will's for-joerg/arm-smmu/updates for arm_smmu_event series
* Add "Reviewed-by" lines from Kevin
* Fix typos in comments, kdocs, and jump tags
* Add a patch to sort struct iommufd_ioctl_op
* Update iommufd's userpsace-api documentation
* Update uAPI kdoc to quote SMMUv3 offical spec
* Drop the unused workqueue in struct iommufd_virq
* Drop might_sleep() in iommufd_viommu_report_irq() helper
* Add missing "break" in iommufd_viommu_get_vdev_id() helper
* Shrink the scope of the vmaster's read lock in SMMUv3 driver
* Pass in two arguments to iommufd_eventq_virq_handler() helper
* Move "!ops || !ops->read" validation into iommufd_eventq_init()
* Move "fault->ictx = ictx" closer to iommufd_ctx_get(fault->ictx)
* Update commit message for arm_smmu_attach_prepare/commit_vmaster()
* Keep "iommufd_fault" as-is and rename "iommufd_eventq_virq" to just
"iommufd_virq"
v2
https://lore.kernel.org/all/cover.1733263737.git.nicolinc@nvidia.com/
* Rebase on v6.13-rc1
* Add IOPF and vIRQ in iommufd.rst (userspace-api)
* Add a proper locking in iommufd_event_virq_destroy
* Add iommufd_event_virq_abort with a lockdep_assert_held
* Rename "EVENT_*" to "EVENTQ_*" to describe the objects better
* Reorganize flows in iommufd_eventq_virq_alloc for abort() to work
* Adde struct arm_smmu_vmaster to store vSID upon attaching to a nested
domain, calling a newly added iommufd_viommu_get_vdev_id helper
* Adde an arm_vmaster_report_event helper in arm-smmu-v3-iommufd file
to simplify the routine in arm_smmu_handle_evt() of the main driver
v1
https://lore.kernel.org/all/cover.1724777091.git.nicolinc@nvidia.com/
Thanks!
Nicolin
Nicolin Chen (14):
iommufd: Keep OBJ/IOCTL lists in an alphabetical order
iommufd/fault: Add an iommufd_fault_init() helper
iommufd/fault: Move iommufd_fault_iopf_handler() to header
iommufd: Abstract an iommufd_eventq from iommufd_fault
iommufd: Rename fault.c to eventq.c
iommufd: Add IOMMUFD_OBJ_VEVENTQ and IOMMUFD_CMD_VEVENTQ_ALLOC
iommufd/viommu: Add iommufd_viommu_get_vdev_id helper
iommufd/viommu: Add iommufd_viommu_report_event helper
iommufd/selftest: Require vdev_id when attaching to a nested domain
iommufd/selftest: Add IOMMU_TEST_OP_TRIGGER_VEVENT for vEVENTQ
coverage
iommufd/selftest: Add IOMMU_VEVENTQ_ALLOC test coverage
Documentation: userspace-api: iommufd: Update FAULT and VEVENTQ
iommu/arm-smmu-v3: Introduce struct arm_smmu_vmaster
iommu/arm-smmu-v3: Report events that belong to devices attached to
vIOMMU
drivers/iommu/iommufd/Makefile | 2 +-
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 30 ++
drivers/iommu/iommufd/iommufd_private.h | 116 ++++++-
drivers/iommu/iommufd/iommufd_test.h | 10 +
include/linux/iommufd.h | 24 ++
include/uapi/linux/iommufd.h | 46 +++
tools/testing/selftests/iommu/iommufd_utils.h | 65 ++++
.../arm/arm-smmu-v3/arm-smmu-v3-iommufd.c | 71 ++++
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 90 ++++--
drivers/iommu/iommufd/driver.c | 63 ++++
drivers/iommu/iommufd/{fault.c => eventq.c} | 303 ++++++++++++++----
drivers/iommu/iommufd/hw_pagetable.c | 6 +-
drivers/iommu/iommufd/main.c | 37 ++-
drivers/iommu/iommufd/selftest.c | 53 +++
drivers/iommu/iommufd/viommu.c | 2 +
tools/testing/selftests/iommu/iommufd.c | 27 ++
.../selftests/iommu/iommufd_fail_nth.c | 7 +
Documentation/userspace-api/iommufd.rst | 16 +
18 files changed, 843 insertions(+), 125 deletions(-)
rename drivers/iommu/iommufd/{fault.c => eventq.c} (54%)
base-commit: e94dc6ddda8dd3770879a132d577accd2cce25f9
--
2.43.0
Package build environments like Fedora rpmbuild introduced hardening
options (e.g. -pie -Wl,-z,now) by passing a -spec option to CFLAGS
and LDFLAGS.
mptcp Makefile currently overrides CFLAGS but not LDFLAGS, which leads
to a mismatch and build failure, for example:
make[1]: *** [../../lib.mk:222: tools/testing/selftests/net/mptcp/mptcp_sockopt] Error 1
/usr/bin/ld: /tmp/ccqyMVdb.o: relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
Signed-off-by: Jan Stancek <jstancek(a)redhat.com>
---
tools/testing/selftests/net/mptcp/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/mptcp/Makefile b/tools/testing/selftests/net/mptcp/Makefile
index 8e3fc05a5397..9706bc73809f 100644
--- a/tools/testing/selftests/net/mptcp/Makefile
+++ b/tools/testing/selftests/net/mptcp/Makefile
@@ -2,7 +2,7 @@
top_srcdir = ../../../../..
-CFLAGS = -Wall -Wl,--no-as-needed -O2 -g -I$(top_srcdir)/usr/include $(KHDR_INCLUDES)
+CFLAGS += -Wall -Wl,--no-as-needed -O2 -g -I$(top_srcdir)/usr/include $(KHDR_INCLUDES)
TEST_PROGS := mptcp_connect.sh pm_netlink.sh mptcp_join.sh diag.sh \
simult_flows.sh mptcp_sockopt.sh userspace_pm.sh
--
2.43.0
A few cleanups and optimizations for the management of the kernel
configuration.
Signed-off-by: Thomas Weißschuh <linux(a)weissschuh.net>
---
Thomas Weißschuh (5):
selftests/nolibc: drop custom EXTRACONFIG functionality
selftests/nolibc: drop call to prepare target
selftests/nolibc: drop call to mrproper target
selftests/nolibc: execute defconfig before other targets
selftests/nolibc: always keep test kernel configuration up to date
tools/testing/selftests/nolibc/Makefile | 17 +++++------------
tools/testing/selftests/nolibc/run-tests.sh | 5 +----
2 files changed, 6 insertions(+), 16 deletions(-)
---
base-commit: 60fe18237f72e3a186127658452dbb0992113cf7
change-id: 20250122-nolibc-config-d639e1612c93
Best regards,
--
Thomas Weißschuh <linux(a)weissschuh.net>
Hi Linus,
Please pull the following kunit next update for Linux 6.14-rc1.
- fixes struct completion warning
- introduces autorun option
- adds fallback for os.sched_getaffinity
- enables hardware acceleration when available
Note:
Stephen reported duplicate patch in kunit and driver-core:
The following commit is also in the driver-core tree as a different commit
(but the same patch):
875aec2357cd ("kunit: platform: Resolve 'struct completion' warning")
This is commit
7687c66c18c6 ("kunit: platform: Resolve 'struct completion' warning")
in the driver-core tree.
diff is attached.
thanks,
-- Shuah
----------------------------------------------------------------
The following changes since commit 40384c840ea1944d7c5a392e8975ed088ecf0b37:
Linux 6.13-rc1 (2024-12-01 14:28:56 -0800)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux_kselftest-kunit-6.14-rc1
for you to fetch changes up to 31691914c392675bdc65d1e72dd8d129a1f0014f:
kunit: Introduce autorun option (2025-01-15 09:04:06 -0700)
----------------------------------------------------------------
linux_kselftest-kunit-6.14-rc1
- fixes struct completion warning
- introduces autorun option
- adds fallback for os.sched_getaffinity
- enables hardware acceleration when available
----------------------------------------------------------------
Brian Norris (1):
kunit: platform: Resolve 'struct completion' warning
Stanislav Kinsburskii (1):
kunit: Introduce autorun option
Tamir Duberstein (2):
kunit: add fallback for os.sched_getaffinity
kunit: enable hardware acceleration when available
include/kunit/platform_device.h | 1 +
include/kunit/test.h | 4 +++-
lib/kunit/Kconfig | 12 ++++++++++++
lib/kunit/debugfs.c | 2 +-
lib/kunit/executor.c | 21 +++++++++++++++++++--
lib/kunit/test.c | 6 ++++--
tools/testing/kunit/kunit.py | 11 ++++++++++-
tools/testing/kunit/kunit_kernel.py | 3 +++
tools/testing/kunit/qemu_configs/arm64.py | 2 +-
9 files changed, 54 insertions(+), 8 deletions(-)
----------------------------------------------------------------
Hi Linus,
Please pull the following kseltest update for Linux 6.14-rc1.
- fixes, reporting improvements, and cleanup changes to several tests
- adds support for DT_GNU_HASH to selftests/vDSO
Note:
Stephen reported conflict between the following two commits and the fix is
in the linux-next:
912d6f669725 ("selftests/net: packetdrill: report benign debug flakes as xfail")
from the net-next tree and commit:
279e9403c5bd ("selftests: Warn about skipped tests in result summary")
from the kselftest tree.
diff is attached.
thanks,
-- Shuah
----------------------------------------------------------------
The following changes since commit 5bc55a333a2f7316b58edc7573e8e893f7acb532:
Linux 6.13-rc7 (2025-01-12 14:37:56 -0800)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux_kselftest-next-6.14-rc1
for you to fetch changes up to 336d02bc4c6bec5c3d933e5d470a94970f830957:
selftests/rseq: Fix handling of glibc without rseq support (2025-01-15 10:54:48 -0700)
----------------------------------------------------------------
linux_kselftest-next-6.14-rc1
- fixes, reporting improvements, and cleanup changes to several tests
- adds support for DT_GNU_HASH to selftests/vDSO
----------------------------------------------------------------
Brendan Jackman (1):
selftests/run_kselftest.sh: Fix help string for --per-test-log
Carlos Llamas (1):
selftest: media_tests: fix trivial UAF typo
Dmitry V. Levin (1):
selftests: harness: fix printing of mismatch values in __EXPECT()
Fangrui Song (1):
selftests/vDSO: support DT_GNU_HASH
Geert Uytterhoeven (1):
selftests: timers: clocksource-switch: Adapt progress to kselftest framework
Laura Nao (1):
selftests: Warn about skipped tests in result summary
Li Zhijian (2):
selftests/filesystems: Add missing gitignore file
selftests/zram: gitignore output file
Maciej Wieczor-Retman (2):
selftests/resctrl: Adjust effective L3 cache size with SNC enabled
selftests/resctrl: Discover SNC kernel support and adjust messages
Masami Hiramatsu (Google) (2):
selftests/ftrace: Fix to use remount when testing mount GID option
selftests/ftrace: Make uprobe test more robust against binary name
Mathieu Desnoyers (1):
selftests/rseq: Fix handling of glibc without rseq support
Shivam Chaudhary (3):
selftests: acct: Add ksft_exit_skip if not running as root
selftests: tmpfs: Add Test-skip if not run as root
selftests: tmpfs: Add kselftest support to tmpfs
Stefano Pigozzi (1):
selftests: kselftest: Add ksft_test_result_xpass
Vincent Donnefort (1):
selftests/ring-buffer: Add test for out-of-bound pgoff mapping
zhang jiao (2):
selftests/ipc: Remove unused variables
selftests: kselftest: Fix the wrong format specifier
tools/testing/selftests/acct/acct_syscall.c | 2 +-
.../selftests/filesystems/statmount/.gitignore | 1 +
.../ftrace/test.d/00basic/mount_options.tc | 8 +-
.../ftrace/test.d/dynevent/add_remove_uprobe.tc | 4 +-
tools/testing/selftests/ipc/msgque.c | 2 +-
tools/testing/selftests/kselftest.h | 28 ++++-
tools/testing/selftests/kselftest/ksft.py | 3 +
tools/testing/selftests/kselftest/ktap_helpers.sh | 4 +
tools/testing/selftests/kselftest_harness.h | 24 ++--
.../selftests/media_tests/regression_test.txt | 8 +-
tools/testing/selftests/resctrl/Makefile | 1 +
tools/testing/selftests/resctrl/cmt_test.c | 4 +-
tools/testing/selftests/resctrl/mba_test.c | 2 +
tools/testing/selftests/resctrl/mbm_test.c | 4 +-
tools/testing/selftests/resctrl/resctrl.h | 6 +
tools/testing/selftests/resctrl/resctrl_tests.c | 9 +-
tools/testing/selftests/resctrl/resctrlfs.c | 137 +++++++++++++++++++++
tools/testing/selftests/ring-buffer/map_test.c | 8 +-
tools/testing/selftests/rseq/rseq.c | 32 +++--
tools/testing/selftests/rseq/rseq.h | 9 +-
tools/testing/selftests/run_kselftest.sh | 2 +-
.../testing/selftests/timers/clocksource-switch.c | 6 +-
tools/testing/selftests/tmpfs/bug-link-o-tmpfile.c | 41 +++---
tools/testing/selftests/vDSO/parse_vdso.c | 110 ++++++++++++-----
tools/testing/selftests/zram/.gitignore | 2 +
25 files changed, 371 insertions(+), 86 deletions(-)
create mode 100644 tools/testing/selftests/zram/.gitignore
----------------------------------------------------------------