mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v9 0/5] selftests/mm: refactor pkey helpers and fix mmap error handling
@ 2026-07-02  6:23 Hongfu Li
  2026-07-02  6:23 ` [PATCH v9 1/5] selftests/mm: move pkey selftest helpers to pkey_util.c Hongfu Li
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Hongfu Li @ 2026-07-02  6:23 UTC (permalink / raw)
  To: akpm, david, ljs, liam, vbabka, rppt, surenb, mhocko, shuah
  Cc: linux-mm, linux-kselftest, linux-kernel, jhubbard, joey.gouly,
	keith.lucas, kevin.brodsky, usama.anjum, yury.khrustalev,
	zwisler, hongfu.li, Hongfu Li

The main changes in this series are to refactor shared tracing and assertion
helpers into a common file, unify both pkey selftests on pkey_assert() and
per-test tracing for consistent diagnostics, and add missing mmap() return
checks with MAP_FAILED used throughout for readability and consistency.

Hongfu Li (5):
  selftests/mm: move pkey selftest helpers to pkey_util.c
  selftests/mm: unify pkey sighandler selftest assertions and tracing
  selftests/mm: use pkey_assert on clone_raw failure in pkey test
  selftests/mm: add missing mmap() return checks in pkey tests
  selftests/mm: add missing pthread_create() return checks in pkey tests

 tools/testing/selftests/mm/pkey-helpers.h     |   4 +-
 tools/testing/selftests/mm/pkey-powerpc.h     |   2 +-
 .../selftests/mm/pkey_sighandler_tests.c      | 107 ++++++++++--------
 tools/testing/selftests/mm/pkey_util.c        |  90 +++++++++++++++
 tools/testing/selftests/mm/protection_keys.c  |  99 ++--------------
 5 files changed, 159 insertions(+), 143 deletions(-)

---
v9:
- In patch 1/5, define test_nr, iteration_nr and dprint_in_signal in
  pkey_util.c and remove them from protection_keys.c and
  pkey_sighandler_tests.c.
- In patch 1/5, cat_into_file() used the wrong argument in the open()
  failure message; print file instead of str. Update the commit message
  accordingly.
- In patch 2/5, align clone_raw() continuation lines to the opening parenthesis.
- In patch 5/5, set errno from pthread_create() return value before
  pkey_assert(0) on thread creation failure.
- Add Acked-by, Reviewed-by and Tested-by tags to each patch.
v8:
- No code changes (relative to v7).
- Updated Cc list: added developers identified via `git blame` and
  `git log` on tools/testing/selftests/mm/pkey*
v7:
- As previously suggested, wait for v7.2-rc1 and rebased the whole series
  on top of it. No functional code changes.
v6:
- Add missing pthread_create() return checks (new patch 5/5).
- In patch 2/5, call tracing_off() at the start of test_pkru_sigreturn
  before the SIGSEGV handler is reset to SIG_DFL, to avoid leaving ftrace
  enabled on crash.
v5:
- Use ret instead of child_pid to hold the return value of clone_raw().
- Make tracing_on(), tracing_off() non-static.
  Remove cat_into_file() declaration from pkey-helpers.h.
v4:
- Base changes on top of the latest mm-unstable branch.
- Split the first patch into three:
  patch 1: move pkey selftest helpers to shared code;
  patch 2: unify sighandler selftest assertions and per-test tracing;
  patch 3: use pkey_assert() on clone_raw() failure.
- Use ksft_exit_fail_perror() in main() for mmap() failure.
v3:
- Use pkey_assert() for remaining sigaction() and clone_raw() error
  checks for consistency.
v2:
- Update commit message
- Move shared tracing and assertion helpers to a common file,
  replace assert() with pkey_assert() in sighandler tests
- Drop assert() from main() in protection_keys.c and add a proper error
  message instead.
- Link to v1: https://lore.kernel.org/all/20260518082120.3890552-1-lihongfu@kylinos.cn/
-- 
2.25.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-07-06 13:47 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-02  6:23 [PATCH v9 0/5] selftests/mm: refactor pkey helpers and fix mmap error handling Hongfu Li
2026-07-02  6:23 ` [PATCH v9 1/5] selftests/mm: move pkey selftest helpers to pkey_util.c Hongfu Li
2026-07-06  9:28   ` David Hildenbrand (Arm)
2026-07-06 10:31     ` Hongfu Li
2026-07-06 13:46       ` David Hildenbrand (Arm)
2026-07-02  6:23 ` [PATCH v9 2/5] selftests/mm: unify pkey sighandler selftest assertions and tracing Hongfu Li
2026-07-02  7:32   ` Kevin Brodsky
2026-07-02  6:23 ` [PATCH v9 3/5] selftests/mm: use pkey_assert on clone_raw failure in pkey test Hongfu Li
2026-07-02  6:23 ` [PATCH v9 4/5] selftests/mm: add missing mmap() return checks in pkey tests Hongfu Li
2026-07-02  6:23 ` [PATCH v9 5/5] selftests/mm: add missing pthread_create() " Hongfu Li
2026-07-05 20:48 ` [PATCH v9 0/5] selftests/mm: refactor pkey helpers and fix mmap error handling Andrew Morton
2026-07-06  7:32   ` Hongfu Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®